Skip to content

TLS and certificates

When you install with TLS, OpenFlare runs a Traefik edge in front of the stack. This page describes what it serves, how certificates are issued and stored, and how to verify it. DNS prerequisites are in DNS and Cloudflare.

Traefik runs under the compose profile tls. It is a file-provider-only edge:

  • It has no Docker socket mount, no container labels, and no API or dashboard.
  • It is started with exactly --configFile=/etc/traefik/traefik.yml and reads routes from a watched directory.
  • It listens on ports 80 and 443. Port 80 permanently redirects to HTTPS. Override the bind address with VRT_TLS_BIND (default 0.0.0.0 for both ports).
  • Platform support is linux/amd64. The installer needs ports 80 and 443 free, unless the all-in-one project itself already holds them.

The default image is traefik:v3.7.20. Traefik v3.7.0 is the minimum, because OpenFlare relies on wildcard Host() rules.

The installer renders these files; do not edit them by hand, because the next install or reconcile overwrites them.

File (default location) Purpose
/var/lib/openflare/config/traefik.yml Static config (entry points, ACME resolver, trusted proxies, log level). Read only at startup.
/var/lib/openflare/config/traefik-dynamic/edge-routes.yml Routes for the console, plane API and tenant ingress. Watched live.
/var/lib/openflare/config/traefik-dynamic/github-webhook.yml Webhook route. Present only when git push deploy is enabled.

The paths come from OPENFLARE_CONFIG_ROOT (default /var/lib/openflare), OPENFLARE_TRAEFIK_STATIC_CONFIG and OPENFLARE_TRAEFIK_DYNAMIC_DIR, recorded in /var/lib/openflare/.env (OPENFLARE_ENV_FILE).

Both bind mounts are declared with create_host_path: false, so if a rendered file is missing, docker compose up fails instead of silently creating an empty directory. This needs Docker Engine v23 or newer. Missing Cloudflare token files fail the same way.

A change to the static config requires a Traefik restart. The installer and reconcile compare a content hash and force-recreate the traefik service when the static file changed. Dynamic-only changes are picked up live.

The log level is TRAEFIK_LOG_LEVEL (default WARN; one of DEBUG, INFO, WARN, ERROR), set with the installer flag --traefik-log-level.

Certificates are issued by ACME using the DNS-01 challenge through the Cloudflare provider. This is the only challenge used, which is why it works when records are proxied and why no inbound validation traffic is needed. Credentials come from the two Cloudflare tokens described in DNS and Cloudflare.

Certificate Covers Used by
Wildcard *.<worker-base> only (not the apex) Tenant worker traffic
Console exact console host Console
API exact API host, if set Remote cell traffic
Webhook exact webhook host, when git deploy is on GitHub webhooks

Console, API and webhook hosts use their own exact certificates rather than reusing the wildcard. If the worker base domain is in a different zone from the console, it gets its own wildcard certificate.

The ACME resolver is named le. Its email is the one you gave the installer (the compose variable VRT_TLS_EMAIL is a legacy alias for it). Storage is /acme/acme.json.

Route Matches Backend
console Host(console) console:8788
plane-api (only when an API host is set) Host(api) and PathPrefix(/api/internal/) plane:8787
tenant-ingress Host(*.<worker-base>) except the console, API, webhook and each reserved-label host vrt-host:8080 (priority 1)
github-webhook (only with git deploy) Host(hooks), Path(/api/integrations/github/webhook), POST plane:8787

The public API host exposes only /api/internal/, which remote cells use to pull desired state. The management API (/api/v1) is never published through the edge. It stays on the loopback address 127.0.0.1:8787 (PLANE_BIND). To use it remotely, tunnel over SSH or put your own allowlist or mTLS reverse proxy in front. See Management API.

The webhook host exposes a single path and method, nothing else.

A request for a host that is not in any route (for example a name not under your wildcard) is not served by a dedicated certificate. A name under the wildcard handshakes with the wildcard certificate, and Traefik does not request a new certificate for it. The tenant router passes it to vrt-host, which answers with an error status for unknown workers. The exact status is determined by the worker runtime.

Certificates and the ACME account key live in the Docker volume traefik-acme (/acme/acme.json, mode 0600). Traefik renews automatically.

One way to take a copy:

Terminal window
docker run --rm -v traefik-acme:/acme -v "$PWD":/backup alpine \
cp /acme/acme.json /backup/acme.json.bak

Docker may prefix the volume name with the compose project name; list volumes with docker volume ls to confirm the exact name.

Use these options for Let’s Encrypt staging or a private CA such as Pebble. Each is available as a flag and an environment variable.

Flag Env Default Notes
--acme-ca-server OPENFLARE_ACME_CA_SERVER https://acme-v02.api.letsencrypt.org/directory Must be an HTTPS URL
--acme-ca-certificates OPENFLARE_ACME_CA_CERTIFICATES none Comma-separated host paths of PEM files to trust
--acme-ca-server-name OPENFLARE_ACME_CA_SERVER_NAME none TLS server name to use when talking to the CA

The Let’s Encrypt staging directory is a valid value. The installer’s CAA check recognizes both the production and staging Let’s Encrypt hosts.

PEM files are validated strictly: they must exist, be readable, not be symlinks, use absolute paths without whitespace, parse as certificate bundles, and contain no private key. The installer copies them to $OPENFLARE_CONFIG_ROOT/acme-ca/ca-<n>.pem (directory 0700, files 0600), and Traefik mounts them read-only at /acme-ca. Later runs reuse those copies. If a copy is deleted, provide the host PEM again.

Terminal window
# Certificate presented for the console host
openssl s_client -connect console.example.com:443 -servername console.example.com </dev/null 2>/dev/null \
| openssl x509 -noout -subject -issuer -dates -ext subjectAltName
# Wildcard certificate for a worker host
openssl s_client -connect demo.example.com:443 -servername demo.example.com </dev/null 2>/dev/null \
| openssl x509 -noout -ext subjectAltName
# Edge health through the console
curl -fsS https://console.example.com/console-healthz

The wildcard certificate should list *.example.com and not the apex. The installer runs equivalent checks at the end of an install, including that the API host does not expose /api/v1, and that ACME storage exists.

Check Traefik’s own logs with docker compose --env-file /var/lib/openflare/.env -f docker-compose.all-in-one.yml --profile tls logs traefik. Raise TRAEFIK_LOG_LEVEL to DEBUG while diagnosing ACME problems.