Skip to content

Environment variables

All services read the repo root .env. Copy .env.example to start. In the production docker-compose.yml, the internal hostnames (postgres, clickhouse, redis, ingest) are already wired up, and each container gets only the variables it needs.

Use URL-safe random secrets, for example openssl rand -hex 24.

Variable Used by Notes
APP_URL dashboard, worker The public URL of your Beacon instance, used in snippets, emails and links.
POSTGRES_PASSWORD compose Password for the bundled Postgres.
CLICKHOUSE_PASSWORD dashboard, worker, ingest Password for the bundled ClickHouse.
REDIS_PASSWORD compose Password for the bundled Redis.
AUTH_SECRET dashboard, worker At least 16 characters. Encrypts two-factor and SMTP secrets. Both apps need the same value.
INGEST_SECRET ingest At least 16 characters. Root of the rotating visitor salts.

Don’t change AUTH_SECRET or INGEST_SECRET once Beacon is running: a new AUTH_SECRET makes stored two-factor and SMTP secrets unreadable, and a new INGEST_SECRET counts every visitor as new.

Variable Default Notes
HTTP_PORT 80 Where Nginx listens.
HTTPS_PORT 443 Where Nginx listens for HTTPS, once enabled.
INGEST_PREFIX /x The path Nginx sends to ingest. Letters, digits and . _ ~ - only.
Variable Default Notes
COOKIE_SECURE true Set false only for plain HTTP with no TLS in front.
TRUST_PROXY false Trust X-Forwarded-For and X-Real-IP from the proxy.
INGEST_INTERNAL_URL http://ingest:8080 Where the System page reads ingest metrics.
EXPORTS_DIR system temp dir Shared with the worker for CSV/JSON exports.

Cron schedules run in UTC. Changes take effect on the next restart.

Variable Default What it schedules
WORKER_CONCURRENCY 5 Jobs run at once.
SESSION_CLEANUP_CRON 0 */6 * * * Deleting expired sessions and old exports.
RETENTION_CRON 0 3 * * * Deleting events older than the retention setting.
DIGEST_CRON 0 8 * * * Sending the email and webhook digests that are due.
ANOMALY_CRON */15 * * * * Checking spike and downtime alerts.
Variable Default Notes
BATCH_SIZE, FLUSH_INTERVAL_MS 1000, 2000 Events are written to ClickHouse every BATCH_SIZE rows or this often.
QUEUE_CAPACITY 50000 Events held in memory before new ones get 503.
GEOIP_DB_PATH empty A MaxMind GeoLite2 or DB-IP Lite .mmdb file for locations.
TRUSTED_PROXY_HEADER empty Header with the real client IP, such as X-Real-IP.
TRUSTED_PROXY_CIDRS loopback and private networks Peers whose header is believed.
RATE_LIMIT_PER_SECOND, RATE_LIMIT_BURST 20, 60 Per client IP (IPv6 per /64).
RATE_LIMIT_PER_KEY 1000 Per API key for events sent through a first-party proxy.

These are set for you in Docker Compose. Set them only when running services outside it.

Variable Notes
POSTGRES_URL Postgres connection URL.
CLICKHOUSE_URL ClickHouse HTTP URL, for the dashboard and worker.
CLICKHOUSE_NATIVE_ADDR ClickHouse native address, for ingest.
CLICKHOUSE_USER ClickHouse user.
REDIS_URL Redis URL for the job queues.