Skip to content

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.

  • 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.

From the checkout:

Terminal window
node scripts/all-in-one-setup.mjs

This 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_ROOT to .aio-config inside the checkout;
  • writes .aio-config/secrets/database_url (postgresql://vrt:<password>@postgres:5432/vrt_plane, mode 0600, in a 0700 directory; chowned to 1000:1000 when 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_HOST and VRT_TLS_EMAIL.

The generated .env contains every secret in plain text. Do not commit it. See Configuration for every variable.

Terminal window
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.

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:

Terminal window
OPENFLARE_IMAGE_TAG=v0.8.0-rc.3

Third-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.

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.
Terminal window
# in .env
COMPOSE_PROFILES=update
# or per command
docker compose -f docker-compose.all-in-one.yml --profile update up -d

The 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.

Terminal window
docker compose -f docker-compose.all-in-one.yml up -d

Without --env-file, Compose reads .env from the compose file’s directory. Compose resolves dependencies for you, so the order is:

  1. postgres, redis, silo start and become healthy; silo-init creates the bucket and its policy and user, then exits.
  2. plane starts once Postgres is healthy.
  3. console starts once the plane has started.
  4. cell-init runs once the plane is healthy. It creates the cell, issues its pull token, renders the cell configuration and exits.
  5. vrt-sql and vrt-host start after cell-init completes.
  6. cell-controller, plane-loopback and vrt-provider attach to the host’s network namespace and start after vrt-host is healthy.
  7. With profiles: traefik after the console and host have started; updater; git-runner after 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.

Terminal window
docker compose -f docker-compose.all-in-one.yml ps

Services 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:

Terminal window
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.

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-ca must exist (it is mounted read-only).
  • The two Cloudflare token files must exist under ${OPENFLARE_CONFIG_ROOT}/secrets/ as cloudflare_zone_api_token and cloudflare_dns_api_token.
  • .env must 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.

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):

Terminal window
git clone https://github.com/becoolme/openflare.git ../openflare
git -C ../openflare checkout "$(cat OPENFLARE_CONTRACT_REV)"
node scripts/vrt-fetch-workerd.mjs --arch linux-x64 # or linux-arm64
export 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 --build

vrt-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.

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.