work // container image

Caddy with Cloudflare DNS

:: updated 30 November 2026 :: 1 min :: source

Stock Caddy can’t solve the ACME DNS-01 challenge against Cloudflare, and the HTTP-01 challenge needs the service reachable from the internet. For anything internal that’s the wrong trade: I want a valid certificate on a name that only resolves on the lab network.

The fix is a custom Caddy build with the caddy-dns/cloudflare module baked in. With a scoped Cloudflare API token Caddy proves domain ownership through a TXT record, so nothing has to listen publicly.

The how-to is on the blog: Build your own Caddy V2 + Cloudflare docker image. The image itself is in the repository.