Config vars
Config vars are environment variables — the canonical place to put database URLs, API keys, feature flags, and anything else your app reads from process.env / ENV / os.environ. They're set per-app on the control plane and applied to every stack the app deploys to.
View config
$ ownstack config --app=<app>
DATABASE_URL=postgresql://…
RAILS_ENV=production
RAILS_MASTER_KEY=…
SUPPORT_API_URL=https://support.example.com
To get one specific var:
$ ownstack config:get DATABASE_URL --app=<app>
Set & unset
$ ownstack config:set --app=<app> FOO=bar BAZ='multi word'
$ ownstack config:unset --app=<app> FOO BAZ
Setting or unsetting triggers a rebuild + restart of all running containers on every stack the app deploys to. Pass --no-restart to defer; the change is staged and applied on the next deploy.
--no-restart means stale env in the running containerIf you set a var with --no-restart, the running container keeps its old env until you restart or redeploy. Don't assume the change took effect — check with ssh dokku@<stack-ip> config:get <app> FOO if you're debugging.
Push from a file
If you have a Heroku-formatted env file (FOO='bar' per line, shell-quoted), push it in one go:
$ ownstack config:push --app=<app> --file=heroku-config.env
This is the right tool for migration. heroku config -s -a my-app > heroku-config.env emits exactly this format.
Reserved & auto-managed vars
| Var | Source |
|---|---|
PORT | Set by dokku at runtime to a different ephemeral port per process. Don't set this yourself. |
DATABASE_URL | Set when you link a Postgres or MySQL service. Don't override directly — see Postgres for the right way to repoint. |
REDIS_URL | Set when you link Redis. |
MONGO_URL / MONGO_URI / MONGODB_URI | Set when you link MongoDB. NestJS apps get all three. |
DOKKU_* | Internal dokku vars. Don't touch. |
BUILDPACK_URL | Optional override; sets a custom buildpack URL or list. |
NODE_ENV / RAILS_ENV / PYTHON_ENV | Set automatically to production on most app types. Override if you need a different mode. |
Multi-stack: per-stack overrides
Most config is shared across all stacks. For per-stack values (different external API URL in staging vs prod, for example), set them on the stack-specific config:
$ ownstack config:set --app=<app> --stack=<stack> API_URL=https://staging.example.com
Stack-level vars take precedence over app-level vars on that stack only.
Reading at build time vs runtime
Buildpack-built apps see config vars during the build (so SPAs can bake them into bundles) and at runtime. Dockerfile apps see them only at runtime — Dockerfile builds happen before dokku has the env. If you need a value baked into a static frontend bundle, use buildpacks or accept a separate build-arg path.
Read next
- Procfile — process types.
- Domains & SSL — routing.
- CLI:
ownstack config