OBLETHdocs

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

You needOne host with Docker and Compose v2
Filesdeploy/docker/ in the gateway repo
Imagesghcr.io/thediymaker/obleth-gateway/*, tag v2.4.0

The Compose stack always runs the gateway, the dashboard, Postgres, Redis and ClickHouse. Everything else is behind a profile you opt into.

Install

  1. 1

    Get the files

    git clone https://github.com/thediymaker/obleth-gateway.git
    cd obleth-gateway/deploy/docker
    cp .env.example .env
    

    Run every docker compose command from this directory, so Compose reads .env and merges a docker-compose.override.yml if you add one.

  2. 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 profile
    

    The 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 .env does not change the database's password.

  3. 3

    Choose profiles and a backend

    Set COMPOSE_PROFILES in .env (see Profiles). For real models, drop benchmark and set the default upstream; each registered model's own api_base overrides it:

    COMPOSE_PROFILES=edge
    OBLETH_UPSTREAM_BASE_URL=http://my-model-server:8000/v1
    
  4. 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     # ok
    

    Use docker compose up -d --build to build the images from your checkout instead.

  5. 5

    Create a tenant, a key and a model

    Continue with First tenant and key. The dashboard is on port 3002.

Profiles

ProfileStartsUse it for
(none)obleth, control-plane, postgres, redis, clickhouseAlways on
benchmarkbenchmark-backend, a simulated model serverTrying things out and load tests; mock is an older alias
edgehaproxy on port 80A front door when you have no load balancer
observabilityPrometheus, Grafana, Jaeger, Postgres and Redis exportersMetrics and traces on the same host
slurmobleth-provisionerModels launched on Slurm; see Slurm provisioning
compressorThe neural prose compression sidecarThe compression boon's neural scoring
sso-devdex, a local OIDC providerDeveloping 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

SettingWhy
OBLETH_VERSIONPin a release such as v2.4.0. The default latest moves with each release; dev tracks unreleased builds.
OBLETH_ENCRYPTION_KEYEncrypts 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_PEPPERA secret mixed into API-key hashes. Set it before you issue keys: changing it later invalidates every key.
BETTER_AUTH_URL, TRUSTED_ORIGINSThe URL people use to reach the dashboard. Sign-in from any other origin is refused.
OBLETH_OTEL_ENDPOINTOTLP/HTTP collector for traces, for example http://jaeger:4318. Empty turns tracing off.
OBLETH_SLACK_WEBHOOK_URLAlerts to Slack.
OIDC_PROVIDERSDashboard 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

ServiceHost portBound to
Data plane8088All interfaces
HAProxy (edge)80All interfaces
Dashboard3002All interfaces
Grafana (observability)3001All interfaces
Management API9180127.0.0.1
Metrics9091127.0.0.1
Postgres, Redis, ClickHouse5432, 6379, 8123 and 9000127.0.0.1
Prometheus, Jaeger9090, 16686127.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.