MENTECHLet’s talkالعربية
Menu

Renew an expired certificate

Renew it, and never again.

Once a certificate expires, every visitor sees a warning before your site. Renew it now, then let the server renew it by itself.

Before you start

  • Whoever runs your server or hosting can do this. Send them this page.
  • Find out who issued the certificate. Our check shows it.
  • Let's Encrypt certificates will last 64 days from February 2027, so a fixed 60-day reminder leaves almost no time. Automatic renewal is the answer.

The steps

With Certbot, run these in order: renew what is due, reload NGINX after every renewal, then test the renewal and the reload, and see that a timer is set. No Certbot yet? Install it from certbot.eff.org and start with: sudo certbot --nginx

sudo certbot renew
printf '#!/bin/sh\nnginx -t && nginx -s reload\n' | sudo tee /etc/letsencrypt/renewal-hooks/deploy/reload.sh
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/reload.sh
sudo certbot renew --dry-run
sudo /etc/letsencrypt/renewal-hooks/deploy/reload.sh
systemctl list-timers | grep certbot

Then check the settings and reload.

sudo nginx -t && sudo nginx -s reload

If it shows an error, or the site stops, put the saved copy back and restart the server program at once.

Check that it worked

openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -dates

The notAfter date should be weeks away.

To undo it

Nothing to undo. The old certificate can no longer be used.

Common mistakes

  • The new certificate is on the disk, but the server was never reloaded, so visitors still get the old one.
  • Deleting files inside /etc/letsencrypt by hand. It breaks the next renewal.
  • Removing a strange-looking record from DNS that the renewal depends on.
Have us fix it for you
CallWhatsAppLet’s talk