DocsConfiguration
Environment Variables
Store secrets and configuration safely.
Configuration 3 min read
Environment variables are encrypted at rest and injected into your service when it starts. Changes apply the next time the service starts: restart or redeploy it to pick up new values. Secret values are masked in build and runtime logs.
bash
DISCORD_TOKEN=************
DATABASE_URL=************
NODE_ENV=productionNaming conventions
- Use uppercase with underscores:
STRIPE_SECRET_KEY, notstripeKey. - Prefix related values so they are easy to find:
DB_HOST,DB_USER,DB_PASSWORD. - Keep a
.env.examplefile in your repository listing every variable name, without values.
Reserved variables
| Variable | Value |
|---|---|
PORT | The port your web server must listen on. |
DIGITALY_REGION | The region running your service, e.g. lyon. |
DIGITALY_DEPLOYMENT_ID | Unique identifier of the current deployment. |
Never expose secret credentials in your source code or in your logs.
Was this article helpful?