sudo apt-get update sudo apt-get install software-properties-common sudo add-apt-repository universe sudo apt-get update sudo apt-get install python3-certbot-nginx sudo certbot --nginx #or sudo certbot --authenticator standalone --installer nginx --pre-hook "service nginx stop" --post-hook "service nginx start" sudo service nginx restart crontab -e 0 0 */1 * * certbot renew