Home FixHow to Fix Let’s Encrypt Certificate Renewal Failures in Certbot

How to Fix Let’s Encrypt Certificate Renewal Failures in Certbot

by Knowledge Base Linux
How to Fix Let s Encrypt — How to Fix Let's Encrypt Certificate Renewal Failures in Certbot

Let’s Encrypt certificates live for only 90 days, so renewal is not optional — and when it breaks, you find out from a warning email or, worse, from visitors seeing certificate errors. A certbot renewal failed message has a handful of recurring causes, and Certbot’s own output tells you which one you have. This guide explains how to test renewal safely, read the failure, and fix each common cause.

Step 1: Test Renewal Without Risk – How to Fix Let s Encrypt

Never debug against the live system first. Certbot’s dry run performs the full validation against the staging environment and changes nothing:

sudo certbot renew --dry-run

If the dry run succeeds, the real renewal will almost always work too. If it fails, note the exact error type — Certbot reports challenge failures such as Timeout during connect, DNS problem: NXDOMAIN, Connection refused or Invalid response from ... 404. Each maps to a different fix below. For the initial setup reference, see our tutorial on securing Nginx with a Let’s Encrypt certificate.

Renewing a certificate successfully after fixing a certbot renewal failed error

Step 2: Fix DNS and Domain Problems – How to Fix Let s Encrypt

The domain in the certificate must resolve publicly to this server. Check what the world sees:

dig +short your-domain.com
dig +short www.your-domain.com

Renewals fail after server migrations when the certificate still names an old domain, and after DNS changes that removed a subdomain. If a name on the certificate no longer points at you, reissue the certificate with only the names you control:

sudo certbot --nginx -d your-domain.com -d www.your-domain.com

Also make sure IPv6 is not sabotaging validation: if the domain has an AAAA record, Let’s Encrypt prefers it — either serve the site correctly over IPv6 or remove the stale AAAA record.

Step 3: Open Port 80 and Check the Firewall

The default HTTP-01 challenge needs port 80 reachable from the internet — even if your site forces HTTPS. A firewall change or an over-strict redirect breaks it silently:

sudo ufw status
sudo ss -tlnp | grep ':80'
curl -I http://your-domain.com/.well-known/acme-challenge/test

A 404 from your own web server is fine at this stage (the directory is empty); a timeout or connection refused is not. If Nginx or Apache redirects everything — including /.well-known/acme-challenge/ — to a login page or another domain, exempt that path from the redirect.

Step 4: Fix Webroot and Plugin Mismatches

With the webroot plugin, Certbot writes challenge files into a directory your web server must serve. If the site moved, the path in the renewal config is stale. Inspect it:

sudo cat /etc/letsencrypt/renewal/your-domain.com.conf

Check the webroot_path and authenticator values. When in doubt, renew once with the plugin matching your server so Certbot rewrites the config correctly:

sudo certbot renew --nginx --force-renewal
# or for Apache:
sudo certbot renew --apache --force-renewal

Step 5: Respect Rate Limits and Expired Roots

Repeated failed attempts can trigger Let’s Encrypt rate limits (five failed validations per hostname per hour); the error output names the limit and the retry time — wait it out instead of hammering. Two other classics: the server clock being wrong (timedatectl — validation fails if your time is off), and very old Certbot versions that no longer trust the chain. Keep Certbot updated via the official Certbot installation instructions for your OS.

Step 6: Make Renewal Automatic — and Verify It

Confirm the automation exists so you never end up here again:

systemctl list-timers | grep certbot
sudo certbot renew --dry-run

Most packages install a systemd timer or a cron entry running certbot renew twice daily. After a successful renewal, your web server also needs a reload to serve the new certificate — the standard packages install a deploy hook for this; test by checking the served certificate dates:

echo | openssl s_client -connect your-domain.com:443 -servername your-domain.com 2>/dev/null | openssl x509 -noout -dates

What to Do When the Certificate Has Already Expired

If the renewal failed silently for weeks and the certificate is already expired, do not panic — the fix sequence is identical, only the urgency differs. Browsers will warn visitors away, so work promptly: run the dry run, fix the reported challenge problem, then renew for real with sudo certbot renew --force-renewal. The moment it succeeds, reload your web server and verify the new dates with the openssl check from Step 6. Then find out why the failure went unnoticed: the systemd timer was inactive, the renewal email went to a dead mailbox, or a server migration copied certificates without their renewal configs. Add an external uptime/SSL check that alerts at 14 days to expiry, so the next failure pages you while there is still a two-week runway instead of becoming an outage.

Conclusion

When certbot renewal failed, run a dry run, read the exact challenge error, and check the usual suspects in order: DNS, port 80, webroot paths, redirects, clock and rate limits. Fix the cause, prove it with another dry run, and confirm the timer is active — then the next renewal happens quietly, months before expiry becomes an emergency.

You may also like

KbLinux

Typically replies within a day

Hello, Welcome to the site. Please click below button for chatting me through Telegram.