Skip to main content
πŸ›  This page is for engineering teams self-hosting their own Lightdash instance. If you want to connect your data warehouse, go to the Connect a project guide.
Lightdash requires a PostgreSQL database (version 12 or greater).
In production, we recommend using a managed database service (depending on your cloud provider). This ensures that your database is highly available and secure. You can also use a self-hosted database, but you will need to manage the database yourself. The following configuration shows an example of how to configure Lightdash to use an external database. You can use this as a starting point for your own configuration.

Configuration options for external database

Optionally you can pass any of the PostgreSQL Environment Variables to the configMap

Required pg extensions for external database

Lightdash requires the following extensions to be installed on the database:
  • uuid-ossp - used for generating unique IDs
  • pgvector - required if you use an enterprise license key. Lightdash uses pgvector to store embeddings that power enterprise AI features (AI Analyst, AI agents, and related capabilities). Install it on your Postgres database before starting a licensed Lightdash instance β€” on managed services like AWS RDS, Google Cloud SQL, and Azure Database for PostgreSQL, enable the vector extension in your instance’s configuration, then run CREATE EXTENSION IF NOT EXISTS vector; in the Lightdash database.

Migrations

Migrations are ran automatically on starting the Lightdash server or workers. When upgrading Lightdash, migrations will be ran automatically. If a migration gets stuck β€” for example after an interrupted deploy:
  • On Lightdash 1.123.0 and later, an interrupted migration’s lock expires on its own and another process takes over automatically. To inspect migration state, or release a lock that is genuinely stuck, run the built-in migrate command inside a Lightdash container (kubectl exec / docker compose exec):
    Do not edit the knex_migrations_lock table manually on these versions β€” it can release a lock that a live migration legitimately holds. The upgrade runbook covers how to read status, when unlock refuses, and what resumes on its own afterwards.
  • On versions before 1.123.0, if migrations fail due to a pg_lock error, check for a table called knex_migrations_lock to manually release the lock.