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:
| Service | Image |
|---|---|
api | ghcr.io/opeq-dev/openperf-api |
api-ingest | ghcr.io/opeq-dev/openperf-api-ingest |
worker-errors | ghcr.io/opeq-dev/openperf-worker-errors |
worker-jobs | ghcr.io/opeq-dev/openperf-worker-jobs |
web | ghcr.io/opeq-dev/openperf-web |
mcp | ghcr.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
devpreset, 16 GB forprod, or 64 GB / 20 cores for the all-in-onecloudpreset. Telemetry waits on the disk ofapi-ingestwhile ClickHouse is down — see Sizing the journal. - DNS records pointing at your reverse proxy for the public origins:
openperf.example.com— dashboard (web, port3000)api.openperf.example.com— API and auth (api, port4000)ingest.openperf.example.com— OTLP intake (api-ingest, port4100)mcp.openperf.example.com— MCP server (mcp, port4500, 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.
| Preset | Target host | ClickHouse (ratio / mark / merges) | Ingest (workers / journal) | State / Cache Valkey | PostgreSQL (shared_buffers / pool) | JOB_CONCURRENCY |
|---|---|---|---|---|---|---|
local | Laptop (docker-compose.yml) | 5 GiB cap / 512 MiB / 1.5 GiB | 1 / 8 GiB | 512 MB / 256 MB | 128 MB / 10 | 4 |
dev | 4–8 GB RAM, 2–4 vCPU | 0.45 / 256 MiB / 1 GiB | 1 / 4 GiB | 256 MB / 128 MB | 128 MB / 8 | 2 |
prod | 16 GB RAM, 4–8 vCPU | 0.5 / 1 GiB / 2.5 GiB | 2 / 32 GiB | 512 MB / 512 MB | 512 MB / 15 | 5 |
cloud | 64 GB ECC, 20 cores, NVMe | 0.5 / 4 GiB / 8 GiB | 4 / 256 GiB | 2 GB / 2 GB | 2 GB / 25 | 15 |
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.2The 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_KEYSave 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:
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 -dVerify every service is healthy:
docker compose -f compose.production.yml psConfigure a TLS reverse proxy
Put a reverse proxy with HTTPS in front of the bound loopback ports. With Caddy:
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
websends (Content-Security-Policy,Strict-Transport-Security,X-Frame-Options). - Match the proxy body limit on
ingestto at least 10 MB. - Set
TRUSTED_PROXIESto include every proxy hop in front ofapi,api-ingestandmcpso 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 -dBoth 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.
apiruns PostgreSQL migrations (api migrate) before starting.api-ingestruns 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 --buildBackups 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-dataor 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) orINTEGRATIONS_ENCRYPTION_KEY(breaks all stored integrations and webhooks). - Passkeys are bound to the host of
APP_DASHBOARD_ORIGIN— changing that hostname invalidates existing passkeys.