Skip to content
Cluster Docs
Menu
On this page
Self-host

Environment variables

Reference of the environment variables in .env.example used to configure a self-hosted Cluster instance.

Cluster reads its runtime and build configuration from .env at the repository root (based on .env.example).

Database and roles

VariablePurpose
POSTGRES_HOST, POSTGRES_PORT, POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORDPostgreSQL connection and schema owner credentials.
CLUSTER_APP_PASSWORD, CLUSTER_SYSTEM_PASSWORDPasswords for the application and system database roles created by migrate.
DATABASE_URL, DATABASE_SYSTEM_URL, DATABASE_OWNER_URLConnection strings for the API request client, system client, and migrations.

Secrets and authentication

VariablePurpose
JWT_SECRETSigns access tokens; in production must be random and at least 32 characters (openssl rand -hex 32).
JWT_SECRET_PREVIOUSOptional previous signing secret for zero-downtime key rotation.
AUTH_SECRET_KEYSeals 2FA secrets (must differ from JWT_SECRET).
AUTH_EVENTS_RETENTION_DAYSRetention window for auth_events cleaned by sweep-auth (default 365).
COLLAB_INTERNAL_SECRETShared secret between api and collab (openssl rand -hex 32).

Public URLs and proxy

VariablePurpose
WEB_URLPublic web URL used in email links and Secure cookie flags.
WS_CORS_ORIGINAllowed browser origin for API CORS and WebSockets.
COLLAB_ALLOWED_ORIGINSComma-separated origins allowed to connect to collab.
NEXT_PUBLIC_API_URL, NEXT_PUBLIC_WS_URL, NEXT_PUBLIC_COLLAB_URLPublic URLs baked into the web image at build time (https:// and wss:// in production).
TRUST_PROXYNumber of reverse proxies in front of api (set to 1 behind Caddy or nginx).

Storage, uploads, and Redis

VariablePurpose
REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_URLRedis connection for rate-limit counters.
STORAGE_HOST, STORAGE_PORT, STORAGE_MASTER_PORT, STORAGE_USE_SSLInternal SeaweedFS S3 endpoint used by api.
STORAGE_BUCKET, STORAGE_ACCESS_KEY, STORAGE_SECRET_KEYBucket name and credentials (non-default keys required in production).
UPLOAD_TMP_DIRTemporary directory for in-flight video uploads (up to 3 × 1 GB concurrently).
API_MEMORY_LIMITContainer memory limit for api (default 1g).
COLLAB_URL, COLLAB_API_URL, COLLAB_PORT, COLLAB_MAX_DOC_BYTESInternal URLs, port, and maximum document size for collab.

Mail and initial superadmin

VariablePurpose
SMTP_HOST, SMTP_PORT, SMTP_SECURE, SMTP_USER, SMTP_PASS, MAIL_FROMOutgoing SMTP configuration; leave SMTP_HOST empty to disable email.
MAIL_INVITES_PER_MINUTERate limit for queued area invitations (0 pauses the queue).
SUPERADMIN_EMAIL, SUPERADMIN_PASSWORD, SUPERADMIN_ORG_NAMEInitial superadmin and organization created on first boot if none exist.