Skip to content
local-cert
Browse the documentation

Caddy

Caddy obtains its certificates on its own. Two settings are enough to make it use local-cert instead of Let's Encrypt directly.

ValueWhere to find itIn this guide
ACME directoryfixed for each instancehttps://certs.example.com/acme/directory
Key ID (kid)Keys & access → EAB credentialseab_XXXXXXXXXXXXXXXX
HMAC keyshown only once, at creationCLE_HMAC

For all sites

In the global options block, at the top of the Caddyfile:

Caddyfile
{
	email ops@example.com
	acme_ca https://certs.example.com/acme/directory
	acme_eab {
		key_id eab_XXXXXXXXXXXXXXXX
		mac_key CLE_HMAC
	}
}

nas.home.example.com {
	reverse_proxy 192.168.1.50:5000
}

For a single site

If Caddy also serves public sites that must stay with Let's Encrypt, declare the issuer in the relevant site:

Caddyfile
nas.home.example.com {
	tls {
		issuer acme {
			dir https://certs.example.com/acme/directory
			eab eab_XXXXXXXXXXXXXXXX CLE_HMAC
			disable_tlsalpn_challenge
		}
	}
	reverse_proxy 192.168.1.50:5000
}

Good to know

  • Caddy only requests a certificate for a real domain name. A .local or .internal name, or an IP address, gets a certificate from its internal CA, without going through local-cert.
  • Caddy tries TLS-ALPN-01 and HTTP-01; local-cert only offers HTTP-01, and Caddy falls back to it on its own. disable_tlsalpn_challenge just skips the attempt.
  • After changing CA, reload (caddy reload). Certificates already obtained keep being used until they are renewed.