Getting a Let’s Encrypt certificate onto nginx takes one command. Getting renewal, clean reloads and a modern TLS config right takes a little more thought — and the OCSP stapling stanza you were about to copy from a 2020 tutorial now does nothing but print a warning.
This is the full setup I run on a fresh nginx host: issue the certificate with the nginx plugin, confirm the renewal timer is actually armed, add a deploy hook that reloads nginx without dropping connections, and pair it with a TLS block that scores well and stays boring. It assumes nginx 1.26 on a Debian or Ubuntu box, certbot installed, and DNS already pointing at the server.
Issue the certificate with the nginx plugin
The nginx plugin does two jobs: it proves control of the domain over HTTP-01, and it edits your server block to reference the new certificate. Run it against every hostname the certificate should cover, including the bare and www variants if you serve both.
Free · 4 minutes
Would you survive contact with a determined attacker — or an auditor?
Fourteen questions on access, patching, detection, and recovery — the basics that prevent most real incidents, and the ones most often assumed rather than verified. Banded finding on screen, full sheet by email.
# Issue and install in one step; certbot edits the matching server block
sudo certbot --nginx \
-d example.com -d www.example.com \
--agree-tos -m ops@example.com --no-eff-email
# Prove renewal works end to end without hitting rate limits
sudo certbot renew --dry-run
The --dry-run is the step people skip and regret. It exercises the exact renewal path — authenticator, installer, hooks — against the staging environment, so if your firewall blocks port 80 or a hook is broken, you find out now rather than sixty days from now when the live certificate is days from expiry.
The renewal timer is already there — verify it, don’t cron it
Modern certbot packages ship a systemd timer. You do not need to write a crontab entry, and if you do, you will end up with two things racing to renew the same certificate. The timer fires certbot renew twice a day; certbot itself only acts when a certificate is inside its thirty-day renewal window, so the twice-daily cadence is deliberate jitter, not twice-daily reissuance.
# Confirm the timer exists and is scheduled (apt install: certbot.timer;
# snap install: snap.certbot.renew.timer)
systemctl list-timers 'certbot*' 'snap.certbot*'
# Make sure it's enabled so it survives a reboot
sudo systemctl enable --now certbot.timer
If you want to understand what a systemd timer is actually doing under the bonnet — the service unit it triggers, the OnCalendar schedule, the persistence flag — I have written that up separately in a baseline systemd service and timer setup. The certbot timer is a worked example of exactly that pattern.
A deploy hook that reloads nginx cleanly
A renewed certificate on disk is worthless until nginx re-reads it. The nginx plugin will reload for you when it performs the renewal, but I prefer an explicit deploy hook: it is version-controllable, it runs only after a successful renewal, and it survives you later switching the authenticator. Drop a script into the deploy-hooks directory and every renewal, for every certificate, runs it.
# /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh
#!/bin/sh
# Validate the config first, then reload without dropping connections.
nginx -t && systemctl reload nginx
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh
The nginx -t guard matters: a reload against a broken config is a silent way to keep serving the old certificate while believing you deployed the new one. systemctl reload sends nginx a graceful signal, so in-flight requests finish on the old workers while new workers pick up the fresh certificate — no dropped connections, no restart.
A strong TLS block (and why OCSP stapling is now dead weight)
Here is the part most tutorials get wrong in 2026. For years the advice was to add ssl_stapling on; so the server would fetch and attach the certificate’s OCSP revocation status. Let’s Encrypt has since retired OCSP entirely: it stopped putting OCSP responder URLs in newly issued certificates in May 2025 and switched off its responders on 6 August 2025, moving revocation to Certificate Revocation Lists that browsers consume centrally. The practical consequence is that ssl_stapling on; against a current Let’s Encrypt certificate now produces nginx: [warn] "ssl_stapling" ignored, no OCSP responder URL in the certificate and staples nothing. Leave those directives out. The config below is deliberately without them.
# /etc/nginx/snippets/tls.conf — Mozilla "intermediate", TLS 1.2 + 1.3 only
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305;
ssl_prefer_server_ciphers off; # client preference is fine with modern suites
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m;
ssl_session_tickets off;
# HSTS: two years, opt in to preload separately once you are certain
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
Note that TLS 1.3 cipher selection is not configurable through ssl_ciphers in nginx — that directive governs TLS 1.2 only, and nginx uses OpenSSL’s TLS 1.3 suites automatically. ssl_prefer_server_ciphers off follows the current Mozilla intermediate guidance: with only strong suites on the menu, letting the client choose is fine. Include the snippet from each server block, keep the ssl_certificate and ssl_certificate_key lines certbot wrote, and reload.
If your threat model wants revocation you can actually enforce at the connection — internal services talking to each other, rather than public browsers — stapling is the wrong tool anyway; you want mutual TLS with a private CA you control, where revocation is your own concern rather than a public responder’s.
Confirm it from the outside
Do not trust the reload; check what the server actually presents. Two commands settle it — one for the expiry and chain, one for the full grade.
# Handshake, read the leaf certificate, print validity dates
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
| openssl x509 -noout -dates -issuer
# Full protocol, cipher and header audit
testssl.sh --quiet --protocols --headers https://example.com/
You want TLS 1.2 and 1.3 accepted, everything below refused, the HSTS header present, and an expiry roughly ninety days out on a freshly issued certificate. If testssl.sh flags OCSP stapling as absent, that is now the correct state for a Let’s Encrypt certificate — not a finding to fix. The thing worth fixing, and the thing that actually pages you at 3am, is a renewal that never reloaded nginx. That is exactly what the dry run and the deploy hook exist to prevent.
Free interactive tool
Website compliance checklist
What your site has to do, based on what it actually does
Answer as much or as little as you like — the list builds as you go. Nothing is stored against your name and no email is required.
Everything that applies
Ordered by what to do first: legal requirements you can close quickly, then larger pieces of work, then what is expected rather than required. Not exhaustive, and not a legal audit.
Dated PDF, yours to keep or circulate.
Most technology problems are not technology problems. They are control problems.
The systems exist. The investment has been made. The question is whether leadership can understand, direct, evidence, and sustain what those systems produce. Find out where control exists — and where it only appears to.