Skip to content

One-click install

The one-click installer is a single bash script, install.sh, published with every stable release. It checks the host, optionally installs Docker, checks out the exact release, generates secrets, renders the Traefik edge configuration, starts the Compose stack and then tests the public edge end to end.

Read Docker deployment overview first if you have not chosen a deployment mode. This page covers the public TLS mode; the loopback mode has no installer and is covered in Manual Compose.

You need:

  • A Linux amd64 host that meets the host requirements, with root access.
  • A domain whose DNS zone is active on Cloudflare (full setup). See DNS and Cloudflare for the records the installer expects and how proxied and DNS-only records behave.
  • The zone’s SSL/TLS encryption mode set to Full (strict) in the Cloudflare dashboard (SSL/TLS → Overview), for every install, DNS-only or proxied. See Set Full (strict) up front.
  • Two Cloudflare API tokens: one with Zone Read and one with DNS Edit. Both are required, in every mode. Token creation is covered in DNS and Cloudflare.
  • An email address for ACME (certificate) registration.
  • The release tag you want to install, for example v1.0.0.

Step 1: download the installer and verify it

Section titled “Step 1: download the installer and verify it”

Each stable release carries three assets: install.sh, install.sh.sha256 and image-digests.txt. The installer is self-contained and built for exactly that release tag. It will only install the release it was built for.

Download install.sh and install.sh.sha256 from the GitHub release page of the tag you chose, then verify:

Terminal window
sha256sum -c install.sh.sha256

Expected output:

install.sh: OK

The installer must run as root. When you use sudo, add -E so that your exported variables (notably the Cloudflare tokens) are passed through.

Terminal window
sudo -E bash install.sh --release-tag vX.Y.Z

The installer needs a terminal (/dev/tty) and asks, in this order, for any value you did not supply:

  1. Release tag
  2. Base domain
  3. Worker base domain (default: the base domain)
  4. Console host (default: console.<base domain>)
  5. ACME email (default: admin@<base domain>)
  6. Cloudflare Zone Read token (input hidden)
  7. Cloudflare DNS Edit token (input hidden)

A prompt is shown only for values that are still unset. Anything you passed as a flag or environment variable is used as is.

The --release-tag value must equal the tag the downloaded install.sh was built for. In the default install stage, a mismatch stops the run before any change to the host is made.

Pass everything up front. The Cloudflare tokens can be given only through environment variables, never as flags, so that they do not appear in process listings or shell history.

Terminal window
export OPENFLARE_CLOUDFLARE_ZONE_API_TOKEN='...'
export OPENFLARE_CLOUDFLARE_DNS_API_TOKEN='...'
sudo -E bash install.sh \
--non-interactive \
--release-tag vX.Y.Z \
--base-domain example.com \
--acme-email admin@example.com

In non-interactive mode these inputs are required, or the installer exits with E_INPUT_REQUIRED (exit status 66):

  • the release tag (--release-tag or OPENFLARE_VERSION)
  • the base domain (--base-domain or OPENFLARE_BASE_DOMAIN)
  • the ACME email (--acme-email or OPENFLARE_ACME_EMAIL)
  • both Cloudflare token variables

Tokens must be 20 to 160 characters from A-Z a-z 0-9 _ -.

Every flag and environment variable, including the optional features --enable-updater and --enable-git-deploy, is listed in Installer options.

You want Add
The installer to install Docker on Debian or Ubuntu --install-docker
The installer to create the wildcard A record in Cloudflare --create-dns (non-interactive runs also need --yes)
In-console upgrades --enable-updater
GitHub push deploy --enable-git-deploy and the GitHub App flags
More log detail --verbose
Terminal window
sudo -E bash install.sh --dry-run --non-interactive --release-tag vX.Y.Z \
--base-domain example.com --acme-email admin@example.com

A dry run goes through the same validation but makes no changes to the host. It does not clone the release, install Docker, write files or secrets, create DNS records, pull images or start containers. Read-only checks such as the host checks and the network checks still run. Each skipped action is logged as dry-run: would .... A successful dry run ends with:

info: dry-run complete: install (no host changes)

If the plan has a problem that a real run would not be able to get past, the dry run reports error[E_INTEGRATION_GAP] listing it, after collecting all of them.

--stage runs the installer up to a named point and then exits successfully.

Stage What runs Shortcut
preflight Input validation, host checks, public IP detection, Cloudflare and DNS validation. Nothing is written, and an absent Docker is reported rather than installed. --preflight-only
checkout Everything above, plus the release checkout and template check. none
configure Everything above, plus the config layout, the .env file and the secret files. --configure-only
install Everything, including rendering the edge configuration, starting the stack and the post-checks. This is the default. none

A completed early stage logs info: stage complete: <stage>. Running --preflight-only before the real install is a good habit: it proves the host, tokens and DNS are right without touching anything.

The installer works through these phases in order. A failure stops it with a message of the form error[E_CODE]: message.

The installer takes a lock so that two runs cannot overlap, loads any existing configuration, and validates your inputs (hostnames, release tag format, paths, booleans). See The install lock.

If an existing .env is present, it must contain only keys the installer knows about. Unknown keys make the installer stop rather than discard them.

The installer checks, and fails with a specific error code when a check fails:

  • Linux, amd64, root.
  • The required commands and a CA bundle.
  • Memory (at least 1 GiB), disk (at least 10 GiB free), and a warning when running virtualized.
  • HTTPS reachability of GitHub, the GitHub container registry, the Cloudflare API and your ACME CA.
  • The clock, within 300 seconds of GitHub’s.
  • The firewall, when ufw or firewalld is active: ports 80 and 443 must be allowed.
  • Docker and Compose v2.20 or newer (see the next phase if Docker is missing).
  • Ports 80 and 443 free, unless a previous OpenFlare stack of this project owns them.

It then determines the host’s public IPv4 address. If you did not pass --public-ipv4, it asks three public what-is-my-IP services and requires at least two to agree. The address must also be assigned to a local network interface, which rules out a host behind NAT. Private, loopback, CGNAT, link-local and documentation ranges are rejected. If detection cannot be trusted, set --public-ipv4 explicitly.

Then it validates Cloudflare: both tokens are active and carry the right permissions, the zone is found and active, and the DNS records (and the zone’s SSL/TLS mode, which must be Full (strict) in every mode) are consistent with what the edge needs. This is the step that fails when a record points at the wrong address or a CAA record forbids your CA. See DNS and Cloudflare for what is checked and how to fix it. --skip-dns-check relaxes the DNS check and marks the final summary with DNS_CHECK_SKIPPED.

3. Docker installation (optional, Debian and Ubuntu only)

Section titled “3. Docker installation (optional, Debian and Ubuntu only)”

If Docker is already present and working, nothing happens here. If it is missing:

  • With --install-docker on Debian or Ubuntu, the installer adds Docker’s official apt repository and installs docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin and docker-compose-plugin, then runs systemctl enable --now docker. It writes the repository key to /etc/apt/keyrings/docker.asc and the source list to /etc/apt/sources.list.d/docker.list. If either file already exists with different content, it refuses to overwrite it.
  • Without --install-docker, or on any other distribution, it stops with an error and you install Docker yourself.
  • In preflight stage it never installs anything.

The installer clones the release repository (by default https://github.com/becoolme/openflare-control.git) into the install directory, /opt/openflare by default, using a blobless no-checkout clone. It fetches only the one release tag and checks it out in detached HEAD state. If a local tag with that name already points somewhere else, it refuses.

If the directory already exists, it must be the top level of a git repository whose origin matches the repository URL. Tracked files must be unmodified, or the installer stops with E_CHECKOUT_DIRTY. It then makes the tree readable for the container processes and confirms the Traefik templates are present.

The installer creates the config root (/var/lib/openflare) with these directories:

Directory Mode
/var/lib/openflare 0700
/var/lib/openflare/secrets 0700
/var/lib/openflare/config 0755
/var/lib/openflare/acme-ca 0700
The Traefik static and dynamic config directories 0755

It then generates any secret that is missing, using the character set A-Z a-z 0-9 . _ ~ -, and writes /var/lib/openflare/.env with mode 0600. The generated secrets are PLANE_ADMIN_TOKEN, PLANE_SIGNING_SECRET, PLANE_SECRETS_KEY, CONSOLE_AUTH_PASSWORD, POSTGRES_PASSWORD, REDIS_PASSWORD, OPENFLARE_UPDATER_TOKEN, VRT_CACHE_PURGE_TOKEN and the four VRT_R2_* object-storage keys. It also writes the file-backed secrets under secrets/: database_url, cloudflare_zone_api_token and cloudflare_dns_api_token (and the GitHub files when push deploy is on).

Existing secrets are never rotated. If a secret file already exists with different content from what the installer would write, it stops with E_SECRET_ROTATION. For how containers read these values from files, see Configuration.

With --enable-git-deploy, it also creates the build workspace with mode 0700.

The installer renders the Traefik static configuration and the routes from the release’s templates into /var/lib/openflare/config/traefik.yml and /var/lib/openflare/config/traefik-dynamic/. The routes are an exact host for the console, an optional exact host for the API (only if you set --api-host), an optional webhook host for push deploy, and the wildcard for workers. There is no catch-all route. Details are in TLS certificates.

The installer runs Compose with the fixed project name openflare-all-in-one, your env file, the release’s docker-compose.all-in-one.yml, and the tls profile plus any feature profiles you enabled:

Terminal window
docker compose --env-file /var/lib/openflare/.env \
-f /opt/openflare/docker-compose.all-in-one.yml \
--profile tls [--profile update] [--profile gitdeploy] ...

In order, it:

  1. Validates the rendered Compose configuration (for example, that the images for this tag are referenced and no placeholder values remain).
  2. Pulls the images, then records their digests in /var/lib/openflare/image-digests.txt.
  3. Removes a leftover updater or git-runner container if you have disabled that feature.
  4. Runs up -d. If the Traefik static configuration changed since the last run, it force-recreates only the traefik service.
  5. Waits for the stack. The one-shot services cell-init and silo-init must exit with status 0, and every other service must be healthy (or running, if it has no health check). The wait times out after 300 seconds by default; set COMPOSE_WAIT_TIMEOUT_SECONDS to change it.
  6. Confirms that cell-init succeeded and that postgres, plane, vrt-host, console and traefik are ready.

If bring-up fails, the installer prints the last 60 log lines of postgres, plane, cell-init, vrt-host, console and traefik.

Finally the installer proves the public edge works:

  • An ACME state file exists in the Traefik container.
  • https://<console-host>/console-healthz returns HTTP 200 with a body containing {"ok":true}. It retries up to 18 times, 5 seconds apart. (Tunable with INSTALLER_EDGE_POST_CHECK_ATTEMPTS, 1 to 120, and INSTALLER_EDGE_POST_CHECK_INTERVAL_SECONDS, 0 to 30.)
  • A temporary probe team and worker named install-probe-<random> is created through the plane API on 127.0.0.1:8787, deployed, and requested at https://install-probe-<random>.<worker-base-domain>. It must return 200 with the text openflare-install-probe-ok.
  • A request to a made-up worker subdomain must return 404 or 502, and must be served by the wildcard certificate rather than a per-host one.
  • If you configured an API host, https://<api-host>/api/v1/workers must return 404, proving the management API is not exposed.
  • In proxied or mixed Cloudflare mode, the origin certificate must cover the console host.
  • The probe resources are deleted afterwards.

If the host owns the public IP and the console check fails, the install fails with E_EDGE_POST_CHECK. If the host cannot reach its own public address (for example, when the address is not locally routable for hairpin traffic), the installer falls back to checking through 127.0.0.1 and adds the line EDGE_CHECK_ORIGIN_ONLY to the summary, which means the public path was not tested from this host.

Success logs info: edge post-check passed.

When everything passes, the installer prints a summary to standard output:

Console: https://console.example.com
User: admin
Password variable: CONSOLE_AUTH_PASSWORD in /var/lib/openflare/.env
Worker base: *.example.com

Optional extra lines may follow:

Line Meaning
DNS_CHECK_SKIPPED You used --skip-dns-check.
EDGE_CHECK_ORIGIN_ONLY The edge was tested through 127.0.0.1, not the public address.
EDGE_PROBE_RESIDUAL: <detail> The temporary probe resources could not all be deleted. Remove them in the console.
  1. Read the generated password from the env file:

    Terminal window
    sudo grep '^CONSOLE_AUTH_PASSWORD=' /var/lib/openflare/.env
  2. Open the printed https:// console URL in your browser.

  3. Sign in with user admin and that password.

The console uses HTTP basic authentication. Store the password in a password manager, and treat /var/lib/openflare/.env as a secret file. Next, read Console guide and Deploy a worker.

The installer is built to be re-run safely.

  • Idempotent. Existing directories, matching secret files and an unchanged checkout are left alone. Secrets are never regenerated or rotated.
  • Inputs are not remembered by default. A plain re-run takes its non-secret settings from the flags, environment and prompts of that run, not from the existing .env. Optional features that you do not pass again, such as --enable-updater, return to their defaults. Pass the same options every time.
  • --reconfigure loads the existing non-secret settings from the env file first (domains, hosts, ACME settings, feature switches and their options), so you only pass what you want to change. Use it, for example, to turn on push deploy later or to change the Traefik log level. Explicit flags still win.
  • The release version cannot change. With --reconfigure, asking for a different release tag than the one stored fails with E_INTEGRATION_GAP. The installer does not perform release upgrades. Use the in-console updater or follow Upgrades.

The installer also handles an older checkout-level .env by importing only keys it supports. Any other active key stops the run with E_LEGACY_ENV so nothing is silently dropped.

To stop two installer runs from colliding, the installer creates /var/lib/openflare/.install.lock, a plain file that holds the process ID of the running installer. The lock is released automatically when the installer exits.

  • If another live installer holds it, you get error[E_INSTALL_LOCK] naming that process ID. Wait for it to finish.
  • If the recorded process no longer exists, the lock is stale and the installer reclaims it automatically.
  • Only remove the file by hand after you have confirmed that no installer is running.

A failed run leaves the host in a defined state, and fixing the cause and re-running is the normal recovery. Start from the error code.

  1. Read the last lines. The error is printed as error[E_CODE]: message. Re-run with --verbose for more detail.

  2. Fix the cause, for example a closed firewall port, a token without the right permission, a wrong DNS record, or a busy port 80 or 443.

  3. Re-run with the same options (or --reconfigure plus only the changes you need).

  4. Look at the containers when the failure is during bring-up:

    Terminal window
    docker compose --env-file /var/lib/openflare/.env \
    -f /opt/openflare/docker-compose.all-in-one.yml --profile tls ps
    docker compose --env-file /var/lib/openflare/.env \
    -f /opt/openflare/docker-compose.all-in-one.yml --profile tls logs --tail 100 plane

    Add --profile update or --profile gitdeploy if you enabled them.

Common situations:

Symptom Cause and fix
E_PUBLIC_IP Public IP detection disagreed or failed. Pass the address yourself with --public-ipv4 <address>.
E_PORT_BUSY Something else listens on port 80 or 443. Stop it, then re-run.
E_CHECKOUT_DIRTY Tracked files in /opt/openflare were modified. Restore them with git (for example git -C /opt/openflare checkout -- .) and re-run.
E_SECRET_ROTATION A secret file already exists with different content. The installer will not overwrite it. Restore the original, or investigate before changing it.
E_INSTALL_LOCK Another run is active, or a lock was left by a crashed run. See The install lock.
E_EDGE_POST_CHECK The stack started but the public HTTPS check failed. Check DNS, the firewall and the Traefik logs (certificate issuance can take a minute). Then re-run.
E_SERVICE_HEALTH or E_CELL_INIT A core service did not become healthy. The diagnostic log tail printed by the installer usually names the cause.

For deeper diagnosis, see Troubleshooting.