Skip to main content

Docker Compose on a server

Install Docker with Compose v2, then run the v0.1.0 release bundle on your server. It needs no Git, pulls the published image by digest, and can be verified before you run it:

curl -fLO https://github.com/BerriAI/lens/releases/download/v0.1.0/lens-install-0.1.0.tar.gz
tar xzf lens-install-0.1.0.tar.gz
cd lens-0.1.0
./start

The script generates credentials in deploy/lens/.env and starts Lens with ClickHouse. Sign in at /ui/ with LENS_ADMIN_TOKEN from that file. Stop with docker compose -f deploy/lens/compose.yaml down and restart with ./start. Keep the extracted bundle, environment file and persistent volume

For help configuring an existing deployment, use Set it up for me. To connect the Lens service to an existing gateway, use Add Lens to LiteLLM

Configure the public address​

Point a hostname such as lens.example.com at your server and provision its TLS certificate. After the initial setup, set this in deploy/lens/.env:

LENS_PUBLIC_URL=https://lens.example.com

Replace the hostname with yours. This controls the browser origin, generated tracing address and secure session cookies. Keep the generated admin token and ClickHouse password unchanged

Apply the configuration​

From the extracted lens-0.1.0 directory:

docker compose -f deploy/lens/compose.yaml up -d --wait

The starter binds Lens to 127.0.0.1:4318 and keeps ClickHouse on an internal network. When a reverse proxy runs in another container or host, use the deployment network settings to give it a reachable private Lens address

Route HTTPS traffic​

Forward the standalone UI and API paths to Lens. For NGINX running on the same host, save this configuration with your hostname and certificate paths:

/etc/nginx/conf.d/lens.conf
server {
listen 443 ssl;
server_name lens.example.com;
ssl_certificate /etc/letsencrypt/live/lens.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/lens.example.com/privkey.pem;
client_max_body_size 16m;

location / {
proxy_pass http://127.0.0.1:4318;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_read_timeout 300s;
}
}

Check and reload NGINX using your host's service manager. On a systemd host:

sudo nginx -t && sudo systemctl reload nginx

Allow inbound HTTPS on port 443. Keep the database private and preserve the container's shipped filesystem, sandbox and resource settings

Check the installation​

Open https://lens.example.com/ui/ using your hostname and sign in with the generated admin token. Complete the first-trace check from the agent's actual network. If you enabled investigations, verify one bounded investigation as well

Use Back up and restore Lens to retain the data, Keeper state, credentials and exact image together. Store backups outside this server and rehearse a restore. The supported database topology is one ClickHouse server; moving to external storage does not itself provide replication or automatic failover

LiteLLM Enterprise
SSO/SAML, audit logs, spend tracking, multi-team management, and guardrails, built for production.
Learn more →