Install with Docker Compose
Run obleth on one host with Docker Compose, choose which optional services start, and set what a production install needs.
4 min readUpdated for v2.4.0Edit on GitHub
deploy/docker/ in the gateway repoghcr.io/thediymaker/obleth-gateway/*, tag v2.4.0The Compose stack always runs the gateway, the dashboard, Postgres, Redis and ClickHouse. Everything else is behind a profile you opt into.
Install
- 1
Get the files
git clone https://github.com/thediymaker/obleth-gateway.git cd obleth-gateway/deploy/docker cp .env.example .envRun every
docker composecommand from this directory, so Compose reads.envand merges adocker-compose.override.ymlif you add one. - 2
Replace the example secrets
Compose refuses to start while a required value is empty, but the example file fills them with development values. Replace each one:
OBLETH_VERSION=v2.4.0 OBLETH_ADMIN_TOKEN=... # openssl rand -hex 32 POSTGRES_PASSWORD=... REDIS_PASSWORD=... # URL-safe: openssl rand -hex 32 CLICKHOUSE_PASSWORD=... DASHBOARD_ADMIN_EMAIL=you@example.org DASHBOARD_PASSWORD=... # at least 8 characters DASHBOARD_SESSION_SECRET=... # at least 32 characters OBLETH_ENCRYPTION_KEY=... # openssl rand -base64 32 GRAFANA_ADMIN_PASSWORD=... # only with the observability profileThe gateway connects to Redis at
redis://:${REDIS_PASSWORD}@redis:6379, so the password must not contain@ : / ? # %or spaces. Postgres takes its password only when its volume is first created; changing it later in.envdoes not change the database's password. - 3
Choose profiles and a backend
Set
COMPOSE_PROFILESin.env(see Profiles). For real models, dropbenchmarkand set the default upstream; each registered model's ownapi_baseoverrides it:COMPOSE_PROFILES=edge OBLETH_UPSTREAM_BASE_URL=http://my-model-server:8000/v1 - 4
Start and check
docker compose pull docker compose up -d curl -s http://localhost:8088/health # ok curl -s http://localhost:9180/api/v1/health # okUse
docker compose up -d --buildto build the images from your checkout instead. - 5
Create a tenant, a key and a model
Continue with First tenant and key. The dashboard is on port 3002.
Profiles
| Profile | Starts | Use it for |
|---|---|---|
| (none) | obleth, control-plane, postgres, redis, clickhouse | Always on |
benchmark | benchmark-backend, a simulated model server | Trying things out and load tests; mock is an older alias |
edge | haproxy on port 80 | A front door when you have no load balancer |
observability | Prometheus, Grafana, Jaeger, Postgres and Redis exporters | Metrics and traces on the same host |
slurm | obleth-provisioner | Models launched on Slurm; see Slurm provisioning |
compressor | The neural prose compression sidecar | The compression boon's neural scoring |
sso-dev | dex, a local OIDC provider | Developing dashboard SSO |
The example .env sets COMPOSE_PROFILES=benchmark,edge,observability. Leave it empty for the core services only. You can also add a profile for one command: docker compose --profile slurm up -d.
Settings that matter in production
| Setting | Why |
|---|---|
OBLETH_VERSION | Pin a release such as v2.4.0. The default latest moves with each release; dev tracks unreleased builds. |
OBLETH_ENCRYPTION_KEY | Encrypts upstream API keys, MCP credentials and upstream headers in Postgres. Unset, they are stored in plaintext and the gateway logs a warning. |
OBLETH_API_KEY_PEPPER | A secret mixed into API-key hashes. Set it before you issue keys: changing it later invalidates every key. |
BETTER_AUTH_URL, TRUSTED_ORIGINS | The URL people use to reach the dashboard. Sign-in from any other origin is refused. |
OBLETH_OTEL_ENDPOINT | OTLP/HTTP collector for traces, for example http://jaeger:4318. Empty turns tracing off. |
OBLETH_SLACK_WEBHOOK_URL | Alerts to Slack. |
OIDC_PROVIDERS | Dashboard sign-in through your identity provider; see Sign-in and SSO. |
The Compose file fixes some gateway settings rather than reading them from .env: the global in-flight ceiling (4096), the default pool size (32), fairshare history (3600 s), the fairshare algorithm (hierarchical) and fail-open (true). To change one, set it under services.obleth.environment in a docker-compose.override.yml. Docker Compose lists what is fixed and what is forwarded; Environment variables has every setting.
Ports and exposure
| Service | Host port | Bound to |
|---|---|---|
| Data plane | 8088 | All interfaces |
HAProxy (edge) | 80 | All interfaces |
| Dashboard | 3002 | All interfaces |
Grafana (observability) | 3001 | All interfaces |
| Management API | 9180 | 127.0.0.1 |
| Metrics | 9091 | 127.0.0.1 |
| Postgres, Redis, ClickHouse | 5432, 6379, 8123 and 9000 | 127.0.0.1 |
| Prometheus, Jaeger | 9090, 16686 | 127.0.0.1 |
HAProxy in this stack listens on plain HTTP. Put TLS in front of the data plane and the dashboard before anyone else uses them; see HAProxy and Security.
Upgrade
Set the new OBLETH_VERSION, then docker compose pull && docker compose up -d. Compose gives the gateway 345 seconds to drain in-flight requests before it stops. Read Upgrades first: some releases need a step before the new version starts.
Running the compression sidecar
Add compressor to COMPOSE_PROFILES and set OBLETH_COMPRESSOR_URL=http://compressor:8080; without the URL the gateway doesn't call the sidecar even when it runs. Its image bakes an ONNX model of about 600 MB, so the first pull or build is slow. It is tagged by its own OBLETH_COMPRESSOR_VERSION (default latest); set it to the same release as OBLETH_VERSION. If the sidecar is unreachable, compression falls back to its built-in heuristics. See Boons.
Running only the datastores in Docker
deploy/docker/datastores.compose.yml runs Postgres, Redis and ClickHouse alone, with named volumes, health checks and Redis append-only persistence, for a gateway that runs elsewhere (a Helm install with external datastores, or the binary):
cp datastores.env.example datastores.env # set the passwords
docker compose --env-file datastores.env -f datastores.compose.yml up -d
Ports bind to BIND_ADDR, 127.0.0.1 by default. Change it to a private interface only behind a firewall, and never expose these ports to the internet. Connect with the obleth ClickHouse user from datastores.env, not default, which is limited to localhost.
