Skip to content

Environment variable reference

The authoritative, always-current source is the annotated .env.example at the repository root — every key is documented inline next to its default and generation recipe. This page will mirror it; until it is fully expanded, use .env.example and the walkthrough in Self-host with Docker Compose.

Only three values must be set — everything else has a working default:

  • POSTGRES_PASSWORDopenssl rand -hex 24
  • SESSION_SECRETopenssl rand -base64 24 (at least 32 characters)
  • ENCRYPTION_KEYopenssl rand -hex 32 (32-byte hex, AES-256-GCM)

POSTGRES_USER and POSTGRES_DB default to tradr. FEATURE_GATING defaults to false (self-hosters stay unrestricted). Every optional integration — LLM keys, Stripe, PostHog, SMTP — is absent when unset, not broken.

In the compose stack the api’s DATABASE_URL is not read from .env — compose builds it from your POSTGRES_* values in api.environment. Set DATABASE_URL directly only for non-compose runs against an external Postgres.