Skip to main content
This guide covers all the available environment variables to fine-tune OpenLIT according to your needs.

Environment variables

required
Sets the host address of the ClickHouse server for OpenLIT to connectExample:
required
Sets the port on which ClickHouse listensExample:
required
Sets the name of the database in Clickhouse to be used by OpenLITExample:
required
Sets the username for authenticating with ClickHouseExample:
required
Sets the password for authenticating with ClickHouseExample:
required
Sets the location where SQLITE data is stored.Example:

OAuth authentication variables

For detailed OAuth setup instructions, see the OAuth Authentication Setup guide.
Sets the canonical URL of your site for NextAuth.js authenticationExample:
Used to encrypt the NextAuth.js JWT tokens and email verification hashesExample:
Generate with: openssl rand -base64 32
Google OAuth client ID for Google sign-in integrationExample:
Google OAuth client secret for Google sign-in integrationExample:
GitHub OAuth client ID for GitHub sign-in integrationExample:
GitHub OAuth client secret for GitHub sign-in integrationExample:

Server variables

Sets the port the OpenLIT server listens on. For Docker Compose deployments, set this in the .env file next to docker-compose.yml - Compose maps it to both the host port and the container’s internal DOCKER_PORT for you. For Kubernetes or a raw container run, set DOCKER_PORT directly instead (see below); the container’s entrypoint always derives its actual listening port from DOCKER_PORT, defaulting to 3000 if unset.Example (Docker Compose .env):
Sets the port the OpenLIT container listens on internally. Only relevant for Kubernetes or a raw container run where there’s no Docker Compose translating PORT for you.Example:
Sets the base URL OpenLIT uses to call back into its own API - required by the Auto Evaluation, Auto Pricing, Agents materialization, and telemetry-snapshot cron jobs, which run as separate processes and call this URL directly. Defaults to http://localhost:$PORT. Set this if you run behind a reverse proxy, a non-default host, or a different container/pod hostname - otherwise these background jobs will fail silently after every restart.Example:
Sets which OpenLIT build is running. Defaults to oss if unset.Example:

Agents variables

Tune the background job that materializes the Agents page’s call graphs and versions from trace data.
Cron schedule for the Agents materialization job. Defaults to * * * * * (every minute); the job self-throttles when there’s no new trace data to process.Example:
Maximum number of agents materialized per scheduled run. Defaults to 100.Example:
Maximum number of agents materialized concurrently per run. Defaults to 4.Example:
Log level for the Agents materialization job (debug, info, warn, error). Defaults to info.Example:
Set to false to omit stack traces from Agents materialization error logs. Defaults to including them.Example:

Telemetry variables

See Anonymous Telemetry for what OpenLIT’s own usage telemetry collects and why.
Set to false to disable OpenLIT’s anonymous usage telemetry, including the daily instance snapshot.Example:
Cron schedule for the daily anonymous instance telemetry snapshot. Defaults to 17 3 * * *.Example:

Security variables

OpenLIT enables stricter API protections by default, including security response headers, CSRF checks for browser session API requests, vault secret encryption, and restricted CORS for the vault secrets API.
Token required to trigger internal cron-driven endpoints (Auto Evaluation, Auto Pricing, Agents materialization, telemetry snapshot). Optional for typical self-hosted installs - when unset, both the cron scripts and the endpoint check fall back to the same shared default, so scheduled jobs work out of the box with no configuration. Set it only if your instance is exposed such that an untrusted party could otherwise call these endpoints directly.Changing this takes effect on the next restart, since cron entries are re-created from the current environment on every server startup.Example:
Set to true to enforce organisation-scoped isolation on coding-agent telemetry queries in multi-organisation deployments.Example:
Secret used to encrypt Vault values at rest with AES-256-GCM. If this is not set, OpenLIT falls back to NEXTAUTH_SECRET.Use a stable, high-entropy value and keep it unchanged across restarts. Changing this value after secrets are encrypted prevents existing Vault values from being decrypted.Generate with:
Example:
Comma-separated list of browser origins that are allowed to call API-key authenticated Vault secret retrieval from another domain.Configure this when a browser application hosted on a different origin needs to call POST /api/vault/get-secrets. Server-to-server SDK or REST calls usually do not need this because they do not send a browser Origin header.Specify complete origins, including scheme and host. Do not use *.Example:
Backward-compatible alias for OPENLIT_ALLOWED_CORS_ORIGINS.Example:
NEXTAUTH_URL is also treated as an allowed same-site origin for Vault CORS checks. Browser requests from other domains must be listed in OPENLIT_ALLOWED_CORS_ORIGINS or OPENLIT_ALLOWED_ORIGINS.

Environment file placement

Environment variables can be configured in multiple ways depending on your deployment method:

Development setup

1

Client-side .env

Create a .env file in the src/client/ directory for development:
This file is automatically loaded by Next.js during development.
2

Docker Compose .env

Create a .env file in the same directory as your docker-compose.yml file:
This file is automatically loaded by Docker Compose.
3

Development Docker Compose .env

For development Docker setup, create a .env file alongside src/dev-docker-compose.yml:

Production setup

For production deployments, set environment variables directly in your hosting platform or container orchestration system (Kubernetes, Docker Swarm, etc.).

Applying changes at runtime

OpenLIT reads environment variables once when the server process starts - there’s no hot-reload, so a config change (editing a .env file, updating a Kubernetes Secret, etc.) only takes effect after you restart the container or process. A restart is also all you need for the cron-driven features (Auto Evaluation, Auto Pricing, Agents materialization, telemetry snapshot): their scheduled jobs are re-created from the current environment on every startup, so there’s no separate step to “re-save” settings after changing something like API_URL, CRON_JOB_SECRET, or AGENTS_MATERIALIZE_SCHEDULE.

Sample environment file (.env)

.env

Create a dashboard

Create custom visualizations with flexible widgets, queries, and real-time AI monitoring

Manage prompts

Version, deploy, and collaborate on prompts with centralized management and tracking

LLM playground

Compare cost, duration, and response tokens across different LLMs to find the most efficient model