Self-hosting
Docker Compose
The straightforward way to run it.
The quickstart has a working compose file. This page covers what to change before other people use it.
Five services
| Does | |
|---|---|
postgres | Stores everything |
api | Serves the API and the agent endpoint |
web | The browser interface |
worker | Syncs connectors and indexes content |
embedding | Turns content into something searchable, locally |
Before anyone else connects
api:
environment:
BASE_URL: https://lenshub.example.com # the address people actually use
CORS_ORIGIN: https://lenshub.example.com
COOKIE_SECURE: "true"
LENSHUB_ENV: productionBASE_URL must be the public address, not the container port. Agent sign-in
depends on it.
Give PostgreSQL more memory
The defaults are tuned for very small machines. On a real server:
postgres:
shm_size: '256m'
command:
- postgres
- -c
- shared_buffers=2GB
- -c
- work_mem=32MB
- -c
- maintenance_work_mem=512MBFaster indexing
More workers means more parallel syncing:
worker:
environment:
WORKER_CONCURRENCY: 8Persistence
Five named volumes hold everything that matters. pgdata is the critical one —
it holds all your content. See Backup.
Updating
docker compose pull
docker compose up -dRead Upgrades first — database migrations have an order that matters.