Skip to Content
Kipivo Docs

Self-Hosting & Deployment

Deploy Kipivo on a single host with Docker Compose and Caddy, or run multi-service production on Railway.

Kipivo ships with production deployment configurations for single-host Docker Compose + Caddy and managed multi-service Railway environments.

Docker Compose + Caddy (Single Host)

1. Prepare DNS & Secrets

Point your domain at your Docker host and allow inbound TCP ports 80 and 443. Copy .env.example to .env and populate the required values:

cp .env.example .env

Generate three independent 32-byte hex secrets (openssl rand -hex 32):

  • POSTGRES_PASSWORD (use hex so no URL escaping is needed)
  • BETTER_AUTH_SECRET
  • KIPIVO_CREDENTIALS_SECRET (retain across redeployments to keep encrypted credentials readable)

Set KIPIVO_DOMAIN to your public DNS name.

2. Configure Registration & Auth

  • KIPIVO_ALLOW_SIGNUP: Defaults to 1. Set to 0 or false to disable new email registrations while keeping existing accounts active.
  • KIPIVO_ALLOWED_EMAILS: Optional comma-separated, case-insensitive allowlist for sign-up.
  • GitHub OAuth (optional): Register an OAuth App with callback https://<domain>/api/auth/callback/github and set GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET.
  • Password Reset (optional): Set both RESEND_API_KEY and KIPIVO_EMAIL_FROM with a verified sender.
  • Docs URL (optional): KIPIVO_DOCS_URL defaults to https://docs.kipivo.com for /docs redirects from the Web app.

3. Launch the Stack

From the repository root:

docker compose -f docker-compose.prod.yml config --quiet
docker compose -f docker-compose.prod.yml up -d --build --wait

Compose runs Drizzle database migrations before starting the API. Caddy provisions HTTPS automatically and proxies /api/*, /rpc/*, /sse, /ws/runner, /webhooks/*, /channels/*, and /mcp to api:3000, while serving Web routes from web:3001.

Health Checks & Observability

  • GET /healthz: Public liveness/dependency check for PostgreSQL and Redis (2s budget, no-store).
  • GET /readyz: Verifies dependencies plus API schema readiness.
  • GET /metrics: Aggregated Prometheus metrics gated by KIPIVO_METRICS_TOKEN (blocked with 404 on public Caddy edges).
  • Security Audit Logs: View structured category=security_audit entries via docker compose -f docker-compose.prod.yml logs api.

Hosting This Docs Site (docs.kipivo.com)

docs builds as a standalone static site (SSG) with zero backend dependencies:

bun --filter @kipivo/docs build

Upload docs/dist/client directly to Cloudflare Pages, Vercel, Netlify, or GitHub Pages and attach your custom domain (docs.kipivo.com).

On this page