Environment Variables
Environment variables let you store secrets, API keys, and configuration for your backend deployments without hardcoding them in your source code.
Adding environment variables
- Open your backend deployment detail page
- Navigate to the Env Vars tab
- Click Add Variable
- Enter the key and value
- Click Save
Variables are encrypted at rest and only decrypted when your backend process starts.
Reserved variables
The following environment variable is set automatically and cannot be overridden:
| Variable | Description |
|---|---|
PORT | The port your server must listen on |
Updating variables
Edit any variable from the Env Vars tab. Changes take effect on the next deployment — redeploy your backend to pick up updated values.
Deleting variables
Click the delete icon next to any variable to remove it. As with updates, changes apply on the next deployment.
Best practices
- Never commit secrets to your source code — use env vars instead
- Use descriptive key names like
DATABASE_URLorSTRIPE_SECRET_KEY - Rotate secrets regularly and redeploy to apply changes