Environment Variables
Configure secrets and runtime settings for your deployments.
Auto-injected variables
Hatch automatically injects these environment variables into every deployment:
PORTThe port your application should listen onNODE_ENVSet to production for production deploysHATCH_APP_NAMEThe name of your deployed projectHATCH_DEPLOY_URLThe full URL of the current deploymentHATCH_REGIONThe deployment region (e.g. eu-west)Setting custom variables
Set environment variables using the CLI:
# Set a variable
hatch env set API_KEY=sk-my-secret --project my-app
# Set multiple variables
hatch env set DB_HOST=db.example.com DB_PORT=5432 --project my-app
# List all variables
hatch env list --project my-app
# Remove a variable
hatch env remove API_KEY --project my-appSecrets
Environment variables are encrypted at rest and only decrypted during build and at runtime. They are never exposed in logs or the dashboard UI after being set. Variable values are write-only — you can update or delete them, but not read them back.
