Environment Variables

Required

VariableDescription
DATABASE_URLPostgreSQL connection string
BETTER_AUTH_SECRETAuth secret (32 hex chars): openssl rand -hex 32. Must be identical on the app and realtime services
BETTER_AUTH_URLYour app URL — must be the real public origin, not localhost
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
CRON_SECRETBearer token for the background job endpoints (32 hex chars). Required whenever background jobs are enabled — the Helm chart's default, and the chart will not render without it. See Background Jobs
API_ENCRYPTION_KEYEncrypts user-generated API keys at rest (32 hex chars). Required to create API keys

ENCRYPTION_KEY and API_ENCRYPTION_KEY cannot be rotated or recovered. Losing either makes the data it protects permanently unreadable — workspace and personal environment variables, stored provider API keys, MCP OAuth credentials, and deployment/chat secrets in the first case, user-generated Sim API keys in the second. Back them up separately from the database.

VariableDescription
REDIS_URLRedis connection string. Optional on a single replica; required past one app or realtime replica — see Redis
REDIS_TLS_SERVERNAMETLS SNI override. Required when REDIS_URL uses rediss:// with a bare IP, or the app throws at startup
NEXT_PUBLIC_SOCKET_URLWebSocket URL — defaults to the page origin; set only if realtime is on a separate host
TRUSTED_ORIGINSComma-separated additional origins to trust for auth (apex + www, alias domains)
AUTH_TRUSTED_PROXIESComma-separated reverse-proxy IPs/CIDRs so the client IP cannot be forged through X-Forwarded-For
INTERNAL_API_BASE_URLInternal URL for server-side self-calls, e.g. http://sim-app.simstudio.svc.cluster.local:3000. Required for PII log redaction; defaults to NEXT_PUBLIC_APP_URL
DATABASE_REPLICA_URLRead-replica connection string for log listing, audit logs, and dashboard aggregations. Falls back to the primary when unset

AI Providers

VariableProvider
OPENAI_API_KEYOpenAI — also the default knowledge base embedding provider
ANTHROPIC_API_KEY_1Anthropic Claude
GEMINI_API_KEY / GEMINI_API_KEY_1Google Gemini
MISTRAL_API_KEYMistral
XAI_API_KEY_1xAI
KIMI_API_KEY_1Moonshot Kimi
ZAI_API_KEY_1Z.ai
TOGETHER_API_KEYTogether AI
FIREWORKS_API_KEYFireworks AI
BASETEN_API_KEYBaseten
COHERE_API_KEYCohere — required for the Knowledge block reranker
OLLAMA_URLOllama (default: http://localhost:11434)

Knowledge bases require a hosted embedding provider. Three are supported, selected with KB_EMBEDDING_MODEL: text-embedding-3-small (default) and text-embedding-3-large on OpenAI or Azure OpenAI, and gemini-embedding-001 on Gemini. There is no local embedding backend — configuring Ollama or vLLM does not substitute, because embeddings do not route through the configured chat model.

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, Gemini, xAI, Kimi, Z.ai, Cohere, and Fireworks.

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

AWS Bedrock

VariableDescription
NEXT_PUBLIC_BEDROCK_DEFAULT_CREDENTIALSSet true when using the AWS default credential chain (IAM roles, ECS task roles, IRSA). Hides credential fields in the Agent block UI

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)

Self-hosted OpenAI-compatible endpoints

VariableDescription
VLLM_BASE_URLvLLM server URL, without a /v1 suffix (e.g. http://localhost:8000) — Sim appends /v1 itself
VLLM_API_KEYOptional bearer token for vLLM
LITELLM_BASE_URLLiteLLM proxy base URL
LITELLM_API_KEYOptional bearer token for LiteLLM

Login Providers

VariableDescription
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRETGoogle — also powers all Google integrations
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRETGitHub
MICROSOFT_CLIENT_ID / MICROSOFT_CLIENT_SECRETMicrosoft — also powers all Microsoft integrations
DISABLE_GOOGLE_AUTH / DISABLE_GITHUB_AUTH / DISABLE_MICROSOFT_AUTHHide a provider from the login page without removing its credentials

See Authentication.

Integration Credentials

Integrations do not work on a self-hosted deployment until you register your own OAuth app with each service and set its *_CLIENT_ID / *_CLIENT_SECRET. There are around 27 of them covering 50 connectors. The full table, redirect-URI format, and setup steps are in Integrations & OAuth.

Access Control

VariableDescription
DISABLE_REGISTRATIONSet true to block all new accounts, including social sign-in. Invitations still work for people who already have an account. SSO is unaffected
DISABLE_EMAIL_SIGNUPBlock new email/password registrations; existing email login keeps working
ALLOWED_LOGIN_DOMAINSRestrict signups to domains (comma-separated)
ALLOWED_LOGIN_EMAILSRestrict signups to specific emails (comma-separated)
BLOCKED_SIGNUP_DOMAINSBlock specific domains from signing up (comma-separated)
SIGNUP_MX_VALIDATION_ENABLEDReject domains with no MX record or a denylisted mail backend
BLOCKED_EMAIL_MX_HOSTSMX-host substrings to block; used only with the above
DISABLE_INVITATIONS / NEXT_PUBLIC_DISABLE_INVITATIONSDisable workspace invitations globally
DISABLE_PUBLIC_API / NEXT_PUBLIC_DISABLE_PUBLIC_APIDisable the public API globally
DISABLE_AUTHBypass authentication entirely, creating an anonymous session for every request

DISABLE_AUTH=true makes everyone who can reach the instance a fully privileged user. Use it only for a single-user instance on a private network, never behind an internet-facing ingress.

Code Execution

VariableDescription
SANDBOX_PROVIDERRemote sandbox provider: e2b (default) or daytona
E2B_ENABLED / E2B_API_KEYEnable E2B remote execution
DAYTONA_API_KEYDaytona API key (used when SANDBOX_PROVIDER=daytona)
IVM_MAX_EXECUTIONS_PER_WORKERExecutions before an isolated-vm worker is recycled
IVM_MAX_BROKERS_PER_EXECUTIONHost-call brokers per execution
IVM_MAX_BROKER_ARGS_JSON_CHARSMax argument payload size
IVM_MAX_BROKER_RESULT_JSON_CHARSMax result payload size

Without a remote provider, user code runs in an in-process V8 isolate inside the app container. See Security.

Networking & Limits

VariableDefaultDescription
API_MAX_JSON_BODY_BYTES50 MBMax JSON body on contract-validated API routes
CHAT_MAX_REQUEST_BYTES220 MBMax body on the public deployed-chat endpoint
WEBHOOK_MAX_REQUEST_BYTES10 MBMax body on public webhook receiver endpoints
WORKFLOW_EXECUTION_CONCURRENCY_LIMIT75Workflow executions in parallel
WEBHOOK_EXECUTION_CONCURRENCY_LIMIT75Webhook-triggered executions in parallel
SCHEDULE_EXECUTION_CONCURRENCY_LIMIT30Scheduled executions in parallel
RESUME_EXECUTION_CONCURRENCY_LIMIT50Resumed executions in parallel
ALLOW_PRIVATE_DATABASE_HOSTSunsetLet database/connector tools reach private, reserved, and loopback hosts. Loosens the SSRF boundary

Your reverse proxy's body-size limit must be at least as large as the app limits above. See Networking.

Observability

VariableDescription
OTEL_EXPORTER_OTLP_ENDPOINTOTLP collector endpoint
OTEL_EXPORTER_OTLP_HEADERSAuth headers, key=value comma-separated
OTEL_TRACES_SAMPLER_ARGTrace sampling ratio
OTEL_DEPLOYMENT_ENVIRONMENTEnvironment label on emitted spans
TELEMETRY_SAMPLING_RATIOApplication-level sampling ratio
TELEMETRY_ENDPOINTWhere anonymous telemetry is sent. Defaults to https://telemetry.simstudio.ai/v1/traces — point it at your own collector to keep traces internal
NEXT_TELEMETRY_DISABLEDSet to 1 to disable anonymous telemetry entirely
GRAFANA_OTLP_ENDPOINT / GRAFANA_OTLP_HEADERS / GRAFANA_DEPLOYMENT_ENVIRONMENTGrafana Cloud OTLP export

See Observability.

Knowledge Bases

VariableDescription
KB_EMBEDDING_MODELEmbedding model for new knowledge bases. Defaults to text-embedding-3-small; an unsupported value falls back to the default
COHERE_API_KEYEnables the Knowledge block reranker

Chat & PII

VariableDescription
COPILOT_API_KEYAPI key for Chat. Without it the Sim Chat block, scheduled prompt jobs, and Inbox cannot run
NEXT_PUBLIC_CHAT_DISABLEDSet to true to hide the Chat module: the workspace lands on your first workflow, with no chats list, scheduled tasks, or editor Chat panel. Chat is shown when unset; bun run setup sets it for you if you skip the chat key
PII_REDACTIONRedact PII from workflow logs via Data Retention rules; requires the PII service and a cluster-reachable INTERNAL_API_BASE_URL
PII_GRANULAR_REDACTIONAdditionally expose the execution-altering redaction stages
DURABLE_SECRET_PROVENANCE_ENFORCED_SURFACESDurable stores where a value whose secret provenance was never recorded fails the run instead of logging a warning. all, or a comma-separated subset of memory, table-row, knowledge. Unset (nothing enforced) by default
ADMIN_API_KEYAdmin API key for GitOps operations and organization provisioning

Enterprise Features

Enterprise features are unlocked by configuration rather than billing on self-hosted deployments. One switch turns on the full set; per-feature flags below it override the switch either way.

VariableDescription
ENTERPRISE_ENABLED, NEXT_PUBLIC_ENTERPRISE_ENABLEDEnable the whole enterprise feature set
INSTANCE_ORG_NAMEName of the organization every user joins automatically at signup
INSTANCE_ORG_SLUGSlug for that organization (derived from the name when omitted)
INSTANCE_ORG_OWNER_EMAILOwner of that organization (defaults to the first user to sign up)

Most enterprise features read their settings from the organization that owns a workspace, so enabling the flags alone is not enough — the deployment also needs an organization model. See the self-hosted enterprise guide for the per-feature flags, both organization patterns, and the Admin API.

File Storage

By default Sim 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 at least one. Every configured provider stays active and is tried in order — Resend → AWS SES → SMTP → Azure Communication Services → Gmail — falling through only on failure. With none configured, mail is silently not sent. Setup, verification, and troubleshooting are in Email.

ProviderVariables
SharedFROM_EMAIL_ADDRESS, EMAIL_DOMAIN, EMAIL_VERIFICATION_ENABLED
ResendRESEND_API_KEY
AWS SESAWS_SES_REGION (credentials via the AWS provider chain)
SMTPSMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, SMTP_SECURE
Azure ACSAZURE_ACS_CONNECTION_STRING
GmailGMAIL_CREDENTIALS_JSON, GMAIL_SENDER

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.

Neither deployment presets these. The Helm chart previously did, which enforced hosted-plan caps on self-hosted installs; chart 1.5.0 removed the presets so Compose and Kubernetes behave identically.

Example .env

# Core
DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
NEXT_PUBLIC_APP_URL=https://sim.yourdomain.com
BETTER_AUTH_URL=https://sim.yourdomain.com

# Secrets — generate each with `openssl rand -hex 32`
BETTER_AUTH_SECRET=<openssl rand -hex 32>
ENCRYPTION_KEY=<openssl rand -hex 32>
INTERNAL_API_SECRET=<openssl rand -hex 32>
API_ENCRYPTION_KEY=<openssl rand -hex 32>
CRON_SECRET=<openssl rand -hex 32>

# Coordination (required past one replica)
REDIS_URL=redis://redis:6379

# Models — OPENAI_API_KEY also powers knowledge base embeddings
OPENAI_API_KEY=sk-...

# Email
RESEND_API_KEY=re_...
FROM_EMAIL_ADDRESS="Sim <noreply@yourdomain.com>"

# Access control
ALLOWED_LOGIN_DOMAINS=yourdomain.com

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

On this page