🛠 This page is for engineering teams self-hosting their own Lightdash instance. If you want to configure any of these settings, please speak to the Lightdash team or your Lightdash administrators.
Lightdash also accepts all standard postgres environment variables
Feature flags
Use these to force feature flags on or off across your deployment regardless of cloud-side targeting or per-organization overrides. Both variables accept a comma-separated list of feature-flag IDs (kebab-case strings — the flag IDs themselves, not env-var names). Useful for local dev flows where you want to toggle flags without touching targeting rules.Athena
Snowflake
SMTP
This is a reference to all the SMTP environment variables that can be used to configure a Lightdash email client.
[1]
EMAIL_SMTP_PASSWORD or EMAIL_SMTP_ACCESS_TOKEN needs to be provided
SSO
These variables enable you to control Single Sign On (SSO) functionality.S3
These variables allow you to configure S3 Object Storage, which is required to self-host Lightdash.Persistent download URLs
When enabled, CSV and dashboard ZIP exports return a stable Lightdash-hosted URL (e.g.https://lightdash.example.com/api/v1/file/{id}) instead of a direct S3 signed URL. Each time this URL is accessed, Lightdash generates a short-lived S3 signed URL and redirects to it — so the underlying URL never goes stale and download links survive IAM credential rotation.
Cache
Note that you will need an Enterprise License Key for this functionality.
These variables are deprecated; use the
RESULTS_S3_* versions instead.Logging
Prometheus
Security
Analytics & Event Tracking
AI Analyst
These variables enable you to configure the AI Analyst functionality. Note that you will need an Enterprise Licence Key for this functionality.
The AI Analyst supports multiple providers for flexibility. Choose one of the provider configurations below based on your preferred AI service. OpenAI and Anthropic are the recommended providers as they are the most tested and stable.
Minimum Required Setup
To enable AI Analyst, setAI_COPILOT_ENABLED=true and provide an API key for AI_DEFAULT_PROVIDER (e.g., OPENAI_API_KEY for OpenAI, ANTHROPIC_API_KEY for Anthropic).
OpenAI Configuration
Anthropic Configuration
Azure AI Configuration
OpenRouter Configuration
AWS Bedrock Configuration
Supported Models
OpenAI:gpt-5.1, gpt-5.2 (default)
Anthropic: claude-sonnet-4-5, claude-haiku-4-5, claude-sonnet-4
AWS Bedrock: claude-sonnet-4-5, claude-haiku-4-5, claude-sonnet-4
Exact model snapshots are automatically assigned (e.g.,
gpt-5.1 → gpt-5.1-2025-11-13).For Bedrock, the region prefix is also added based on
BEDROCK_REGION (e.g., claude-sonnet-4-5 → us.anthropic.claude-sonnet-4-5-20250929-v1:0).Slack Integration
These variables enable you to configure the Slack integration.GitHub Integration
These variables enable you to configure Github integrationsMicrosoft Teams Integration
These variables enable you to configure Microsoft Teams integration.Google Cloud Platform
These variables enable you to configure Google Cloud Platform integration.Embedding
Note that you will need an Enterprise Licence Key for this functionality.Custom roles
Note that you will need an Enterprise Licence Key for this functionality.Service account
Note that you will need an Enterprise Licence Key for this functionality.SCIM
Note that you will need an Enterprise Licence Key for this functionality.Sentry
These variables enable you to configure Sentry for error tracking.Intercom & Pylon
These variables enable you to configure Intercom and Pylon for customer support and feedback.Kubernetes
These variables enable you to configure Kubernetes integration.Organization appearance
These variables allow you to customize the default appearance settings for your Lightdash instance’s organizations. This color palette will be set for all organizations in your instance. You can’t choose another one while these env vars are set.Initialize instance
When a new Lightdash instance is created, and there are no orgs and projects. You can initialize a new org and project using ENV variables to simplify the deployment process.Initialization is skipped if you already have an organization and project.On subsequent restarts, only the update instance call is made. However, if you have multiple organizations or projects, the update will fail and the instance will not start. To safely restart without issues, remove the variables specified in the Update instance section below.
Initialize instance is only available on Lightdash Enterprise plans.For more information on our plans, visit our pricing page.
Currently we only support Databricks project types and Github dbt configuration.
Update instance
On server start, we will check the following variables, and update some configuration of the organization or project. If multiple organizations or projects exist, you must setLD_SETUP_ORGANIZATION_UUID and/or LD_SETUP_PROJECT_UUID to target a specific one.
Update instance is only available on Lightdash Enterprise plans.For more information on our plans, visit our pricing page.
Initialize multiple projects
SetLD_SETUP_PROJECTS to a JSON array to provision multiple projects at once. This is a drop-in replacement for the single-project LD_SETUP_PROJECT_* variables described in Initialize instance — when LD_SETUP_PROJECTS is set, the legacy LD_SETUP_PROJECT_* and LD_SETUP_GITHUB_* variables are ignored.
On every boot, Lightdash matches each entry to an existing project by name: new names are created, existing names are updated in place.
Currently we only support Databricks project types and GitHub dbt configuration for multi-project setup.
Project names are the primary key. Renaming an entry creates a new project rather than renaming the existing one — charts and dashboards will stay on the old project.
Required companion variables
The admin, organization, and API key variables from Initialize instance still apply.LD_SETUP_ADMIN_EMAIL is required — without it, LD_SETUP_PROJECTS is ignored.
Schema
LD_SETUP_PROJECTS must be a JSON array. Each entry has the following shape:
Databricks warehouse fields
GitHub dbt connection fields
Example
Quote the whole value in single quotes in your shell so that
$, backticks, and double quotes inside the JSON are not re-interpreted. When injecting via a secret manager or Kubernetes Secret, no escaping is needed — just paste the JSON as-is.Databricks M2M OAuth example
Use a Databricks Service Principal when you want non-interactive, machine-to-machine authentication instead of a PAT. Lightdash exchanges theclient_id + client_secret for an access token automatically on the first compile and refreshes it as needed — no user interaction is required.
warehouseConnection like this:
M2M is non-interactive by design — Lightdash uses the OAuth client-credentials grant. No browser popup, no per-user sign-in. The Service Principal needs
CAN USE on the SQL warehouse and the appropriate SELECT/USE CATALOG/USE SCHEMA grants on your data.Validation
LD_SETUP_PROJECTS is parsed and validated at boot. Lightdash will fail to start with a descriptive error if any of the following are true:
Migrating from LD_SETUP_PROJECT_*
LD_SETUP_PROJECTS replaces the single-project LD_SETUP_PROJECT_NAME, LD_SETUP_PROJECT_HOST, LD_SETUP_PROJECT_HTTP_PATH, LD_SETUP_PROJECT_PAT, LD_SETUP_PROJECT_SCHEMA, LD_SETUP_PROJECT_CATALOG, LD_SETUP_PROJECT_COMPUTE, LD_SETUP_GITHUB_*, and LD_SETUP_DBT_VERSION variables. When both are set, LD_SETUP_PROJECTS takes precedence and the legacy variables are ignored.
To migrate:
- Move your existing project config into a JSON object (use the existing project’s exact
nameso it is updated in place rather than recreated). - Set
LD_SETUP_PROJECTSto a single-element array containing that object. - Remove the legacy
LD_SETUP_PROJECT_*andLD_SETUP_GITHUB_*variables from your deployment.