Skip to content

Configuration

This page highlights the key environment variables and deployment-mode differences for self-hosting.

FeatureSaaSEnterprise
Org modelPersonal org per userShared org for all users
Credits/BillingEnabled (Stripe)Disabled
URL pattern/{username}/main/{org_key}/{username}
Terminal window
# SaaS mode (default)
DEPLOYMENT_MODE=saas
# Enterprise mode
DEPLOYMENT_MODE=enterprise
ENTERPRISE_ORG_NAME="Acme Corp"
ENTERPRISE_ORG_KEY="acme"

Use platform/envs/local.example.env as the reference for the full list. The table below highlights the most important values for self-hosting.

VariableDescriptionExample
ENVIRONMENTRuntime environment namelocal
DEPLOYMENT_MODESaaS or enterprise modesaas
DATABASE_HOSTPostgres hostlocalhost
DATABASE_PORTPostgres port5432
DATABASE_NAMEPostgres database namedreadnode
DATABASE_USERPostgres userpostgres
DATABASE_PASSWORDPostgres passwordpostgres
CLICKHOUSE_USERClickHouse userdefault
CLICKHOUSE_DATABASEClickHouse databaseapp
S3_AWS_ENDPOINT_URLS3/MinIO endpointhttp://localhost:9000
S3_AWS_EXTERNAL_ENDPOINT_URLPublic S3/MinIO endpointhttp://localhost:9000
S3_AWS_ACCESS_KEY_IDS3 access keyminioadmin
S3_AWS_SECRET_ACCESS_KEYS3 secret keyminioadmin
PYTHON_PACKAGE_BUCKET_NAMEBucket for packagespython-packages
ORG_DATA_BUCKET_NAMEBucket for org dataorg-data
USER_DATA_LOGS_BUCKET_NAMEBucket for user logsuser-data-logs
SECRET_KEYApp secret keyhex-32-bytes
JWT_SECRET_KEYJWT signing keyhex-32-bytes
REFRESH_SECRET_KEYRefresh token keyhex-32-bytes
SECRETS_ENCRYPTION_KEYFernet key for secretsbase64-key
SANDBOX_PROVIDERSandbox provider (docker or e2b)docker
LITELLM_ENABLEDEnable LiteLLM proxytrue
LITELLM_INTERNAL_URLInternal LiteLLM URLhttp://localhost:4000
LITELLM_PUBLIC_URLPublic LiteLLM URLhttp://host.docker.internal:4000/v1
STRIPE_PRICE_IDStripe price IDprice_...
STRIPE_SECRET_KEYStripe API secretsk_...
STRIPE_WEBHOOK_SECRETStripe webhook secretwhsec_...

Environment files live under platform/envs/. For local development, copy platform/envs/local.example.env to platform/envs/local.env, or run just setup to generate secrets automatically. Production secrets should be managed with the platform/bin/env tooling rather than editing encrypted files directly.

Terminal window
# Run pending migrations
just migrate
# Create a new migration (always autogenerate)
just migrate-new "add-field"

Never hand-write migration files — always use --autogenerate to keep the revision chain consistent.