Environment Variables

Manage environment variables for your deployed services. Variables are encrypted at rest and sent to your deployment targets when synced.

Prerequisites

Managing Variables

Adding a Single Variable

  1. Navigate to Projects → [Your Project] → Settings → Environment variables
  2. Enter the key and value in the input row at the bottom
  3. Select the scope (Build, Runtime, or Both)
  4. Click Add

Bulk Edit

  1. Click Bulk Edit to switch to textarea mode
  2. Enter variables in KEY=value format, one per line:
DATABASE_URL=postgres://user:pass@host:5432/db
VALKEY_URL=redis://:password@localhost:6379
API_KEY=sk-my-secret-key
  1. Click Save All

Importing from .env File

  1. Click Import .env
  2. Paste the contents of your .env file
  3. 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:

EnvironmentDescription
productionLive deployment (default)
stagingPre-production testing
developmentDevelopment/preview deployments

Use the environment selector dropdown to switch between environments.

Variable Scopes

ScopeAvailable DuringUse Case
BuildDocker build onlyBuild-time secrets, npm tokens
RuntimeRunning containerDatabase URLs, API keys
BothBuild + RuntimeShared configuration

Secret Handling

Variables marked as Secret (default):

Syncing Variables

After making changes, click Sync variables to update deployment configuration for the selected environment. This:

  1. Resolves any Vault references; unresolved references stop the sync
  2. Formats variables as KEY=VALUE
  3. Updates services and managed stacks belonging to the selected project environment
  4. Services may need a redeploy to pick up changes

Troubleshooting

IssueSolution
Variable not available in containerClick "Sync variables" and redeploy the service
Import not workingCheck format is KEY=value with no spaces around =
Build-only var leaking to runtimeSet scope to "Build" only
Value truncatedAvoid newlines in values; use base64 encoding for multiline