Skip to main content

Docker Compose

Deploy Z3rno on a single machine using Docker Compose. This is the simplest way to self-host and is suitable for development, testing, and small production workloads.

Prerequisites

  • Docker Engine 24+ with Docker Compose v2
  • 4 GB RAM minimum (8 GB recommended for production)
  • 10 GB disk for PostgreSQL data and embeddings

Quick start

Clone the server repository and start all services:
This starts three containers: Verify the server is healthy:

Environment variables

All configuration is done through environment variables. Copy the example file and edit as needed:
See the Configuration reference for the full list of environment variables.
Sensitive values like DATABASE_URL and OPENAI_API_KEY should be set in .env and never committed to source control.

Production setup

TLS termination

Use a reverse proxy like Caddy, Traefik, or nginx in front of Z3rno for automatic TLS:

Resource limits

Set memory and CPU limits in your Compose file to prevent runaway containers:

External PostgreSQL

For production, use a managed PostgreSQL service (RDS, Cloud SQL, Neon, Supabase) instead of the bundled container. Set the connection string and disable the bundled database:
Your external PostgreSQL instance must have the pgvector and Apache AGE extensions installed. Most managed providers support pgvector; AGE may require a custom image.

Monitoring

Prometheus

Z3rno exposes a Prometheus metrics endpoint at /metrics. Add a Prometheus container to scrape it:

Grafana

Add Grafana for dashboards and alerting:
Connect Grafana to Prometheus at http://prometheus:9090 as a data source.

Backup and restore

Database backup

Back up PostgreSQL using pg_dump:

Automated backups

Schedule daily backups with a cron job:

Volume backup

Back up the entire PostgreSQL data volume:

Next steps

Kubernetes

Deploy Z3rno on Kubernetes with the official Helm chart for high availability and auto-scaling.

Configuration

Full environment variable reference for all Z3rno settings.