Environment Variables

Required

VariableDescription
DATABASE_URLPostgreSQL connection string
BETTER_AUTH_SECRETAuth secret (32 hex chars): openssl rand -hex 32
BETTER_AUTH_URLYour app URL
ENCRYPTION_KEYEncryption key (32 hex chars): openssl rand -hex 32
INTERNAL_API_SECRETInternal API secret (32 hex chars): openssl rand -hex 32
NEXT_PUBLIC_APP_URLPublic app URL
NEXT_PUBLIC_SOCKET_URLOptional. WebSocket URL — defaults to the page origin; set only if realtime is on a separate host.

AI Providers

VariableProvider
OPENAI_API_KEYOpenAI
ANTHROPIC_API_KEY_1Anthropic Claude
GEMINI_API_KEY_1Google Gemini
MISTRAL_API_KEYMistral
OLLAMA_URLOllama (default: http://localhost:11434)

For load balancing, add multiple keys with _1, _2, _3 suffixes (e.g., OPENAI_API_KEY_1, OPENAI_API_KEY_2). Works with OpenAI, Anthropic, and Gemini.

In Docker, use OLLAMA_URL=http://host.docker.internal:11434 for host-machine Ollama.

Azure OpenAI

VariableDescription
AZURE_OPENAI_API_KEYAzure OpenAI API key
AZURE_OPENAI_ENDPOINTAzure OpenAI endpoint URL
AZURE_OPENAI_API_VERSIONAPI version (e.g., 2024-02-15-preview)

vLLM (Self-Hosted)

VariableDescription
VLLM_BASE_URLvLLM server URL (e.g., http://localhost:8000/v1)
VLLM_API_KEYOptional bearer token for vLLM

OAuth Providers

VariableDescription
GOOGLE_CLIENT_IDGoogle OAuth client ID
GOOGLE_CLIENT_SECRETGoogle OAuth client secret
GITHUB_CLIENT_IDGitHub OAuth client ID
GITHUB_CLIENT_SECRETGitHub OAuth client secret

Optional

VariableDescription
API_ENCRYPTION_KEYEncrypts stored API keys (32 hex chars): openssl rand -hex 32
COPILOT_API_KEYAPI key for copilot features
ADMIN_API_KEYAdmin API key for GitOps operations
ALLOWED_LOGIN_DOMAINSRestrict signups to domains (comma-separated)
ALLOWED_LOGIN_EMAILSRestrict signups to specific emails (comma-separated)
DISABLE_REGISTRATIONSet to true to disable new user signups

File Storage

By default Zoen writes uploads to local disk. For production, point it at AWS S3, Azure Blob, or Google Cloud Storage. See Object Storage for the full setup, bucket layout, and IAM policy.

VariableDescription
AWS_REGIONAWS region — set with S3_BUCKET_NAME to enable S3
AWS_ACCESS_KEY_IDAWS access key. Omit to use the instance/IRSA credential chain
AWS_SECRET_ACCESS_KEYAWS secret key. Omit to use the instance/IRSA credential chain
S3_BUCKET_NAMEGeneral workspace files bucket — set with AWS_REGION to enable S3
AZURE_STORAGE_CONTAINER_NAMEGeneral files container — set with Azure credentials to enable Blob (takes precedence over S3)
AZURE_CONNECTION_STRINGAzure connection string, or use AZURE_ACCOUNT_NAME + AZURE_ACCOUNT_KEY
GCS_BUCKET_NAMEGeneral workspace files bucket — enables GCS when neither Azure Blob nor S3 is configured
GCS_PROJECT_IDGCP project ID. Omit to infer from credentials/ADC
GCS_CREDENTIALS_JSONInline service-account JSON. Omit to use Application Default Credentials (Workload Identity, GOOGLE_APPLICATION_CREDENTIALS)

Email Providers

Configure one provider — the mailer auto-detects in priority order: Resend → AWS SES → SMTP → Azure Communication Services → Gmail. If none are configured, emails are logged to the console instead.

VariableDescription
FROM_EMAIL_ADDRESSSender address (e.g. Zoen <noreply@example.com>). Falls back to noreply@EMAIL_DOMAIN.
EMAIL_DOMAINDefault domain when FROM_EMAIL_ADDRESS is unset
EMAIL_VERIFICATION_ENABLEDSet to true to require email verification on signup

Resend

VariableDescription
RESEND_API_KEYAPI key from resend.com

AWS SES

VariableDescription
AWS_SES_REGIONAWS region for SES (e.g. us-east-1). Credentials are resolved through the standard AWS SDK provider chain (env vars, IRSA, ECS/EC2 instance role, SSO).

SMTP (works with MailHog, Postfix, SendGrid SMTP, etc.)

VariableDescription
SMTP_HOSTSMTP server hostname
SMTP_PORT465 for implicit TLS, 587 for STARTTLS, 25 for plain
SMTP_USEROptional — omit for unauthenticated relays
SMTP_PASSOptional — omit for unauthenticated relays
SMTP_SECURESet to true to force TLS on connect; auto-true on port 465

Azure Communication Services

VariableDescription
AZURE_ACS_CONNECTION_STRINGAzure Communication Services connection string

Gmail (Google-native — GCP has no first-party transactional email service, so the native path is the Gmail API with a Google Workspace sender)

VariableDescription
GMAIL_CREDENTIALS_JSONInline service-account JSON. The service account needs domain-wide delegation granted for the https://www.googleapis.com/auth/gmail.send scope in the Workspace admin console
GMAIL_SENDERThe Workspace user the service account impersonates when sending (e.g. noreply@yourdomain.com). FROM_EMAIL_ADDRESS should match this user or one of its registered aliases — Gmail rewrites unrecognized From addresses

Alternatively, the Google Workspace SMTP relay works through the generic SMTP provider (SMTP_HOST=smtp-relay.gmail.com, port 587) with no service account required.

Limits

Self-hosted deployments (billing disabled) run without plan limits: no rate limits, no execution timeouts, no table or storage caps, and no retention-based data deletion. Each limit can be opted back in individually by explicitly setting its variable.

VariableOpts inSuggested value
RATE_LIMIT_FREE_SYNCSync executions per minute50
RATE_LIMIT_FREE_ASYNCAsync executions per minute200
RATE_LIMIT_FREE_API_ENDPOINTv1 API endpoint requests per minute30
EXECUTION_TIMEOUT_FREESync execution timeout (seconds)300
EXECUTION_TIMEOUT_ASYNC_FREEAsync execution timeout (seconds)5400
FREE_TABLES_LIMITMax user tables per workspace5
FREE_TABLE_ROWS_LIMITMax rows per user table50000
FREE_STORAGE_LIMIT_GBFile storage quota (GB)5

Without billing, every account resolves to the free tier, so only the free-tier variables apply. Setting one variable enforces only that limit — the rest stay unlimited.

Deployments installed with the Helm chart ship these variables preset in app.envDefaults, so chart-based installs keep enforcement unless those keys are removed or overridden.

Example .env

DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
BETTER_AUTH_SECRET=<openssl rand -hex 32>
BETTER_AUTH_URL=https://sim.yourdomain.com
ENCRYPTION_KEY=<openssl rand -hex 32>
INTERNAL_API_SECRET=<openssl rand -hex 32>
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
OPENAI_API_KEY=sk-...

See apps/sim/.env.example for all options.

On this page