Automating Let’s Encrypt renewal on a single‑node web server without downtime
Let’s Encrypt certificates expire every 90 days. On a single‑node web server the usual approach is to run certbot renew from cron and reload the web service. The trick is to avoid any traffic loss while the new cert is in place. Below is a minimal, production‑ready recipe that works with Apache, Nginx, or any systemd‑managed web server.
1. Install Certbot and the web‑root plugin
# Debian/Ubuntu
sudo apt-get install certbot python3-certbot-nginx # or python3-certbot-apache
# RHEL/CentOS
sudo dnf install certbot python3-certbot-nginx
The nginx or apache plugin automatically configures the web‑root challenge and reloads the server after a successful renewal.