Skip to content
STAGE33R

Guides · Operations · 6 steps · reviewed

Let's Encrypt certificate not renewing? How to troubleshoot certbot on nginx and Apache

Let's Encrypt certificates last 90 days and renew automatically, until something changes: a firewall rule, a redirect, a moved site. The renewal fails quietly and the site shows a security warning weeks later.

  1. See the expiry dates

    Anything under 30 days should have renewed already.

    sudo certbot certificates
  2. Check that renewal is scheduled

    On Ubuntu and Debian a systemd timer runs twice a day.

    systemctl list-timers | grep -i certbot
    systemctl status certbot.timer --no-pager | head -n 6
  3. Run a dry run

    It tests renewal against the staging server and shows the exact error without using your rate limit.

    sudo certbot renew --dry-run
  4. Check the usual causes

    Port 80 must be reachable from the internet, the challenge path must not be redirected or blocked, and the domain must still point to this server.

    sudo ss -ltnp | grep ':80'
    sudo ufw status | grep -E '80|443'
    curl -I http://your-domain.com/.well-known/acme-challenge/test
  5. Read the log

    The last lines name the failing domain and the reason.

    sudo tail -n 40 /var/log/letsencrypt/letsencrypt.log
  6. Renew now and reload the web server

    Then confirm the new dates.

    sudo certbot renew
    sudo systemctl reload nginx
    sudo certbot certificates

Common mistakes

  • A redirect to HTTPS that also catches the challenge path on a site with no valid certificate yet.
  • Cloudflare in proxy mode with a mismatched SSL setting.
  • Port 80 closed in the firewall after hardening.

How to undo it

Certbot keeps the previous certificate files until renewal succeeds; the old certificate remains valid until its expiry date.

Sources

Commands are for Debian and Ubuntu unless noted. Test on a copy first and keep a backup: you are responsible for changes on your own systems.