Nginx Certificate Renewal and File Permissions
Renewal is a lifecycle, not just a timer
A certificate eventually expires. Renewal means obtaining a new certificate before that point; deployment means making the serving process use it. A scheduled client can succeed without issuing anything because the certificate is not yet due. Track the certificate actually presented to clients separately from the renewal job and certificate files. Use the CA/client renewal schedule, ideally ACME Renewal Information (ARI) where supported, rather than a fixed day count. Certificate lifetimes and renewal policies change; the October 2026 Let’s Encrypt announcement describes a move to a 64-day default in February 2027.
Check renewal window -> validate -> issue -> validate files-> test Nginx config -> graceful reload -> verify served certificate-> record result and alert on failureUse certificate paths and protect private keys
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;Certbot normally manages these stable live paths, with links to versioned material. The certificate name can differ from the hostname, so confirm the lineage using the approved operator inventory. fullchain.pem contains the leaf followed by intermediates; privkey.pem holds secret key material. The Nginx master must be able to read its key under the selected service identity. Do not copy keys into the public webroot, set them world-readable or recursively change the whole CA directory. If running without root, use a dedicated service identity and carefully reviewed group/ACL and directory traversal permissions that survive renewal.
Rehearse the renewal and deployment separately
certbot certificatescertbot renew --cert-name example.com --dry-runThe first command inventories locally managed certificates; the second normally rehearses against staging and may run configured hooks or temporarily change configuration depending on the authenticator. Review those effects and obtain approval even for a rehearsal. A dry run does not deploy the temporary staging certificate. Check the actual scheduled job and its execution identity rather than assuming a timer exists. A deploy hook runs for a successful renewal, unlike relying on the exit status of renew alone.
#!/bin/shset -eunginx -t && nginx -s reloadThis hook assumes the default executable, config, PID and privileges have been confirmed to refer to the intended service. For a lab or multiple instances, use explicit lab-owned -p and -c parameters; for a service manager use the approved service operation. If validation fails, do not signal reload. Hook exit and reload acceptance still do not prove a new TLS handshake presents the new certificate. Verify after reload and record the served fingerprint and expiry. Review hook ownership, permissions and error handling; never run untrusted scripts as a privileged renewal hook.
Practice
Compare the mock scheduled-renewal outcomes in the offline lab. A zero status with no new certificate should not be confused with a successful issuance or deployment. Explain what happens if configuration validation fails after issuance.
Sources for further reading: https://letsencrypt.org/docs/rate-limits/, https://eff-certbot.readthedocs.io/en/stable/using.html, https://nginx.org/en/docs/http/configuring_https_servers.html, https://nginx.org/en/docs/control.html, https://nginx.org/en/docs/switches.html, https://letsencrypt.org/2026/10/07/64-day-certs.html.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Nginx Certificate Renewal and File Permissions
Plan automated certificate renewal, protect key files, and verify deployment with a safe reload.
Which Certbot file holds the leaf and intermediates?
What should trigger a reload after actual successful renewal?
What should happen if nginx -t fails?
What should monitoring check after reload?
How should the renewal window be chosen?