---
title: "Managed ClickHouse"
url: "/docs/proxy/lens/deployment/managed-clickhouse"
canonical_url: "https://docs.litellm.ai/docs/proxy/lens/deployment/managed-clickhouse"
type: "docs"
last_updated: "2026-12-01"
summary: "Run Lens on ClickHouse Cloud so you do not operate ClickHouse yourself. Copy the connection details, start Lens with one command, and send a trace."
related:
  - "/docs/proxy/lens/deployment/storage"
  - "/docs/proxy/lens/deployment/configuration"
---
# Managed ClickHouse

> Index of all LiteLLM docs: https://docs.litellm.ai/llms.txt


Lens can store its data in [ClickHouse Cloud](https://clickhouse.com/cloud), so you run only the Lens container and ClickHouse Cloud operates the database, its replicas and its backups. Lens creates its own database, tables and application state on first start. You do not configure Keeper or any server setting

This setup was qualified with Lens 0.8.0 on a ClickHouse Cloud service running ClickHouse 26.6 with three replicas: startup and schema setup, trace ingestion and reads, tracing key changes, and a restart with data intact

## 1. Copy the connection details

In the [ClickHouse Cloud console](https://console.clickhouse.cloud), open your service and click **Connect**. Copy the host, which looks like `abc123.us-east-2.aws.clickhouse.cloud`, and the password of the `default` user. Lens uses the HTTPS port, 8443

## 2. Start Lens

```bash
docker run -d --name lens -p 4318:4318 \
  -e LENS_MODE=standalone \
  -e LENS_ADMIN_TOKEN=<a-long-random-token> \
  -e CLICKHOUSE_URL="https://default:<url-encoded-password>@<host>:8443" \
  -e CLICKHOUSE_DATABASE=lens \
  ghcr.io/berriai/lens:0.8.0
```

URL-encode special characters in the password. Lens is ready when `curl --fail http://localhost:4318/health/ready` succeeds, usually within a few seconds

## 3. Send a trace

Open `http://localhost:4318/ui/`, sign in with the admin token and follow [Send your first trace](../first-trace.md). Your traces are stored in the `lens` database of your ClickHouse Cloud service

## Kubernetes

Store the same URL in a Kubernetes Secret and reference it from the [Lens Helm chart](./kubernetes.md). The reference turns off the bundled ClickHouse

```yaml
clickhouseSecret:
  name: lens-clickhouse
  key: url
clickhouseDatabase: lens
```

## Use a dedicated database user

The `default` user is the fastest start. For production, run this once in the ClickHouse Cloud SQL console and put `lens` and its password in `CLICKHOUSE_URL` instead:

```sql
CREATE DATABASE IF NOT EXISTS lens;
CREATE USER lens IDENTIFIED BY '<password>';
GRANT CURRENT GRANTS ON lens.* TO lens;
```

`GRANT ALL ON lens.*` is rejected on ClickHouse Cloud, so use `GRANT CURRENT GRANTS`

## Troubleshooting

| Lens startup error | What to check |
| --- | --- |
| `Storage(Storage(Transport))` | The host, port 8443 and `https` scheme, and that the service IP access list allows the machine running Lens |
| `Storage(Storage(SchemaFailed(500)))` or `SchemaFailed(403)` | The database user lacks permissions on the Lens database. Apply the grant above |

Other managed ClickHouse providers have not been qualified. They need the KeeperMap table engine and the permissions described in [Storage and secrets](./storage.md#clickhouse-connection)

## Related pages

- [Storage and secrets](https://docs.litellm.ai/docs/proxy/lens/deployment/storage.md)
- [Configuration and troubleshooting](https://docs.litellm.ai/docs/proxy/lens/deployment/configuration.md)
