Automate certificate renewal on Caddy

Caddy renews publicly trusted certificates on its own through Automatic HTTPS, using ACME with Let's Encrypt or ZeroSSL. The shorter lifetimes mean renewal has to work reliably on every cycle, so teams should confirm ports, DNS access and monitoring now.

On this page

Does Caddy renew certificates automatically?

Yes. Caddy's Automatic HTTPS obtains and renews publicly trusted certificates through ACME, using Let's Encrypt and ZeroSSL as its default certificate authorities, and it tries ZeroSSL if Let's Encrypt fails. For a team running Caddy as a web server or proxy, the automation is built in, but it is not the same as being safe. The 200-day limit that applies from 15 March 2026, the 100-day limit from 15 March 2027 and the 47-day limit from 15 March 2029 each cut the number of renewals a site needs in a year, and they shorten how long a domain validation can be reused, so Caddy will need to validate ownership more often. Plan for renewal to happen several times a year per hostname, and plan for the failure case, because if renewal silently stops, the certificate expires and clients start rejecting the site.

Caddy retries after a failure, switches challenge type, tries the next issuer, and then backs off exponentially to at most one day between attempts for up to 30 days. That retry window is useful, but it can hide a problem until the certificate is close to expiring. The HTTP challenge needs port 80 reachable from outside, the TLS-ALPN challenge needs port 443, and the DNS challenge needs provider credentials and a custom Caddy build that includes the matching caddy-dns plugin. Confirm which challenge your network allows before go-live, because a firewall change can quietly break renewal months later. Let's Encrypt's published timeline also moves its default lifetime to 64 days in February 2027 and to 45 days in February 2028, so confirm your Caddy version and issuer behavior against those dates.

Which lifetime limits apply to Caddy certificates, and when

This table sets the CA/Browser Forum lifetime steps beside Let's Encrypt's own timeline, then shows what each step means on a Caddy host. Read each row as one date: the certificate lifetime that applies, and the renewal workload it creates. The main takeaway is that Caddy renews on its own schedule, so the host must follow the shorter lifetimes without relying on a fixed renewal interval.

DateCA/B Forum limitLet's Encrypt timelineWhat it means on a Caddy host
15 March 2026200-day maximum certificate validity; 200-day domain validation reuse13 May 2026: opt-in tlsserver profile issues 45-day certificatesCaddy's default renewal is set by renewal_window_ratio (default 0.3333); confirm the renewal interval Caddy uses for each certificate in your storage
10 February 2027No change in the CA/B Forum schedule listed hereDefault classic profile issues 64-day certificates; 10-day authorization reuseRenewals become more frequent than a 60-day interval would allow; Caddy should still renew automatically, so confirm it is doing so
15 March 2027100-day maximum certificate validity; 100-day domain validation reuseNo change listed for this dateRoughly three to four renewals per year per name at the 100-day limit; confirm the renewal window Caddy uses at this lifetime
16 February 2028No change in the CA/B Forum schedule listed hereDefault classic profile issues 45-day certificates; 7-hour authorization reuseRoughly eight renewals per year per name; Caddy's built-in renewal must run without manual steps, so check renewal logs and storage
15 March 202947-day maximum certificate validity; 10-day domain validation reuseNo change listed for this dateRoughly eight renewals per year per name at the 47-day limit; a hardcoded renewal interval will fail, so confirm Caddy uses ACME Renewal Information
All datesValidation reuse shortens with each stepLet's Encrypt recommends ARI and monitoring that alerts when renewal does not happenMonitor certificate expiry from the metrics or an external check; Caddy's metrics page lists no certificate-specific metrics, so plan external monitoring

How Caddy obtains, stores and reloads certificates

Caddy's Automatic HTTPS obtains and renews certificates for you without a separate ACME client. By default it uses Let's Encrypt and ZeroSSL as its ACME certificate authorities, trying ZeroSSL if Let's Encrypt fails. After a failed attempt Caddy retries once, switches challenge type, then moves to the next issuer. If every issuer fails, it backs off exponentially, up to a maximum of 1 day between attempts for as long as 30 days, and switches to Let's Encrypt staging during those retries. Before go-live, confirm that your hostnames resolve publicly and that the HTTP challenge (port 80) or TLS-ALPN challenge (port 443) is reachable from the internet. Both challenges are enabled by default, and with both enabled Caddy picks one at random and gradually favors whichever succeeds most. If you need wildcard certificates, you must use the DNS challenge, which requires a custom Caddy build with the matching caddy-dns provider plugin and credentials for that provider.

Certificates and private keys are written to the configured storage, which defaults to the file system in Caddy's data directory. That makes a writable and persistent $HOME a hard requirement, because a container or service account that loses its home directory on restart will re-issue certificates and may hit issuer rate limits. When several Caddy instances share the same storage, they coordinate certificate management as a cluster, so only one needs to perform each ACME order. Plan shared storage with that in mind, and back it up, since losing it forces re-issuance. Caddy manages renewal itself, so there is no cron job or deploy hook to write for ordinary public sites. You still need monitoring that alerts you when a certificate is not renewed as expected. Caddy's metrics are served at /metrics on the admin API (`) once metrics are enabled in the global options, but the metrics page does not document certificate-specific metrics, so confirm what you can observe in your version.

Automatic HTTPS does not activate in several cases, and each one leaves you responsible for certificates yourself. It stays off when you disable it explicitly, when a site address is prefixed with when no hostnames or IP addresses are given, when only the HTTP port is listened on, or when you load certificates manually. Loaded certificates block automatic management unless ignore_loaded_certificates is set. Names such as localhost, .local, .internal and .home.arpa receive certificates from Caddy's local CA, which is trusted only where its root is installed, and .ts.net names are handled by the local Tailscale instance rather than Caddy. Check which path each site takes before you rely on renewal. Caddy will attempt to install its local root into the system trust store on first use, so skip_install_trust or install_trust false controls that behavior, and caddy trust` retries installation with privileges.

Which validation method to use with Caddy

The HTTP challenge proves control of a domain by having Caddy serve a token over port 80 that the certificate authority then fetches from the public internet. It is enabled by default, so a public site with port 80 reachable from outside usually needs no extra configuration for Caddy to obtain and renew its certificate.

  • Port 80 must be reachable externally: the certificate authority has to connect to your server on port 80 during validation, so firewalls, cloud security groups and load balancers in front of Caddy must allow it.
  • Enabled by default: with both HTTP and TLS-ALPN active, Caddy chooses one at random and gradually favors the one that succeeds most.
  • Not suitable for private networks: a server that is reachable only inside your network cannot complete this challenge from the public certificate authority.
  • No wildcard certificates: wildcard certificates from Let's Encrypt require the DNS challenge, so HTTP cannot cover them.
  • Failure handling: after a failure Caddy retries once, switches challenge type, then tries the next issuer, and backs off to a maximum of one day between attempts for up to 30 days.

Before relying on this method, confirm that port 80 reaches Caddy from the internet on the path your certificate authority will use, and check the current behavior in the Caddy automatic HTTPS documentation.

Set up automatic renewal on Caddy, in order

This sequence gets Caddy to obtain and renew its certificates without manual steps. Each step confirms one requirement, so the first renewal under the shorter lifetimes runs without intervention and any failure shows up in the admin metrics.

  1. Confirm DNS points at the server

    Check that each hostname you plan to serve resolves to the public address of the Caddy server. Run a DNS lookup from outside your network, not only from the server itself, and confirm the answer matches the address you expect. Automatic HTTPS depends on the validation challenge reaching this server, so a stale or misdirected record will cause issuance to fail before any Caddy setting is wrong. You know this step is done when every site address returns the correct IP from an outside resolver.

  2. Choose and open the validation method

    Pick how Caddy proves control of each domain. The HTTP challenge needs port 80 reachable from the public internet, and the TLS-ALPN challenge needs port 443. Both are enabled by default, and with both enabled Caddy chooses one at random and gradually prefers whichever succeeds more often. If you need wildcard certificates, or cannot open inbound ports, use the DNS challenge instead, which needs provider credentials and no open ports. Confirm the firewall or security group allows the chosen port, and check whether your build includes the DNS provider plugin, since it must come from a caddy-dns repository and so may require a custom build. You know this step is done when the chosen port is reachable from outside or the DNS provider module is present in the build.

  3. Configure the DNS provider in the tls directive

    If you use the DNS challenge, add a tls directive that names your provider with dns <provider_name> and supplies its credentials. Review propagation_timeout, which defaults to 2 minutes, and set -1 only if you intend to disable propagation checks. Use resolvers to set the DNS servers Caddy queries when it checks for the challenge record. Keep these settings in the Caddyfile so they survive restarts. You know this step is done when a configuration validation run reports no errors and the provider name matches the plugin in your build.

  4. Confirm a writable persistent data directory

    Caddy stores certificates and keys in its data directory by default, so the user Caddy runs as must have a writable and persistent $HOME. Check that the path survives a host restart and is not a temporary filesystem, because losing it forces Caddy to re-issue every certificate. If several Caddy instances share storage, they coordinate certificate management as a cluster, so confirm they all point at the same storage. You know this step is done when the Caddy user can create and modify files in the data directory and that directory is on persistent storage.

  5. Decide between ZeroSSL and Let's Encrypt

    Caddy's default ACME certificate authorities are Let's Encrypt and ZeroSSL, and Caddy tries ZeroSSL if Let's Encrypt fails. Decide which issuer should be primary for your estate and whether you accept the fallback behaviour. Record the decision so your monitoring and incident runbooks name the correct issuer. Note that after failures Caddy retries, switches challenge type, moves to the next issuer and backs off exponentially to a maximum of one day between attempts for up to 30 days, switching to the Let's Encrypt staging environment during retries. You know this step is done when the issuer choice is written into your configuration or runbook.

  6. Enable metrics in the global options

    Add metrics to the global options block of the Caddyfile so Caddy exposes its metrics. Caddy serves them at /metrics on the admin API, which is once enabled. The metrics page does not document certificate-specific metrics, so plan to watch certificate status through your own checks as well. Confirm the admin endpoint is reachable only from trusted hosts. You know this step is done when the metrics endpoint responds on the admin address from the server itself.

  7. Check the admin endpoint and confirm issuance

    Reload the configuration and check the admin endpoint and logs to confirm each site obtained a certificate. Automatic HTTPS does not activate for sites prefixed with for hostnames that are missing, or when certificates are loaded manually without ignore_loaded_certificates, so verify every site address is treated as intended. Review the logs for the challenge outcome and the issuing authority. You know this step is done when each intended hostname has an issued certificate and no site is silently left on plain HTTP.

What must be in place before Caddy can renew

Caddy renews its certificates on its own, but only when the network, DNS, storage and admin settings it depends on are already in place. Check these four to six items before you rely on automatic renewal, since a missing port, plugin or writable directory can stop renewals without an obvious error.

Ports 80 and 443 reachable

Caddy's default HTTP challenge needs port 80 reachable from the public internet, and the TLS-ALPN challenge needs port 443. Both are enabled by default. When both are enabled, Caddy picks one at random and gradually favors whichever succeeds more often. Confirm that inbound traffic on both ports reaches the Caddy host, including any cloud security group or upstream firewall. If the hostname resolves to a private address or the ports are blocked, the challenge fails and renewal stops.

Caddy automatic HTTPS

DNS provider access and custom build

If you use the DNS challenge, Caddy needs credentials for your DNS provider and no open inbound ports. The DNS challenge is also required for wildcard certificates with Let's Encrypt. Provider plugins come from caddy-dns repositories, so the standard Caddy binary cannot use them and you need a custom build that includes the plugin for your provider. Confirm the plugin supports your provider and that the build is repeatable, because each upgrade must rebuild with the plugin.

Caddy tls directive

Writable and persistent storage

Caddy stores certificates and keys in its configured storage, which defaults to the file system in the data directory under $HOME. That directory must be writable and must survive restarts, container rebuilds and host replacement. If the data directory is lost, Caddy has to re-issue certificates, which can hit rate limits. Where several Caddy instances share storage, they coordinate certificate management as a cluster, so confirm that all instances point to the same storage.

Caddy automatic HTTPS

DNS records for each hostname

Every hostname Caddy manages must resolve to the server that will answer the challenge. For the HTTP and TLS-ALPN challenges, that means an A or AAAA record pointing to the Caddy host. For the DNS challenge, the provider must be able to create the _acme-challenge TXT records, and you can delegate those with a CNAME. Hostnames ending in .localhost, .local, .internal or .home.arpa are not publicly trusted, so they will not get public certificates. Check each hostname against its records before deploying.

Caddy automatic HTTPS

Admin API access for metrics

Caddy serves its metrics at /metrics on the admin API, which listens at localhost:2019 once metrics are enabled in the global options. Monitoring tools that run on the same host can scrape that endpoint, but they cannot reach it from another machine without additional configuration. The metrics page does not document certificate-specific metrics, so plan to monitor renewal outcomes from logs or external checks. Confirm which monitoring system will read this endpoint and how it will alert.

Caddy metrics

Which names Caddy cannot publicly certify

Caddy cannot get a publicly trusted certificate for every name it serves. Automatic HTTPS depends on an ACME challenge that proves control of a public domain, so IP addresses, localhost and private or internal names fall outside what Let's Encrypt or ZeroSSL will issue. For those names Caddy uses its own local certificate authority instead. That CA needs no ACME or DNS validation and works only on the machine where it runs, and browsers and other clients trust its certificates only where its root certificate is installed. Before you rely on a Caddy site for internal traffic, decide which names are internal, confirm which CA signs them, and confirm where that root must be distributed. The Caddy automatic HTTPS documentation sets out how the local CA fits into the default flow.

The shortcut tls internal tells Caddy to use its internal CA for a site. When you need control over that CA, the issuer internal block accepts ca (default local), lifetime and sign_with_root for custom internal CA options. These settings change how the internal certificates are issued and chained, so check the Caddy tls directive reference for the exact syntax and the defaults in your version. Caddy also tries to install its local root into the system trust store on first use. Set skip_install_trust in the Caddyfile, or install_trust to false in JSON, if you manage trust distribution yourself or do not want Caddy changing the host trust store. The caddy trust command retries installation with the privileges it needs. Either way, the root you distribute is the one that must be reinstalled or rotated when the local CA changes.

Names ending in .localhost, .local, .internal or .home.arpa are not publicly trusted, so Caddy treats them as internal names and they need the local CA or an equivalent internal certificate. Domains ending in .ts.net are not managed by Caddy at all, because their certificates come from the local Tailscale instance. Audit your site list against these suffixes before you go live, and confirm for each name which issuer serves it. Names that look public but resolve only on an internal DNS zone still need this check, since a public CA will not issue for a domain you cannot prove control of over the public internet.

What goes wrong with Caddy renewals, and how to notice

Caddy renews certificates on its own, so most problems show up as a quiet retry loop rather than an outage. The cards below cover the failure modes the Caddy documentation describes and the checks that reveal them before a certificate expires.

Failed validation and retry backoff

After a failed issuance or renewal, Caddy retries once, switches challenge type, then tries the next issuer. When every issuer fails, it backs off exponentially, with a maximum of one day between attempts for up to 30 days. A problem that blocks validation can therefore sit unnoticed for weeks. Check the Caddy logs for repeated ACME errors after any change to DNS, firewall rules or ports 80 and 443, and confirm that a renewal has succeeded recently.

Caddy automatic HTTPS

Silent switch to staging during retries

While Caddy retries after failures, it switches to Let's Encrypt staging. Staging certificates are not publicly trusted, so a site can appear to renew while serving a certificate that browsers reject. Review logs during any outage for staging issuance, and treat a retry loop as an incident even when the site still responds.

Caddy automatic HTTPS

Storage that is not persistent

Caddy stores certificates and keys in its data directory on the file system by default, which requires $HOME to be writable and persistent. In containers, ephemeral volumes or read-only root filesystems, Caddy can lose its certificates on restart or fail to write renewed ones. Confirm that the data directory sits on persistent storage, and that instances sharing storage coordinate as a cluster.

Caddy automatic HTTPS

DNS propagation timeouts

The DNS challenge checks that records have propagated before asking the CA to validate. The propagation_timeout defaults to 2 minutes, and a value of -1 disables the check. Slow DNS providers or split-horizon resolvers can exceed the default and fail validation. Set resolvers to the servers that answer for your zone, and check that the provider plugin comes from a caddy-dns repository in your build.

Caddy tls directive

On-Demand TLS in production

The on_demand subdirective of the tls directive issues certificates for hostnames as they arrive. The documentation warns that using it in production is insecure unless the on_demand_tls global option is configured to mitigate abuse. Attackers can trigger issuance for arbitrary names and exhaust CA rate limits. Check your Caddyfile for on_demand and confirm that the mitigation is in place before relying on it.

Caddy tls directive

Manually loaded certificates bypass automation

Automatic HTTPS does not activate when certificates are loaded manually, unless ignore_loaded_certificates is set. A manually loaded certificate will therefore never renew on its own, and it will expire without warning. Inventory every site for manual certificate loading, and make sure each one has a renewal process or has been moved to automatic issuance.

Caddy automatic HTTPS

How to confirm Caddy renewals keep happening

Caddy renews its certificates on its own, so the risk is not that a renewal fails silently inside Caddy and nobody notices. The risk is that renewals stop and nothing alerts anyone until a certificate expires. Caddy's metrics endpoint is at /metrics on the admin API, which listens at once metrics are enabled in the global options. The metrics page documents no certificate-specific metrics, so you cannot rely on Caddy's own metrics to tell you when a certificate is close to expiry. Check expiry from outside Caddy instead: probe each public hostname over TLS, read the notAfter date, and alert on a threshold you set. Run the check from a host that is not the Caddy server itself, so a failure of the server does not also silence the alert.

The renewal_window_ratio setting controls when Caddy starts renewing. Its default is 0.3333, which means renewal begins when about a third of the lifetime remains. Where the ACME issuer supports ACME Renewal Information (ARI, defined in RFC 9773), that value is only a suggestion, and the issuer's advice on timing takes precedence. Let's Encrypt recommends using ARI, recommends monitoring that alerts you when certificates are not renewed when expected, and advises against manual renewal, because shorter lifetimes would make manual renewal a recurring task. Confirm in the Caddy tls directive documentation how your version applies the ratio and ARI, and do not replace automatic renewal with a manual process to get around an alert.

How a Caddy renewal flows from validation to reload

The flow starts when Caddy checks a managed certificate's expiry and, once the renewal window opens, asks the ACME issuer for a new certificate. The issuer then runs one of three challenges: HTTP on port 80, TLS-ALPN on port 443, or DNS through a provider plugin. Caddy writes the new certificate and key to its configured storage and applies them to the running server without a restart. If validation fails, Caddy retries once, switches challenge type, then tries the next issuer, backing off up to a daily maximum. Check that port 80 or 443 is reachable, that DNS credentials are valid, and that storage is writable and persistent.

Caddy's renewal path from expiry check through validation to reload, including the failure loop.

Questions people ask about Caddy certificate renewal

Does Caddy support ACME for automatic certificate renewal?

Yes. Caddy's Automatic HTTPS obtains and renews publicly trusted certificates through ACME without a separate client to install. Certificates and keys are written to the configured storage, which defaults to the file system in the data directory. Because the storage location decides whether renewal survives a restart, confirm that $HOME is writable and persistent on the host, and that instances sharing storage coordinate certificate management as a cluster. Check the Caddy automatic HTTPS documentation for the storage and cluster behavior of the version you run.

Which certificate authority does Caddy use by default?

Caddy's default ACME certificate authorities are Let's Encrypt and ZeroSSL. Caddy tries ZeroSSL if Let's Encrypt fails. This matters for planning because the two CAs can have different lifetimes, rate limits and support for ACME extensions, so check each CA's published policy before relying on one. You can change the issuer in the tls directive. The sources on this page do not list every CA setting, so confirm the exact issuer options in the Caddy tls directive documentation.

Do wildcard certificates work with Caddy, and what do they need?

Wildcard certificates need the DNS challenge. With Let's Encrypt, the DNS challenge is required for wildcards. Enabling it means providing credentials for your DNS provider, and it needs no open inbound ports. Caddy's DNS challenge uses a provider plugin from a caddy-dns repository, so you will need a custom Caddy build that includes that plugin. The tls directive sets dns <provider_name> to enable the challenge, propagation_timeout (default 2 minutes, where -1 disables the check) and resolvers for the DNS servers. Confirm the provider name and credential format in the Caddy documentation for your provider plugin.

How often do Caddy certificates renew under the new shorter lifetimes?

Caddy renews a certificate when its remaining lifetime falls to the renewal window, which the renewal_window_ratio setting controls. Its default is 0.3333, so renewal starts about a third of the way through the lifetime from the end. Under the CA/Browser Forum schedule, public subscriber certificates move to a maximum validity of 200 days from 15 March 2026, 100 days from 15 March 2027 and 47 days from 15 March 2029. Let's Encrypt's published timeline moves its default to 64 days from 10 February 2027 and 45 days from 16 February 2028. Where ARI is in use, the renewal window is only a suggestion. Confirm the behavior for your issuer and version.

What happens when Caddy certificate renewal fails?

Caddy first retries once and switches challenge type, then tries the next issuer. If every issuer fails, it backs off exponentially, with a maximum of 1 day between attempts, for up to 30 days. During those retries it switches to the Let's Encrypt staging environment. Because Caddy keeps retrying for weeks, a silent failure can go unnoticed until a certificate actually expires. Caddy serves metrics at /metrics on the admin API at ` once metrics are enabled in the global options. The metrics documentation lists no certificate-specific metrics, so set up external monitoring that alerts when a certificate is not renewed when expected.

Can Caddy give internal hostnames a publicly trusted certificate?

No. Hostnames ending in .localhost, .local, .internal or .home.arpa are not publicly trusted, so public CAs will not issue for them. For these names, Caddy uses its own local CA, which needs no ACME or DNS validation, works only on the local machine, and is trusted only where its root is installed. The tls internal shortcut uses that CA, and the issuer internal block accepts options such as ca, lifetime and sign_with_root. Domains ending in .ts.net are not managed by Caddy because their certificates come from the local Tailscale instance. Plan trust distribution for the internal root before relying on it.

Should we bring in outside help to automate Caddy renewal?

It depends on how many hosts, DNS providers and trust domains you run. Outside help is most useful when renewal must work across a cluster, when wildcard certificates need a custom Caddy build with a DNS provider plugin, or when internal names need a trust distribution plan. DeployOpen plans, implements and documents self-hosted platforms inside your own infrastructure, and prepares evidence for compliance assessments. Most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. DeployOpen does not publish a price list, and a quote follows from the written scope. Ask any provider for the written scope and the monitoring they will leave behind.

How DeployOpen helps teams run Caddy certificate automation

DeployOpen plans and builds Caddy certificate automation inside your own infrastructure, starting from a written scope that covers which names, challenge types and internal certificates Caddy must handle. We configure the Caddyfile, storage and monitoring, test renewal failure paths, and document the setup so your platform team can run it after handover.

How we scope

  • We inventory the public and internal hostnames Caddy will serve and check which ones are eligible for public issuance.
  • We confirm whether HTTP, TLS-ALPN or DNS challenges fit your network, and whether a custom DNS plugin build is needed.
  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before any work starts.

How we build

  • We configure the tls directive, issuers, renewal_window_ratio and storage so certificates persist and renew without manual steps.
  • We set up the internal CA, trust installation and skip_install_trust choices for .local, .internal and other non-public names.
  • We enable metrics on the admin API and wire monitoring that alerts when a certificate is not renewed when expected.

How we hand over

  • We deliver the Caddyfile, storage layout and monitoring configuration with a written record of each decision.
  • We walk your platform team through a test renewal and the failure path: retries, challenge switching and issuer fallback.
  • We document where to look in the product documentation for settings not covered by the handover.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, including checks as certificate lifetimes shorten.
  • We can retest renewal and alerting after Caddy upgrades, DNS plugin changes or changes to your network.
  • Ask any provider to confirm which Caddy and plugin versions they will support and how they handle version upgrades.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.