> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openlit.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Multiple Databases

> Add and switch between multiple ClickHouse Database Configs per project and environment in OpenLIT

OpenLIT lets you attach multiple **Database Configs** (ClickHouse connections) inside a project, each tagged with an [environment](https://docs.openlit.io/latest/openlit/organisation/environments.md). Use this to separate staging vs production data, tenants, or retention tiers without redeploying `INIT_DB_*` env vars.

Day-2 connection changes belong in **Organisation → Project → Database configurations / Connectors**, not in live container env vars. See [Database Config](https://docs.openlit.io/latest/openlit/organisation/database-config.md).

## When to use this feature

* **Different environments** — keep `production` and `staging` ClickHouse clusters on separate configs
* **Multi-tenancy** — isolate datasets per customer while sharing one OpenLIT deployment
* **Centralized management** — switch active Database Config from the header **Databases** control

## Get started

![OpenLIT database configuration list on a project](https://mintcdn.com/openlit/7-c_NosPiYex5Szr/images/organisation/database-config-list.png?fit=max\&auto=format\&n=7-c_NosPiYex5Szr\&q=85\&s=95484254e57798821affc19c71763373)

1. **Log in** to OpenLIT (`user@openlit.io` / `openlituser` on local seed installs).
2. Select **organisation**, **project**, and **environment** in the header.
3. Open **Organisation → Project → Database configurations** (or **Connectors → ClickHouse**).
4. Click **Add**, enter host, port, database, credentials, and environment.
5. **Save**, then mark the config **active** for your user.
6. Dashboards, requests, Prompt Hub, and Vault use the active Database Config for that project.

<video controls playsInline preload="metadata" src="https://mintcdn.com/openlit/ARLdG9OdsIzgrIz7/images/organisation/add-database-config.webm?fit=max&auto=format&n=ARLdG9OdsIzgrIz7&q=85&s=8dc08b41fbebb5c9f00a6d5154f1edd7" />

Pair each environment’s Database Config with [signal routing](https://docs.openlit.io/latest/openlit/organisation/signal-routing.md) when traces/logs/metrics live on Tempo, Loki, Prometheus, or Jaeger.

***

> [card] [Database Config](https://docs.openlit.io/latest/openlit/organisation/database-config.md)
>
> Env vars → Database Config migration and field reference

> [card] [Environments](https://docs.openlit.io/latest/openlit/organisation/environments.md)
>
> How environments partition configs and connectors

> [card] [Connectors](https://docs.openlit.io/latest/openlit/connectors/overview.md)
>
> Data-source and memory connectors for OpenLIT


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.