Manual Compose setup
The one-click installer is the recommended path for a public, TLS-enabled server. If you only want to try OpenFlare on your own machine, or you want full control over every file, you can run the same Compose stack directly.
The stack is defined in docker-compose.all-in-one.yml in the control repository. Its Compose project name is fixed to openflare-all-in-one.
Prerequisites
Section titled “Prerequisites”- Docker Engine with the Compose plugin, and
git. - Node.js, only to run the helper scripts (
all-in-one-setup.mjs,all-in-one-local-dns.mjs,hello-all-in-one.mjs). - A checkout of the control repository at the release you want to run.
- Release images are published for linux/amd64 only. On an arm64 host, either run them under emulation (pull first with
docker pull --platform linux/amd64 <image>) or build from source.
Step 1: generate the .env file
Section titled “Step 1: generate the .env file”From the checkout:
node scripts/all-in-one-setup.mjsThis writes .env next to the compose file with mode 0600. It refuses to overwrite an existing .env (it exits with an error) unless you pass --force.
The script generates random values for the secrets:
| Variable | Random bytes (hex-encoded) |
|---|---|
PLANE_ADMIN_TOKEN |
32 |
PLANE_SIGNING_SECRET |
32 |
PLANE_SECRETS_KEY |
32 |
CONSOLE_AUTH_PASSWORD |
16 |
POSTGRES_PASSWORD |
16 |
REDIS_PASSWORD |
16 |
OPENFLARE_UPDATER_TOKEN |
32 |
VRT_CACHE_PURGE_TOKEN |
32 |
VRT_R2_ACCESS_KEY |
16 |
VRT_R2_SECRET_KEY |
32 |
VRT_R2_BINDING_ACCESS_KEY |
16 |
VRT_R2_BINDING_SECRET_KEY |
32 |
It also:
- sets
OPENFLARE_CONFIG_ROOTto.aio-configinside the checkout; - writes
.aio-config/secrets/database_url(postgresql://vrt:<password>@postgres:5432/vrt_plane, mode0600, in a0700directory; chowned to1000:1000when run as root, because the plane runs as that user); - adds commented hints for optional settings such as
COMPOSE_PROFILES,OPENFLARE_REGISTRY,OPENFLARE_IMAGE_TAG,VRT_BIND,CONSOLE_HOSTandVRT_TLS_EMAIL.
The generated .env contains every secret in plain text. Do not commit it. See Configuration for every variable.
Upgrading an older .env
Section titled “Upgrading an older .env”node scripts/all-in-one-setup.mjs --upgrade-env--upgrade-env adds keys that a newer release needs and your file lacks (OPENFLARE_UPDATER_TOKEN, VRT_CACHE_PURGE_TOKEN, the four VRT_R2_* keys, OPENFLARE_CONFIG_ROOT and a commented COMPOSE_PROFILES). Existing values are never rotated. It regenerates the database_url secret file from your existing POSTGRES_PASSWORD, and fails if that variable is missing.
Step 2: choose the image version
Section titled “Step 2: choose the image version”Images are pulled from ${OPENFLARE_REGISTRY} (default ghcr.io/becoolme) at the tag ${OPENFLARE_IMAGE_TAG}. Pin the tag explicitly in .env so that it matches the checkout you are running:
OPENFLARE_IMAGE_TAG=v0.8.0-rc.3Third-party images (postgres:16, redis:7-alpine, coredns/coredns:1.12.2, alpine/socat:1.8.0.3) are fixed in the compose file. The object-storage image and Traefik can be overridden with S3_IMAGE and TRAEFIK_IMAGE, and the cell controller and provider with OPENFLARE_CELL_CONTROLLER_IMAGE and OPENFLARE_PROVIDER_IMAGE. See Services and ports.
Step 3: choose profiles
Section titled “Step 3: choose profiles”Optional parts of the stack are Compose profiles. Set them in .env or on the command line:
| Profile | Adds | Notes |
|---|---|---|
tls |
traefik |
Public HTTPS on ports 80 and 443. Needs rendered Traefik files and Cloudflare token files, see Public TLS by hand. |
update |
updater |
The in-console upgrader. Mounts the Docker socket. |
gitdeploy |
git-runner |
GitHub push deploy. Mounts the Docker socket and launches build containers. See Git push deploy. |
# in .envCOMPOSE_PROFILES=update# or per commanddocker compose -f docker-compose.all-in-one.yml --profile update up -dThe compose file also defines a failover profile (a second SQL service used by the project’s own CI). It is not intended for self-hosters; leave it off.
Step 4: start the stack
Section titled “Step 4: start the stack”docker compose -f docker-compose.all-in-one.yml up -dWithout --env-file, Compose reads .env from the compose file’s directory. Compose resolves dependencies for you, so the order is:
postgres,redis,silostart and become healthy;silo-initcreates the bucket and its policy and user, then exits.planestarts once Postgres is healthy.consolestarts once the plane has started.cell-initruns once the plane is healthy. It creates the cell, issues its pull token, renders the cell configuration and exits.vrt-sqlandvrt-hoststart aftercell-initcompletes.cell-controller,plane-loopbackandvrt-providerattach to the host’s network namespace and start aftervrt-hostis healthy.- With profiles:
traefikafter the console and host have started;updater;git-runnerafter the plane is healthy.
cell-init runs on every up. It never overwrites existing files, so rerunning is safe, but it also means shared secrets are not rotated by re-running.
Step 5: verify
Section titled “Step 5: verify”docker compose -f docker-compose.all-in-one.yml psServices with health checks should report healthy; cell-init and silo-init exit after finishing (that is normal).
Open the console at http://127.0.0.1:8788. The user name is admin; the password is CONSOLE_AUTH_PASSWORD from .env.
To check the edge end to end, deploy a worker in the console and request it with a Host header:
curl -H "Host: <worker-hostname>" http://127.0.0.1:8080/The repository also includes helper scripts. scripts/all-in-one-local-dns.mjs prepares local name resolution (see Local hostnames) and scripts/hello-all-in-one.mjs deploys a sample worker and checks its response. Chrome and Firefox resolve <name>.localhost natively.
Public TLS by hand
Section titled “Public TLS by hand”Enabling the tls profile starts Traefik, which is deliberately strict: it needs files that the installer normally renders, and fails to start without them.
- The static config (
OPENFLARE_TRAEFIK_STATIC_CONFIG, default/var/lib/openflare/config/traefik.yml) and the dynamic directory (OPENFLARE_TRAEFIK_DYNAMIC_DIR) must already exist on the host. They are mounted read-only and Compose will not create them. ${OPENFLARE_CONFIG_ROOT}/acme-camust exist (it is mounted read-only).- The two Cloudflare token files must exist under
${OPENFLARE_CONFIG_ROOT}/secrets/ascloudflare_zone_api_tokenandcloudflare_dns_api_token. .envmust define the hostnames and ACME settings the rendered files refer to.
Producing all of this by hand means reproducing the installer’s rendering. Unless you have a specific reason, run the installer instead, optionally with --configure-only or --dry-run first. See One-click install, TLS certificates and DNS and Cloudflare.
Building from source
Section titled “Building from source”A second compose file, docker-compose.all-in-one.dev.yml, replaces the published images with locally built ones. All of them are tagged :local and are never pulled.
| Service | Local image | Built from |
|---|---|---|
plane, cell-init |
openflare-plane:local, openflare-cell-init:local |
the control repository |
console |
openflare-console:local |
the control repository |
updater |
openflare-updater:local |
the control repository |
vrt-host |
openflare-cell-host:local |
the runtime repository |
cell-controller |
openflare-cell-controller:local |
the runtime repository |
vrt-provider |
openflare-cell-provider:local |
the runtime repository |
vrt-sql, vrt-sql-follower |
openflare-cell-sql:local |
the runtime repository |
The git runner has no local build; with gitdeploy it still uses the published image.
The runtime (Rust) images build from a second repository checked out next to the control repository (override the location with OPENFLARE_DIR, default ../openflare):
git clone https://github.com/becoolme/openflare.git ../openflaregit -C ../openflare checkout "$(cat OPENFLARE_CONTRACT_REV)"node scripts/vrt-fetch-workerd.mjs --arch linux-x64 # or linux-arm64export WORKERD_SHA256=<value printed by the previous command>docker compose -f docker-compose.all-in-one.yml \ -f docker-compose.all-in-one.dev.yml up -d --buildvrt-fetch-workerd.mjs prints the checksum of the downloaded workerd binary; export it as WORKERD_SHA256 before building. Instead of repeating -f flags, you can set COMPOSE_FILE=docker-compose.all-in-one.yml:docker-compose.all-in-one.dev.yml in your shell.
Stopping and removing
Section titled “Stopping and removing”| Command | Effect |
|---|---|
docker compose -f docker-compose.all-in-one.yml stop |
Stops containers; keeps containers and all data. |
docker compose -f docker-compose.all-in-one.yml down |
Removes containers and networks; keeps the named volumes (database, bundles, assets, cell state, object storage). |
docker compose -f docker-compose.all-in-one.yml down -v |
Also deletes the named volumes. This destroys all data. |
down -v is irreversible. Back up first; see Backups. The volumes and what they hold are listed in Services and ports.
Files outside Docker (.env, the .aio-config directory, and for the installer /var/lib/openflare) are not touched by down -v.