dock env
Manage project environment variables.
Environment variables are settings your app reads while it runs. They are where you put secrets, database URLs, API keys, and production settings.
Do not commit secrets Put secrets in DockHosting environment variables, not in Git.
Commands
dock env ls [project]
dock env set KEY=VALUE [KEY=VALUE...]
dock env unset KEY [KEY...]List variables
dock env ls
dock env ls my-appPrints the variables configured for the project.
Set variables
dock env set NODE_ENV=production API_URL=https://api.example.comSets one or more variables. Values are stored on the project.
Remove variables
dock env unset DEBUG OLD_SECRETRemoves one or more keys.
Applying changes
After changing environment variables, run dock deploy or restart the project
so the container sees the new values.
What KEY=VALUE means
KEY is the variable name. VALUE is the value your app reads.
dock env set NODE_ENV=productionYour app reads it as:
process.env.NODE_ENVCommon variables
| Variable | What it usually means |
|---|---|
DATABASE_URL | Full database connection string |
NODE_ENV | Node.js mode, usually production |
PORT | Port your app listens on |
API_KEY | Secret token for an external service |
REDIS_URL | Redis/Valkey connection string |