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 certbotThen check the settings and reload.
sudo nginx -t && sudo nginx -s reloadIf it shows an error, or the site stops, put the saved copy back and restart the server program at once.
With Certbot, run these in order: renew what is due, reload Apache 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 --apache
sudo certbot renew
printf '#!/bin/sh\napachectl configtest && apachectl graceful\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 certbotThen check the settings and reload.
sudo apachectl configtest && sudo apachectl gracefulIf it shows an error, or the site stops, put the saved copy back and restart the server program at once.
HAProxy reads one file holding the certificate, its chain and the key. These commands build it now and after every renewal. The path must match the crt setting.
sudo certbot renew
sudo mkdir -p /etc/haproxy/certs
printf '#!/bin/sh\numask 077\ncd /etc/letsencrypt/live/example.com && cat fullchain.pem privkey.pem > /etc/haproxy/certs/example.com.pem && systemctl reload haproxy\n' | sudo tee /etc/letsencrypt/renewal-hooks/deploy/haproxy.sh
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/haproxy.sh
sudo /etc/letsencrypt/renewal-hooks/deploy/haproxy.shThen check the settings and reload.
sudo haproxy -c -f /etc/haproxy/haproxy.cfg && sudo systemctl reload haproxyIf it shows an error, or the site stops, put the saved copy back and restart the server program at once.
Caddy renews by itself. If it did not, check that the domain points to this server, that ports 80 and 443 are open, and that its data folder is kept after restarts.
Then check the settings and reload.
sudo systemctl reload caddyIf it shows an error, or the site stops, put the saved copy back and restart the server program at once.
A free tool such as simple-acme gets the certificate, checks it every day and renews it when due. If you renew by hand, import the new certificate, then select it under the site's Bindings, https.
Cloudflare renews the certificate your visitors see, unless you uploaded your own. The one on your server is separate, and nobody reminds you about it.
An expired certificate does not renew by itself. Request a new one in Certificate Manager with DNS validation, select it on the load balancer or CloudFront, and leave its validation record in your DNS for good.
In cPanel, open SSL/TLS Status and choose Run AutoSSL. It works only while the domain points to this server.
Open the domain, then SSL/TLS Certificates. Install the free Let's Encrypt certificate and switch on Keep websites secured.
Check that it worked
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -datesThe 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.