Skip to Content
Self-HostingConfiguration

Configuration

Environment variables for core and ui. Copy .env.example as a starting point.

Database

VariableUsed byPurpose
DATABASE_URLcore, uiPostgreSQL connection string

Webhooks

VariableUsed byPurpose
PUBLIC_WEBHOOK_URLcore, uiPublic HTTPS base (no trailing slash). Platforms use {PUBLIC_WEBHOOK_URL}/webhooks/{organization_id}/{platform}/{channel_id}
WEBHOOK_SECRETcorePlatform webhook verification secret
DEFAULT_PROMPT_CHANNEL_IDcoreOptional default when prompts omit channel_id

Security and API key

VariableUsed byDefault / notes
CALLBACK_SIGNING_SECRETcoreHMAC secret for prompt answer callbacks
USE_AUTHcoreSet true to require X-API-Key
GREENLIGHT_API_KEYcore, uiSeeds first admin key when api_keys is empty; UI sends it as X-API-Key

Admin UI

VariablePurpose
GREENLIGHT_API_URLCore base URL (default http://localhost:8100)
AUTH_SECRETNextAuth session secret
DATABASE_URLSame Postgres as core (admin users table)
PUBLIC_WEBHOOK_URLShown on channel detail pages

Hybrid npm run dev: set GREENLIGHT_API_KEY in the root .env (see .env.example). After creating a new key in Settings, update GREENLIGHT_API_KEY and restart the UI.

Docker / self-host Compose: pass the same GREENLIGHT_API_KEY to core and ui services.

Media

VariableUsed byPurpose
MEDIA_ALLOWED_DIRcoreAllowed directory for media_path local files
MAX_MEDIA_SIZE_MBcoreMax upload / local media size (default 2)

Channel callbacks

VariableUsed byDefault
CHANNEL_CALLBACK_MAX_RETRIEScore3
CHANNEL_CALLBACK_RETRY_DELAYcore5 (seconds)
CHANNEL_OFFLINE_NOTIFICATIONcoreMessage posted when channel callbacks fail

Server / boot

VariableUsed byPurpose
PORTcoreHTTP port (default 8100)
HOSTcoreBind address (default 0.0.0.0)
HOSTNAMEuiBind address for Next standalone (use 0.0.0.0 in Docker)
CLEAN_ON_BOOTcoreClean stale prompt state on startup
ENABLE_DOCScoreServe GET /openapi.json when true

Compose Postgres

VariablePurpose
POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DBBundled Postgres credentials (Compose)

Replace all default secrets before production. Prefer a secrets manager or Dokploy / Coolify environment UI over committing .env.