Skip to Content
OpenPerf

Self-hosting

Deploy

Deploy OpenPerf with Docker Compose, run migrations and put a TLS reverse proxy in front.

This guide deploys the full stack on one Linux host with Docker Compose v2 and a TLS reverse proxy. Every release publishes the service images to the GitHub Container Registry for linux/amd64 and linux/arm64, so the same images also run in Kubernetes, Nomad or ECS:

ServiceImage
apighcr.io/opeq-dev/openperf-api
api-ingestghcr.io/opeq-dev/openperf-api-ingest
worker-errorsghcr.io/opeq-dev/openperf-worker-errors
worker-jobsghcr.io/opeq-dev/openperf-worker-jobs
webghcr.io/opeq-dev/openperf-web
mcpghcr.io/opeq-dev/openperf-mcp

Each image is tagged with its version (0.1.2), its minor line (0.1) and latest. Pin a version in production.

Prerequisites

  • A host with Docker and Docker Compose v2. ClickHouse 26.10+ requires AVX2 on x86_64 hosts (arm64 is supported).
  • At least 4 GB RAM for the dev preset, 16 GB for prod, or 64 GB / 20 cores for the all-in-one cloud preset. Telemetry waits on the disk of api-ingest while ClickHouse is down — see Sizing the journal.
  • DNS records pointing at your reverse proxy for the public origins:
    • openperf.example.com — dashboard (web, port 3000)
    • api.openperf.example.com — API and auth (api, port 4000)
    • ingest.openperf.example.com — OTLP intake (api-ingest, port 4100)
    • mcp.openperf.example.com — MCP server (mcp, port 4500, optional)
  • At least one sign-in method for production: Resend for email codes, or GitHub / Google OAuth.

Sibling subdomains under the same parent domain (.example.com) let the dashboard and API share session cookies via BETTER_AUTH_COOKIE_DOMAIN.

Presets

config/presets/ and config/clickhouse/ ship four matched presets covering every store and service (connection pools, worker concurrency, caches, rate limits and database memory). Pass the preset file before .env.production so your overrides win.

PresetTarget hostClickHouse (ratio / mark / merges)Ingest (workers / journal)State / Cache ValkeyPostgreSQL (shared_buffers / pool)JOB_CONCURRENCY
localLaptop (docker-compose.yml)5 GiB cap / 512 MiB / 1.5 GiB1 / 8 GiB512 MB / 256 MB128 MB / 104
dev4–8 GB RAM, 2–4 vCPU0.45 / 256 MiB / 1 GiB1 / 4 GiB256 MB / 128 MB128 MB / 82
prod16 GB RAM, 4–8 vCPU0.5 / 1 GiB / 2.5 GiB2 / 32 GiB512 MB / 512 MB512 MB / 155
cloud64 GB ECC, 20 cores, NVMe0.5 / 4 GiB / 8 GiB4 / 256 GiB2 GB / 2 GB2 GB / 2515

On cloud, set vm.overcommit_memory=1 on the host so Valkey's AOF rewrite fork succeeds under load. Don't scale api-ingest with --scale: replicas would share one journal volume. Raise INGEST_WORKERS instead.

Download a release

Download the bundle of the latest release and unpack it, replacing 0.1.2 with its version:

curl -fsSL https://github.com/opeq-dev/openperf/releases/download/v0.1.2/openperf-0.1.2.tar.gz | tar -xz
cd openperf-0.1.2

The bundle holds compose.production.yml with the release's image versions, resource presets (config/presets/) and ClickHouse tuning files (config/clickhouse/).

Create .env.production

Generate the two secrets first:

openssl rand -hex 32     # BETTER_AUTH_SECRET
openssl rand -base64 32  # INTEGRATIONS_ENCRYPTION_KEY

Save the values in .env.production next to compose.production.yml. Compose reads it for ${...} placeholders, and every backend service loads the selected preset followed by .env.production through env_file. Replace every placeholder domain, secret and password:

.env.production
APP_DASHBOARD_ORIGIN=https://openperf.example.com
API_ORIGIN=https://api.openperf.example.com
INGEST_ORIGIN=https://ingest.openperf.example.com
MCP_ORIGIN=https://mcp.openperf.example.com
BETTER_AUTH_COOKIE_DOMAIN=.example.com
TRUSTED_PROXIES=loopback,uniquelocal

BETTER_AUTH_SECRET=replace-with-openssl-rand-hex-32
INTEGRATIONS_ENCRYPTION_KEY=replace-with-openssl-rand-base64-32

POSTGRES_PASSWORD=replace-with-strong-password
CLICKHOUSE_PASSWORD=replace-with-strong-password
STORAGE_S3_ACCESS_KEY_ID=openperf
STORAGE_S3_SECRET_ACCESS_KEY=replace-with-strong-secret

RESEND_API_KEY=re_replace_me
EMAIL_FROM=OpenPerf <alerts@example.com>

Add any other variable from Configuration, Integrations or a service page to this file. Leave optional variables out rather than empty (KEY= fails validation). To use GitHub or Google sign-in instead of email codes, remove RESEND_API_KEY and EMAIL_FROM and add the OAuth variables from api.

Start the stack

compose.production.yml runs the stores, applies PostgreSQL (api migrate) and ClickHouse (api-ingest migrate) migrations on startup, runs the release images and binds public ports to 127.0.0.1 so only your reverse proxy exposes HTTPS. web receives API_ORIGIN=http://api:4000 for server-side rendering and PUBLIC_API_ORIGIN=${API_ORIGIN} for browser requests and CSP headers.

To use external AWS S3, Cloudflare R2 or MinIO instead of the bundled RustFS, remove rustfs and rustfs-bucket from compose.production.yml and point STORAGE_S3_* at your bucket.

Pass the preset file (dev.env, prod.env or cloud.env) before .env.production:

docker compose --env-file config/presets/prod.env --env-file .env.production -f compose.production.yml up -d

Verify every service is healthy:

docker compose -f compose.production.yml ps

Configure a TLS reverse proxy

Put a reverse proxy with HTTPS in front of the bound loopback ports. With Caddy:

Caddyfile
openperf.example.com {
  reverse_proxy 127.0.0.1:3000
}

api.openperf.example.com {
  reverse_proxy 127.0.0.1:4000
}

ingest.openperf.example.com {
  request_body {
    max_size 12MB
  }
  reverse_proxy 127.0.0.1:4100
}

mcp.openperf.example.com {
  reverse_proxy 127.0.0.1:4500
}
  • Keep the security headers web sends (Content-Security-Policy, Strict-Transport-Security, X-Frame-Options).
  • Match the proxy body limit on ingest to at least 10 MB.
  • Set TRUSTED_PROXIES to include every proxy hop in front of api, api-ingest and mcp so client IPs and rate limits work per caller.

Sign in and create your first project

Open https://openperf.example.com, sign in, create an organization and add a project. Copy the project DSN from Settings → Projects → Connection and continue with the Quickstart.

Upgrading

Read the release notes of every version you skip, then download the new bundle next to the old one, move .env.production into it and restart the stack from there:

curl -fsSL https://github.com/opeq-dev/openperf/releases/download/v0.2.0/openperf-0.2.0.tar.gz | tar -xz
mv openperf-0.1.2/.env.production openperf-0.2.0/
cd openperf-0.2.0
docker compose --env-file config/presets/prod.env --env-file .env.production -f compose.production.yml up -d

Both bundles have the Compose project name openperf, so the new stack reuses the old volumes. To change only the images, set OPENPERF_VERSION in .env.production instead.

  • api runs PostgreSQL migrations (api migrate) before starting.
  • api-ingest runs ClickHouse migrations (api-ingest migrate) before starting.
  • In Kubernetes or multi-replica deployments, run both migration commands as one-off pre-upgrade jobs instead of inside every container's entrypoint.

Building from source

To run unreleased code, clone the repository and add compose.build.yml, which builds every service from its Dockerfile:

git clone https://github.com/opeq-dev/openperf.git
cd openperf
docker compose --env-file config/presets/prod.env --env-file .env.production -f compose.production.yml -f compose.build.yml up -d --build

Backups and secrets

  • PostgreSQL holds accounts, projects, alert rules, integrations and error groups. Back it up regularly with pg_dump.
  • ClickHouse holds spans, logs and error events (180-day default TTL). Snapshot clickhouse-data or use ClickHouse backups.
  • The journal (ingest-journal) holds telemetry that has not reached ClickHouse yet. Keep the volume across upgrades; it needs no backup.
  • Object storage holds uploaded source maps, logos and avatars. Enable bucket backups or replication if you need historical symbolication.
  • Never rotate BETTER_AUTH_SECRET (signs every user out) or INTEGRATIONS_ENCRYPTION_KEY (breaks all stored integrations and webhooks).
  • Passkeys are bound to the host of APP_DASHBOARD_ORIGIN — changing that hostname invalidates existing passkeys.

On this page