Architecture
An OpenFlare Docker deployment is one Compose project (openflare-all-in-one) made of two halves:
- the control plane: Postgres, the plane (HTTP API), and the console (web UI);
- one cell: the runtime that serves your workers (
vrt-host,cell-controller,vrt-provider,vrt-sql, plus Redis and an S3-compatible store for binding data).
The control plane is never on the request path for your workers’ traffic. It publishes signed desired state; the cell pulls it, serves traffic from it, and keeps serving the last snapshot it accepted if the control plane goes away (the protocol maximum is 24 hours, after which the cell fails closed and refuses new work).
Overview diagram
Section titled “Overview diagram” public internet (profile "tls" only) | :80 / :443 (VRT_TLS_BIND) v +---------------------------------------------------------------------------+ | traefik (file-provider edge, no Docker socket) | | Host(console.<base>) -> console:8788 | | Host(api.<base>) + /api/internal/* (opt-in) -> plane:8787 | | Host(*.<worker-base>) -> vrt-host:8080 | +---------------------------------------------------------------------------+ | | | v v v +-----------+ Basic auth +---------+ +----------------------------------+ | console |-------------->| plane |<-- pull ---| CELL | | :8788 | /api/v1 | :8787 | (signed | vrt-host :8080 (ingress, one | +-----------+ (same origin)| | desired, | workerd process per tenant) | | | ACK) | cell-controller (pull, verify, | +---------+ | ACK; shares vrt-host netns) | | | vrt-provider (KV/R2/queues/ | v | Hyperdrive proxy) | +---------+ | vrt-sql (D1 + Durable Object | |postgres | | SQL storage) | +---------+ +----------------------------------+ | | redis (KV) silo (R2, S3 API)
Loopback development mode (no profile): console, plane and vrt-host are published on 127.0.0.1:8788, 127.0.0.1:8787 and 127.0.0.1:8080 instead, and there is no Traefik.Components
Section titled “Components”Control plane
Section titled “Control plane”| Component | Image / service | What it does |
|---|---|---|
| Postgres | postgres:16, service postgres |
Stores all control-plane state: cells, teams, workers, versions, publications, vars, encrypted secrets, hostnames. Only reachable on the internal backend network. |
| Plane | openflare-plane, service plane (port 8787) |
The HTTP service. Serves the management API (/api/v1) and the cell channel (/api/internal/...). Builds and signs desired state, stores bundles and static assets, records cell ACKs, and enforces hostname rules. |
| Console | openflare-console, service console (port 8788) |
A single-page web app plus a small Node server on the same origin. It proxies /api/v1/* to the plane and injects the admin token server-side, so the browser never receives it. Every request except /console-healthz requires HTTP Basic auth (admin and CONSOLE_AUTH_PASSWORD). |
cell-init |
the plane image, one-shot | Runs on every compose up. Creates the cell record (VRT_CELL_ID, default local), issues the cell’s pull token, renders the four runtime config files with the derived signing public key, and seeds shared secrets. It never overwrites existing files, so re-running up does not rotate credentials. |
Cell (the runtime)
Section titled “Cell (the runtime)”| Component | Image / service | What it does |
|---|---|---|
vrt-host |
openflare-host (ingress :8080) |
Supervises one workerd process per tenant, routes incoming requests by Host header, wakes frozen tenants on demand, runs cron and queue delivery, and collects logs. |
cell-controller |
openflare-cell-controller |
Pulls the signed desired state from the plane, verifies it, fetches bundles by digest, delivers the envelope to vrt-host, and reports an ACK back. Also orchestrates cron leadership and queue assignment. Shares vrt-host’s network namespace. |
vrt-provider |
openflare-provider |
The binding provider: KV, R2, queues and rate limiting, plus a Postgres proxy used by Hyperdrive. Credentials stay on the provider side and never enter a worker isolate. Shares vrt-host’s network namespace. |
vrt-sql |
openflare-sql |
SQL storage service for D1 and Durable Objects. |
| Redis | redis:7-alpine, service redis |
The KV backend. Password-protected (REDIS_PASSWORD). |
| Silo | pgsty/silo, services silo and silo-init |
A bundled S3-compatible object store (a maintained MinIO fork) used as the R2 backend. silo-init creates the bucket and a scoped binding user so tenants never see the root credentials. You can point VRT_R2_* at a real S3 service instead. |
plane-loopback |
alpine/socat |
A small forwarder inside vrt-host’s namespace so the cell’s control-plane URL can be loopback HTTP, which the cell config requires for non-TLS URLs. |
worker-dns |
coredns/coredns |
Development convenience: answers *.workers.local (or WORKERS_DOMAIN) with 127.0.0.1, on loopback port 15353 only. See Local hostnames. |
Optional services (Compose profiles)
Section titled “Optional services (Compose profiles)”| Profile | Services | Purpose |
|---|---|---|
tls |
traefik (traefik:v3.7.20 by default) |
Public edge on ports 80 and 443. Routes are rendered ahead of time into files and mounted read-only; Traefik has no Docker API access. Certificates are issued by Cloudflare DNS-01 into the traefik-acme volume. See TLS certificates. |
update |
updater |
The in-console upgrade agent. It is the only service that can drive Compose for release rollouts, is never published on a host port, and is reached only by the console over a private network. See Upgrades. |
gitdeploy |
git-runner (plus ephemeral git-builder containers it starts) |
Builds and deploys a worker from a GitHub push. See Git-push deploy. |
git-runner and updater are the only two services that mount the Docker socket. Each is explicitly opt-in, neither implies the other, and neither is internet-facing.
How a deploy flows end to end
Section titled “How a deploy flows end to end” you (console, API, CI token, or git push) | | 1. upload bundle PUT /api/v1/cells/{cell}/bundles/{sha256} | 2. create version POST .../teams/{team}/workers/{worker}/deploy v plane | stores the bundle under its sha256 digest (content-addressed) | creates a version (idempotent per worker + bundle digest + bindings) | activate + publish: allocates the next cell revision, builds the | "compute.desired" document, signs it (Ed25519), stores it as a publication v cell-controller (polls the plane; 10 s interval in the shipped config) | 3. GET /api/internal/clusters/{cell}/vrt/desired (bearer: cell pull token) | 4. verify signature, revision fence and expiry | 5. GET .../bundles/{sha256} and .../render-inputs (vars + secret values) | 6. hand envelope to vrt-host through the shared delivery directory v vrt-host | 7. starts/reloads the tenant's workerd with the new version v cell-controller | 8. POST .../desired/ack status APPLIED (or REJECTED) v plane records the ACK on the publication; the console shows it
request path (control plane not involved): client -> [traefik] -> vrt-host:8080 -> workerd process for that HostKey properties:
- Content-addressed, signed. Bundles are identified by SHA-256 digest. The desired document is signed with an Ed25519 key derived from
PLANE_SIGNING_SECRET; the public key is trusted by each cell component. Cells reject replayed, tampered, mis-scoped or expired envelopes. - Revision-fenced. Every publication gets a unique revision per cell. An ACK with a mismatched digest or revision is rejected with a typed 409 and the cell retries.
- Secrets are never in the signed document. Only references are. Variable and secret values travel through the authenticated
render-inputsendpoint. Secrets are encrypted at rest with AES-256-GCM underPLANE_SECRETS_KEY, which is independent from the signing key. - Failed signing never publishes. If signing fails the transaction rolls back and the previous revision keeps serving.
- Bundle access is scoped. Bundle bytes are served only for digests referenced by a retained publication.
When you push to GitHub with gitdeploy enabled, the flow is the same after the build: the webhook reaches the plane, the plane queues a job, git-runner clones the exact commit and runs the build in an ephemeral container with no credentials and no Docker socket, validates the output artifact, and deploys it through the plane like any other bundle.
Networks and isolation
Section titled “Networks and isolation”The Compose file defines four networks.
| Network | Type | Members | Purpose |
|---|---|---|---|
backend |
internal (no egress) | postgres, plane, console, cell-init |
Protects the control-plane database. The cell’s data-plane network cannot reach it, so a tenant that escapes to the host container cannot touch Postgres. |
default |
bridge, subnet 172.31.42.0/24 (VRT_NET_SUBNET) |
plane, console, the cell services, redis, silo, worker-dns, traefik |
The data-plane network. Traefik gets a fixed address (172.31.42.250, VRT_TRAEFIK_IP) so vrt-host trusts forwarded client IPs only from that one address. |
updatectl |
bridge | console, updater |
Console-to-updater control only. Not internal, because the updater must reach GHCR to look up release tags. Tenant containers do not join it. |
gitdeploy |
bridge | plane, git-runner |
Plane-to-runner control only. No host port is published and tenant containers do not join it. |
Additional isolation measures:
- Master secrets (
PLANE_ADMIN_TOKEN,PLANE_SIGNING_SECRET,PLANE_SECRETS_KEY,CONSOLE_AUTH_PASSWORD) and the database URL are mounted into containers as files via Compose secrets, not as container environment variables. - The management API
/api/v1is never published through the edge. Only an optionalapi.<base-domain>route exposes/api/internal/*for remote cells. - Git build containers run on a per-job network, with no Docker socket, no plane or GitHub credentials, bounded resources, and by default no external egress.
Data stores and volumes
Section titled “Data stores and volumes”| Volume | Used by | Contents |
|---|---|---|
plane-db |
postgres |
Control-plane database. |
plane-bundles |
plane |
Content-addressed worker bundles. |
plane-assets |
plane |
Uploaded static assets. |
cell-run |
cell-init, vrt-host, cell-controller, vrt-provider, vrt-sql |
Runtime scratch shared inside the cell: secrets, the delivery directory and listener sockets (/run/vrt). |
cell-config |
the same | Rendered cell configuration (/etc/vrt). |
cell-data |
vrt-host, vrt-provider (read-only) |
Tenant working data, static asset store, Durable Object storage. |
cell-cc-data |
cell-controller |
The controller’s state (fence file, cron state). |
cell-sql-data |
vrt-sql |
D1 and Durable Object SQL data. |
kv-data |
redis |
KV data. |
r2-data |
silo |
R2 objects. |
traefik-acme |
traefik |
ACME account and certificates (/acme/acme.json). Do not delete it during upgrades. |
updater-state |
updater |
Updater job state and pre-upgrade database dumps. |
Host files outside Docker volumes:
.env: generated secrets and settings. In the loopback development path it sits in the repository checkout and the file-backed secrets live in.aio-config/beside it. In a public install the config root is/var/lib/openflare(OPENFLARE_CONFIG_ROOT) and holds.env, rendered Traefik configuration and the secrets directory.- Back these up together with the Postgres volume; see Backups.
| Port | Service | Default binding |
|---|---|---|
| 8788 | Console | 127.0.0.1 (CONSOLE_BIND) |
| 8787 | Plane API | 127.0.0.1 (PLANE_BIND) |
| 8080 | vrt-host tenant ingress |
127.0.0.1, host port VRT_PORT (VRT_BIND) |
| 80, 443 | Traefik (profile tls) |
0.0.0.0 (VRT_TLS_BIND) |
| 15353 | worker-dns (UDP and TCP) |
127.0.0.1 (WORKERS_DNS_PORT) |
Postgres is not published at all. The full list is in Services and ports.
- Quickstart to run it.
- Configuration for environment variables.
- Security for the full security model.