Environment Variables
Configure your app with environment variables and secrets, and share them with variable groups.
Environment variables configure your application and hold its secrets. Set them per application under Settings → Environment, and reuse a set across apps with an Environment Variable Group.
Environment changes take effect on the next deployment. Use Save & deploy to apply them right away. Linking or editing a group does not restart your app on its own.
Per-App Variables
Add a key and value for each variable. Values are masked in the console, and you reveal
them on demand, so this is also where you store secrets such as API keys and database
connection strings. You can also paste a block of KEY=value lines to add many at once.
| Rule | Value |
|---|---|
| Key length | Up to 500 characters |
| Value length | Up to 5000 characters |
| Variables per app | Up to 250 |
| Keys | Unique within an app, compared case insensitively |
Some keys are reserved (HOSTNAME, and anything starting with OP_ or KUBERNETES_),
while PORT is yours to set. See Reserved & Injected Variables.
Environment Variable Groups
A group is a named set of variables you link to one or more applications, so shared configuration lives in one place. Manage groups under Settings → Environment Groups, and link them to an app from its Settings → Environment page.
Each group has a scope:
- Runtime injects the variables into the running container.
- Build passes them as build arguments, which your
Dockerfilemust declare with a matchingARG.
A group needs at least one scope. Its name allows up to 100 characters and its description up to 255, with the same limit of 250 variables. A group that is linked to an application cannot be deleted until you unlink it everywhere.