Prerequisites
- Docker Engine 24 or later with Compose v2
- Node.js 22 or later, to generate secrets
- at least 2 vCPU, 4 GB of RAM, and durable disk storage
- a public DNS name for the dashboard
- Twilio and OpenAI accounts for live calls, and a Twilio Elastic SIP trunk for phone calls
Configure the environment
.env.example to .env and fills every PostgreSQL role password and internal secret with a random 64-character value. It won’t overwrite an existing .env unless you pass --force, which also replaces every secret in it.
Then open .env and set APP_BASE_URL, OPENAI_API_KEY, and your Twilio credentials. Services build their database connection strings from the role passwords, so you don’t need to write any database URLs.
Compose sets STORAGE_PROVIDER=local by default. The admin and worker mount the same persistent storage_data volume at /var/lib/lobbystack/storage.
Start LobbyStack
docker compose logs, and the health endpoints continue to work.
Serve HTTPS from Caddy
Compose’s Caddy serves plain HTTP forAPP_HOSTNAME by default and publishes no port 443, for local use or behind your own HTTPS proxy. On a public server, Caddy can serve HTTPS itself: docker-compose.tls.yml switches it to docker/caddy/Caddyfile.tls and publishes port 443. Set these values in .env:
COMPOSE_FILE makes every docker compose command use both files. Point the dashboard’s DNS name at the server, open ports 80 and 443, and restart the stack. Caddy gets a certificate for a hostname the first time someone visits it. Before it does, it asks the admin at /api/tls/ask, which approves these hostnames only:
- the hostname in
APP_BASE_URL, the origins inAUTH_TRUSTED_ORIGINS, and the hosts inMARKETING_HOSTS - your partners’ subdomains of
PARTNER_BASE_DOMAIN - the domains your partners connected, once the worker found their DNS pointing at your server and their TXT record in place
CADDY_ON_DEMAND_TLS=true, partners connect a subdomain of their own website on the console’s Branding & domain page. While you sell partner tiers through the POLAR_PARTNER_* products, a partner needs a paid tier for it; otherwise any partner can. The page shows two records to add: a CNAME pointing at PARTNER_DOMAIN_CNAME_TARGET, and a TXT record that proves the partner controls the domain. Leave CADDY_ON_DEMAND_TLS at false while your Caddy still serves plain HTTP, because partners’ domains would get no certificate.
Connect partners’ domains through Cloudflare for SaaS
If the DNS ofPARTNER_BASE_DOMAIN is on Cloudflare, your partners’ own domains can go through Cloudflare for SaaS instead of Caddy’s on-demand TLS. Cloudflare then issues each domain’s certificate, and the worker registers and checks each domain through Cloudflare’s API. Set it up once:
- In the Cloudflare zone of
PARTNER_BASE_DOMAIN, open SSL/TLS > Custom Hostnames and enable Cloudflare for SaaS. - Add a proxied DNS record that points at your server, such as
host.partners.example.com, and add it with Add Fallback Origin on the Custom Hostnames page. - Create an API token with the Zone > SSL and Certificates > Edit permission for that zone.
- In
.env, set the token asCLOUDFLARE_SAAS_API_TOKENand the zone’s ID asCLOUDFLARE_SAAS_ZONE_ID, then restart the stack. - Set the zone’s SSL/TLS encryption mode to Full. Cloudflare connects to your server with each partner’s own domain, which your origin certificate doesn’t cover.
Host header. Partners then point a CNAME record at the fallback origin, or at PARTNER_DOMAIN_CNAME_TARGET when you set it, and add the TXT record their console shows. With both Cloudflare for SaaS and CADDY_ON_DEMAND_TLS set, the deployment uses Cloudflare for SaaS.
Choose a storage backend
The default local provider supports a single Docker host. Back up thestorage_data volume with PostgreSQL and restore both from the same recovery point.
Use S3 when the admin and worker run on different hosts. Set these values in .env:
Export OpenTelemetry data
OpenTelemetry export is disabled whenOTEL_EXPORTER_OTLP_ENDPOINT is empty. To send traces, metrics, and OpenTelemetry logs to PostHog, add these values to .env:
/v1/traces, /v1/metrics, and /v1/logs to the base URL. You can use the same variables with another OTLP-compatible backend.
Restart the application containers after changing the values:
Verify the deployment
Production checklist
- replace all development credentials and limit
.envpermissions - use a production HTTPS value for
APP_BASE_URL - set
OPENAI_WEBHOOK_SECRETandTWILIO_SIP_TRUNK_SIDto answer phone calls. The worker won’t provision a phone number withoutTWILIO_SIP_TRUNK_SID. The voice calls variables list what each one does - set
WEB_CALL_ALLOWED_ORIGINSto the exact sites that host your public demo call, if you run one - configure off-host PostgreSQL and file-storage backups
- run a restore drill before accepting production traffic
- restrict PostgreSQL, Redis, and optional MinIO ports to private networks
- monitor admin, worker, queue, database, and object-storage health
- pin image versions before planned upgrades