# Env vars

Env vars are the settings your app reads when it starts, like `DATABASE_URL` or `API_KEY`. dudbox keeps them encrypted.

## Add or change one

1. Open the app, then the **Env** tab.
2. Type the name and the value, then click **Add**. A name has letters, digits and `_`, and does not start with a digit.
3. Click **Redeploy now** in the bar that shows up. The app gets env vars only when it starts, so a change waits for the next deploy.

## Paste a .env file

Copy your whole `.env` file and paste it into the name or the value field. dudbox shows the names it found. Pick **Secret** or not, then click **Add**. A name that is there already gets the new value. Lines that start with `#` are skipped.

## Secrets

A secret's value is hidden in the list and masked in build logs. Click **Show** to see one value. When you import a repo, env vars from a pasted `.env` file are saved as secrets.

## Set by dudbox

- `PORT`: the port your app must listen on.
- One-click apps get their own env vars, such as the admin password. Leave those as they are, unless you know the app.

The API can read and set env vars too. See [Env vars in the API](/docs/api/env.md).
