certbot renew --deploy-hook 'systemctl reload nginx'

Category: Web Servers & Proxies

certbot renew --deploy-hook 'systemctl reload nginx'

Run a command after successful certificate renewal

The deploy hook fires only when a certificate was actually renewed, making it the right place to reload nginx or Apache so they pick up the new files. Renewal keeps the same paths under /etc/letsencrypt/live, so a reload is enough. Add the flag to the timer command or a cron job.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.