Managing a Let’s Encrypt certificate is not finished when issuance succeeds. This playbook covers the complete lifecycle: selecting a validation method, issuing and deploying a certificate, automating renewal, monitoring expiry and job health, rotating keys, and recovering safely from an expired or revoked certificate.
Overview
An operational certificate workflow has five parts: issuance, deployment, renewal, verification, and recovery. Treat them as one system rather than as a single Certbot command. A certificate can be valid at the ACME service while the web server is still presenting an older file, a load balancer may use a different certificate, or a renewal job may be failing silently.
Start by recording every hostname covered by each certificate, the ACME account responsible for it, the validation method, the private-key location, the deployment target, and the command or timer that performs renewal. This inventory is especially important after a hosting migration, DNS provider change, CDN rollout, or expansion from one server to several.
For a conventional web server, HTTP-01 validation is often the simplest choice when the site can serve a temporary file over HTTP. DNS-01 is generally the more suitable workflow for wildcard names or environments where the ACME service cannot reach the web server. Keep DNS API credentials narrowly scoped and outside the web root. Test changes against the Let’s Encrypt staging environment before using production issuance; staging workflows are covered in our guide to staging certificates.
Certificate files also have distinct jobs. The server normally needs the certificate, the intermediate chain, and the private key, commonly represented by cert.pem, chain.pem, fullchain.pem, and privkey.pem. Confirm which file your server expects rather than guessing; see this certificate-file reference.
What to track
Issuance and deployment
Record the exact issuance command, account identity, challenge type, domain list, and deployment hook. Examples below are patterns, not universal commands; check the installed client’s help output before placing them in production.
sudo certbot certonly --webroot -w /var/www/html -d example.com -d www.example.com
sudo certbot renew --dry-run
With a DNS plugin, the command and credentials depend on the provider. Avoid copying an old provider snippet into a new environment without checking the provider’s current API instructions and the ACME client’s supported flags. For other clients, an equivalent acme.sh workflow might look like acme.sh --issue -d example.com -w /var/www/html, while lego commonly uses a command such as lego --email [email protected] --domains example.com --http run. Treat these as illustrative syntax and validate them with the current client documentation.
After renewal, reload the service only after the new files have been written successfully. A Certbot deploy hook can express that dependency:
sudo certbot renew --deploy-hook "systemctl reload nginx"
For Apache, substitute the appropriate service reload and test the configuration before reloading. If a certificate is installed on a CDN, reverse proxy, or load balancer, monitor that endpoint separately from the origin server. Our Cloudflare TLS guide explains why edge and origin certificates must be considered independently.
Expiry, job health, and endpoint state
Track at least four signals:
- Endpoint expiry: inspect the certificate actually served to users, including every public hostname and load-balancer address.
- Renewal eligibility: check whether the local client can renew the certificate without interaction.
- Job execution: alert when a systemd timer, cron job, container task, or deployment hook has not run successfully.
- Configuration consistency: compare the certificate, chain, key, and expected hostnames across all nodes.
A Prometheus-style alert can monitor the remaining lifetime exposed by your certificate exporter:
groups:
- name: tls
rules:
- alert: TLSCertificateExpiringSoon
expr: probe_ssl_earliest_cert_expiry - time() < 14 * 24 * 3600
for: 30m
labels:
severity: warning
annotations:
summary: "TLS certificate expires within 14 days"
description: "Check renewal, deployment, and the certificate served by {{ $labels.instance }}."
The threshold is an operational choice, not a universal rule. Use a longer warning window when approvals, maintenance windows, or manual deployment steps are involved. Pair expiry alerts with a failed-renewal alert so the team knows whether the problem is time, automation, or service configuration.
Automation service and schedule
Many Certbot installations provide a systemd timer. Inspect rather than assume:
systemctl list-timers | grep -i certbot
systemctl status certbot.timer
sudo certbot renew --dry-run
If your environment uses cron, keep the task quiet on success but observable on failure:
17 3 * * * root certbot renew --quiet --deploy-hook "/usr/local/sbin/reload-web" || /usr/local/sbin/notify-tls-failure
The notification command should include the hostname, machine, error output, and a link to the relevant runbook. Email, SMS, or incident-management delivery is acceptable; the important property is that an alert reaches an actively monitored channel and has an owner.
Cadence and checkpoints
Use the following repeatable schedule:
- Every day: let automated checks inspect public endpoint expiry and renewal-job failures. Avoid relying on a person to remember certificate dates.
- Weekly: review failed jobs, deploy-hook errors, DNS challenge failures, and differences between origin and edge certificates.
- Monthly: run a controlled dry run, confirm that alerts reach the intended recipients, review ACME account access, and remove retired hostnames from automation.
- Quarterly: test the recovery procedure, verify backups and permissions, review key-rotation decisions, and check whether hosting, CDN, DNS, or firewall changes altered the validation path.
- After every infrastructure change: validate DNS, ports, challenge paths, certificate deployment, redirects, and all public names before closing the change.
Keep the renewal checklist short enough to use during an incident: identify the affected hostname; inspect the endpoint certificate; review the client log; test DNS and HTTP reachability; run a dry run; deploy or reload; verify the served chain; and document the cause. The broader renewal automation guide provides additional patterns for timers, cron, and monitoring.
How to interpret changes
A failed renewal is usually a symptom of an environmental change. An HTTP-01 error should prompt checks for DNS resolution, port 80 reachability, redirects, firewall rules, reverse-proxy routing, and the expected challenge directory. A DNS-01 error calls for checks of the TXT record name, propagation, delegated DNS, API credentials, and the permissions granted to the DNS token. Do not repeatedly retry production issuance while investigating; use staging where appropriate and review current rate-limit guidance before changing a high-volume workflow.
If the client reports success but browsers show an old certificate, inspect the endpoint with a TLS client or certificate checker, then identify which layer terminates TLS. The origin may be updated while a CDN, load balancer, or second server still serves the previous certificate. Conversely, an edge certificate may be current while the origin certificate has expired, producing failures in a strict end-to-end configuration.
Key rotation is separate from certificate renewal. Plan a new private key when policy requires it, when moving to a new host, or whenever compromise is suspected. Generate the replacement with restrictive permissions, issue a certificate using the new key, install it, reload the service, and verify the public key changed as intended. If a private key may have been exposed, stop treating ordinary renewal as sufficient: replace the key, revoke the affected certificate when appropriate, remove the compromised secret, and audit logs and access paths. Follow current Let’s Encrypt and ACME client guidance for revocation behavior.
When to revisit
Revisit this playbook whenever a certificate approaches the team’s warning threshold, a renewal fails, a hostname or DNS record changes, or a server, CDN, hosting provider, or reverse proxy is replaced. Also review it on a monthly or quarterly schedule even when everything appears healthy; successful renewals can conceal an unmonitored hostname or a redundant node that was never updated.
For an expired certificate, use this recovery sequence:
- Confirm the affected hostname and the certificate actually served to clients.
- Check system time, DNS, firewall rules, challenge routing, disk space, permissions, and the ACME client log.
- Run a dry run or staging test where it will not add production pressure.
- Issue or renew the certificate, install the correct full chain and private key, and reload the TLS-terminating service.
- Verify every public endpoint, redirect, hostname, and monitoring check.
- Record the root cause and add a preventive alert, test, or ownership assignment.
When editors maintain this article or related runbooks, refresh client command examples and supported flags after client releases change syntax; update DNS provider API snippets and webhook instructions after provider changes; review Let’s Encrypt rate-limit and policy notes when official guidance changes; and revise thresholds and alert wording after hosting or CDN deployments. For broader outage preparation, use the HTTPS troubleshooting checklist and the website migration checklist.