Environment Variables
Manage environment variables for your deployed services. Variables are encrypted at rest and sent to your deployment targets when synced.
Prerequisites
- A project with at least one service or managed stack
Managing Variables
Adding a Single Variable
- Navigate to Projects → [Your Project] → Settings → Environment variables
- Enter the key and value in the input row at the bottom
- Select the scope (Build, Runtime, or Both)
- Click Add
Bulk Edit
- Click Bulk Edit to switch to textarea mode
- Enter variables in
KEY=valueformat, one per line:
DATABASE_URL=postgres://user:pass@host:5432/db
VALKEY_URL=redis://:password@localhost:6379
API_KEY=sk-my-secret-key
- Click Save All
Importing from .env File
- Click Import .env
- Paste the contents of your
.envfile - Click Import
Lines starting with # and empty lines are ignored. Existing keys are updated, new keys are added.
Environments
Each variable belongs to an environment:
| Environment | Description |
|---|---|
| production | Live deployment (default) |
| staging | Pre-production testing |
| development | Development/preview deployments |
Use the environment selector dropdown to switch between environments.
Variable Scopes
| Scope | Available During | Use Case |
|---|---|---|
| Build | Docker build only | Build-time secrets, npm tokens |
| Runtime | Running container | Database URLs, API keys |
| Both | Build + Runtime | Shared configuration |
Secret Handling
Variables marked as Secret (default):
- Values are masked in the UI (
••••••••) - Click Show to temporarily reveal
- Encrypted at rest in the database
Syncing Variables
After making changes, click Sync variables to update deployment configuration for the selected environment. This:
- Resolves any Vault references; unresolved references stop the sync
- Formats variables as
KEY=VALUE - Updates services and managed stacks belonging to the selected project environment
- Services may need a redeploy to pick up changes
Troubleshooting
| Issue | Solution |
|---|---|
| Variable not available in container | Click "Sync variables" and redeploy the service |
| Import not working | Check format is KEY=value with no spaces around = |
| Build-only var leaking to runtime | Set scope to "Build" only |
| Value truncated | Avoid newlines in values; use base64 encoding for multiline |