sudo apt install certbot python3-certbot-nginx
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
# For older even setups use python-certbot-nginx
sudo apt-get install python3-certbot-nginx
sudo ufw status
sudo ufw allow 'Nginx Full'
sudo ufw delete allow 'Nginx HTTP'
sudo certbot --nginx -d example.com -d www.example.com