https://absolutecommerce.co.uk/blog/auto-renew-letsencrypt-nginx-certbot
-
Install certbot with nginx correctly.
-
Log in as root
sudo su -
-
Create the certbot file
touch /etc/cron.d/certbot vim /etc/cron.d/certbot
-
Paste in the following
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
0 */12 * * * root certbot -q renew --nginx