Magic Apps
Environment variables
Set configuration and secrets for the build, the running app, or both. Values are encrypted at rest.
Environment variables hold your app’s configuration and secrets. Set them in the dashboard; they take effect with the next deploy.
Encryption
Values are encrypted at rest with AES-256-GCM, with a key for each app. Each value is bound to its app and its name, so it can’t be decrypted as anything else. The copy each release keeps is encrypted the same way.
Values never appear in the list of changes waiting for a deploy, which shows only names, such as Add variable: VITE_API_URL.
Project members who can deploy can read variable values: anyone who can deploy code could read them from the running app anyway.
Build, runtime, or both
Each variable reaches the build, the running app, or both. A new variable’s scope is chosen from its name, and you can change it:
| Name starts with | Reaches |
|---|---|
NEXT_PUBLIC_, VITE_, NUXT_PUBLIC_, PUBLIC_, REACT_APP_ and similar |
Build and runtime |
RAILPACK_, MISE_ |
Build only |
| Anything else | Runtime only |
Build variables reach Railpack builds as build secrets, and Dockerfile builds as build arguments.
Applying changes
A change is saved at once and applies at the next deploy. The dashboard lists the changes waiting and offers the right deploy:
- A change to a runtime variable needs only a redeploy of the live image, with no build.
- A change to a build variable needs a new build.
Reserved names
PORT and names starting with DCUBIX_ are set by Dcubix and can’t be used. See Variables Dcubix sets.
Generated secrets
When you create an app, detection proposes the variables its framework needs. Secrets among them, such as Rails’ and Phoenix’s SECRET_KEY_BASE, are generated for you.