Deploying behind Cloudflare
Putting an app behind Cloudflare’s proxy (orange-cloud) means Cloudflare terminates TLS at the edge, so the usual HTTP-01 certificate challenge can’t reach your origin. homeport handles this with DNS-01 certificates — Caddy proves ownership through the DNS API — plus a one-command setup and an optional origin firewall.
One-command server setup
Section titled “One-command server setup”server cloudflare does the three server-side steps at once: installs the
caddy-dns/cloudflare plugin, stores your DNS token, and sets Cloudflare as
the global DNS provider.
homeport server cloudflare # paste a Zone → DNS → Edit token, press EnterThe token travels over ssh stdin — never argv, never logs, never git — and lives root-owned on the box.
Opt each app in
Section titled “Opt each app in”Add one line to the app’s homeport.yaml:
cloudflare: trueIt’s pure shorthand for tls: dns:cloudflare — DNS-01 certs that issue and
renew straight through the proxy — and sets nothing else on your behalf.
Lock the origin to Cloudflare
Section titled “Lock the origin to Cloudflare”Running behind an edge proxy only helps if attackers can’t skip it: your origin IP is usually in public DNS history. Restrict web ingress to Cloudflare’s edge ranges in one step:
homeport server firewall allow cloudflareThis fetches Cloudflare’s current published ranges (v4 + v6) and locks 80/443 to them — dropped in the kernel before a handshake. SSH is never touched, so a bad policy can only break web traffic, not lock you out.
The whole flow
Section titled “The whole flow”-
Set up the server
Terminal window homeport server cloudflare -
Opt the app in
homeport.yaml cloudflare: true -
Deploy
Terminal window homeport deploy -
Lock the origin (optional)
Terminal window homeport server firewall allow cloudflare
Encrypted Client Hello
Section titled “Encrypted Client Hello”For direct-served (grey-cloud) hosts, Caddy can also publish Encrypted Client Hello, which encrypts the SNI so the hostname a visitor opens doesn’t leak. It needs the same DNS provider setup as above:
homeport server ech ech.example.com # a "public name" you controlProxied hosts get ECH from Cloudflare’s edge automatically — server ech is
for hosts you serve directly.