Guide · SSL/TLS

How to renew an SSL certificate

An expired certificate is one of the most common reasons a website suddenly stops loading. The good news: renewal is usually one command or a couple of clicks — once you know where and when to do it.

Why certificates expire

A TLS certificate does not last forever. Every certificate has a start and end of validity, and the browser checks both. Once the end date has passed, the browser aborts the connection and shows a warning — to the visitor the site looks broken, even if the server itself is healthy.

A short lifetime is a security measure: it forces regular renewal and limits the damage if a private key is ever leaked. This is why “renewal” is not technically an extension of the same certificate — the issuer always issues a new certificate with a new serial number and validity period.

When to renew

The rule is simple: start at least 30 days before expiry. That leaves enough time if DNS, port 80 or automation lets you down.

The quickest way to see the current validity period is the ssl.ee checker or the command line:

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

Option A: Let's Encrypt and Certbot

If your server runs Linux and you have SSH access, Certbot is the most common solution. The examples below are for Debian/Ubuntu with Nginx; for Apache, swap the package and plugin names.

1. Install Certbot

sudo apt update
sudo apt install certbot python3-certbot-nginx

2. Obtain a certificate

sudo certbot --nginx -d example.com -d www.example.com

Certbot asks for an email address, agreement to the terms and whether to redirect HTTP traffic to HTTPS. It then edits the Nginx configuration and reloads it.

3. Test automatic renewal

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

Certbot normally installs a system timer (certbot.timer) that runs renewal twice a day. Renewal only happens once the certificate has less than 30 days left — so “nothing happened” is a normal and expected result.

4. Add a reload hook

A new certificate only takes effect once the web server reloads it. Create /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh:

#!/bin/sh
systemctl reload nginx
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh

Tip: a DNS-01 challenge is required for a wildcard certificate (*.example.com). A manual (--manual) DNS challenge does not renew automatically — use a plugin or API script for your DNS provider.

Option B: Cloudflare

If your domain is behind the Cloudflare proxy (orange cloud), Cloudflare manages the edge certificate for you. In most cases you do not need to run Certbot on the server at all.

Note: if you use a short-lived Let's Encrypt certificate together with Cloudflare's Full (strict) mode, the origin certificate must also be valid. Renewing the Cloudflare edge certificate does not renew the one on your server.

Option C: cPanel and Plesk

Shared hosting panels usually renew with a single button.

Post-renewal checklist

Renewal is only half the job. Check the following:

  1. The server is serving the new certificate. Compare the dates with openssl s_client or check the result on ssl.ee.
  2. The chain is complete. In Nginx use fullchain.pem, not just the leaf certificate. A missing intermediate causes errors in older clients.
  3. All names are covered. Make sure the SAN list contains both example.com and www.example.com if both must work.
  4. Redirects work. http:// should redirect to https:// in a single hop.
  5. Mixed content is gone. Open the browser console and look for HTTP links to images, scripts or fonts.
  6. Automation is proven. certbot renew --dry-run must finish without errors.

Common failures

Error or symptomCause and fix
too many certificates already issuedLet's Encrypt rate limit. Wait, or use the staging environment for testing (--staging).
Challenge failed / connection refusedPort 80 is blocked by a firewall, DNS points elsewhere, or the virtual host does not respond. Test with curl -I http://example.com/.well-known/acme-challenge/test.
CAA record prevents issuanceThe domain has a CAA record that does not allow this issuer. See the CAA and DNSSEC guide.
unable to get local issuer certificateA missing intermediate. Use the full chain (fullchain.pem).
The certificate is new but the browser still shows the old oneThe web server was not reloaded, or a CDN is caching the old certificate. Check systemctl reload nginx and the CDN settings.
certificate is not yet validThe server or client clock is wrong. Check NTP.

How to stop forgetting

The best certificate is the one you do not have to remember to renew. Set up two things:

The ssl.ee check shows the number of days left and marks a certificate as “expiring soon” when fewer than 30 days remain. You can also add a calendar reminder from the result page.

Check right now whether the renewal took effect and the chain is healthy.

Check a certificate Open PEM decoder

Frequently asked questions

Does renewal interrupt the website?

Issuing a new certificate does not interrupt anything. A brief interruption is possible only during the server reload if the configuration contains an error. Always run nginx -t or apachectl configtest before reloading.

Is a free Let's Encrypt certificate weaker than a paid one?

No. The encryption strength is the same. The difference is the validation type (domain vs organisation validation) and the level of support, not how strongly the connection is encrypted.

Can the same certificate be extended?

No — the issuer always issues a new certificate. “Renewal” means obtaining a new certificate and replacing the old one.

Why does a certificate have several names?

The SAN field (Subject Alternative Name) lists every name the certificate is valid for, such as example.com and www.example.com. If a name is missing, the browser shows a warning on that address.