Self-hosting Lucida: Docker Compose, Helm and air-gapped

Run Lucida on one machine with Docker Compose, on Kubernetes with the Helm chart, or on a network with no internet access.

Embed
Preview of the card
<a href="https://lucidace.com/help/self-hosting"><img src="https://lucidace.com/help/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/2f4b888b-c4e6-488b-81bd-6e838fb12d2e/pages/0da4cf9b-8af2-4ce7-8ee4-44b315acd905/social-card.svg?v=3e7ae33eec8b" alt="Self-hosting Lucida: Docker Compose, Helm and air-gapped" width="600" height="315"></a>

You can run all of Lucida yourself. There are two supported shapes: one machine with Docker Compose, and Kubernetes with the Helm chart. Both ship in the Lucida source tree under infra/. The guides below follow docs/guides/self-host.md, docs/guides/air-gapped.md and infra/helm/lucida/README.md in that tree.

Docker Compose (one machine)

infra/compose/compose.yml runs Postgres, ClickHouse, Redpanda (Kafka API), MinIO (replay blobs and exports), Redis, a migrate job and the Lucida services (gateway, worker, api, jobs, connectors, workflows, ai, mcp, web). From the source tree:

scripts/install.sh                                   # asks for the domain, capture domain and release tag
scripts/install.sh --ci --domain lucida.example.com --capture-domain t.example.com --version v1.4.0 --email ops@example.com

The installer checks for docker, docker compose v2 and openssl, writes infra/compose/.env (mode 0600; on first run it generates LC_MASTER_KEY and the database and object-store passwords), pulls the images, starts the stack and waits until every service is healthy (--timeout, default 600 seconds). --dry-run writes .env and prints the commands only. It never prints secrets.

Back up infra/compose/.env. LC_MASTER_KEY decrypts stored connector credentials and is in no database backup. Losing it makes those credentials unrecoverable.

Without --domain the app is on http://localhost:3000 and capture on http://localhost:8080, with no TLS. Sign up in the web app to create the first organization and project. AI is bring-your-own-key: an organization admin connects a provider in Settings, AI.

TLS

With a domain, the installer starts Caddy (compose profile tls) and gets Let's Encrypt certificates for the app host and the capture host. Both DNS names must resolve to the machine, and ports 80 and 443 must be reachable. Behind your own load balancer pass --no-tls and terminate TLS there. Either way set LC_CSRF_ORIGINS=https://<app host> (the installer does when you pass --domain) and set LC_TRUSTED_PROXIES on the gateway to your proxy's network so client IPs come from X-Forwarded-For.

Trusted proxies

The gateway ignores X-Forwarded-For unless the immediate peer is a trusted proxy, so a client cannot spoof its address. On a self-hosted gateway set LC_TRUSTED_PROXIES (comma-separated CIDRs) to the proxy's egress network, for example LC_TRUSTED_PROXIES=10.0.0.0/8. These settings are self-host only; hosted Lucida does not use them.

Sizing (starting points, not measured guarantees)

Events per day

vCPU

RAM

Disk (SSD)

Under 100k

4

8 GB

50 GB

Under 1M

4

16 GB

200 GB

Under 10M

8

32 GB

1 TB

Over 10M

16+

64 GB+

2 TB+ (use Helm with managed Postgres and separate ClickHouse nodes)

Replay blobs go to MinIO or S3, not ClickHouse (roughly 50 to 200 KB per recorded minute). Keep at least 20 percent of the disk free: a full disk stops ingestion.

Helm (Kubernetes)

The chart is infra/helm/lucida. It deploys the gateway, api, worker, jobs, connectors, workflows, ai, mcp and the web build. It bundles nothing stateful: you point it at your own Postgres, ClickHouse, Kafka and S3 in values.yaml (endpoints).

kubectl create secret generic lucida-secrets \
  --from-literal=LC_MASTER_KEY="$(openssl rand -base64 32)" --from-literal=LC_PG_URL=... \
  --from-literal=LC_S3_ACCESS_KEY=... --from-literal=LC_S3_SECRET_KEY=... \
  --from-literal=LC_AI_SERVICE_TOKEN="$(openssl rand -hex 32)"
helm install lucida infra/helm/lucida -f my-values.yaml
  • Secrets are existingSecret references under secrets.*; the chart never renders a Secret.

  • lucida migrate --pg --ch runs as a pre-install and pre-upgrade hook Job.

  • publicUrl is the web origin; OAuth redirect URIs derive from it.

  • image.registry and image.tag select images; pin a release or sha-<commit> tag in production. Use imagePullSecrets for a private registry.

  • Overlays: values-dev.yaml (throwaway Postgres, ClickHouse, Redpanda and MinIO for a dev cluster), values-cert-manager.yaml (annotate the ingress with your ClusterIssuer and set ingress.tls), values-multiregion.yaml, ci/values-eu.yaml (EU endpoints and region label; one release per region).

  • The worker's autoscaler maximum must not exceed the topic's partition count.

  • AI features stay off until secrets.LC_AI_SERVICE_TOKEN.existingSecret is set.

Air-gapped

On a network with no route to the internet you move images and source across on removable media (or an internal registry) and turn off everything that calls out.

  1. On a connected machine pin one release, docker compose -f infra/compose/compose.yml config --images, pull, docker save them all into one archive, and record a SHA-256 checksum. Copy the archive and a source tarball of the same tag to the target.

  2. On the isolated host verify the checksum, docker load, extract the source and run scripts/install.sh --ci --domain lucida.internal --version <tag> --no-tls. Terminate TLS with your own certificate (put it in infra/compose/certs/ and point Caddy at it, or use an internal proxy). With an internal registry set LC_REGISTRY (Compose) or image.registry (Helm). Migrations are applied from the source tree; nothing is downloaded.

  3. Turn off the outbound features:

Area

What to do

Email

Point LC_SMTP_ADDR at an internal relay. Without it Lucida logs mail instead of sending, and a production start refuses (LC_REQUIRE_MAILER=1)

Social login, captcha, Stripe

Leave LC_STRIPE_KEY and OAuth client ids unset; use SAML or OIDC against your IdP, password plus MFA, or SCIM

Connectors, Slack, webhooks

Do not enable connectors that call SaaS APIs. Webhooks and warehouse exports work against internal hosts. The Slack app cannot reach an air-gapped host

AI

Serve a model inside the network and set its OpenAI-compatible base URL in the project's AI settings. Without a model, AI routes answer 503

Geo-IP and SDK release data

Both are bundled; no feed is fetched

Browser SDK

Serve lucida.js from your own capture host; the snippet never loads third-party scripts

  1. Verify: curl -fsS https://lucida.internal/v1/health, then docker compose -f infra/compose/compose.yml logs --since 5m | grep -i "dial tcp\|no such host" should print nothing. A match names a feature that still tries to call out.

Back up .env, Postgres, ClickHouse and MinIO, and copy the dumps to media that leaves the host.

Updated