LensHub
Get startedlenshub.ai
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
postgresStores everything
apiServes the API and the agent endpoint
webThe browser interface
workerSyncs connectors and indexes content
embeddingTurns 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: production

BASE_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=512MB

Faster indexing

More workers means more parallel syncing:

worker:
  environment:
    WORKER_CONCURRENCY: 8

Persistence

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 -d

Read Upgrades first — database migrations have an order that matters.

On this page