Step 1 — Installing Certbot

sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
for ubuntu 20.4:    sudo apt-get install python3-certbot-nginx

Step 2 — Setting up Nginx
At first need to update nginx configuration in /etc/nginx/sites-available/
Please follow the configuration option in

sudo nginx -t
sudo systemctl reload nginx

Step 3 — Allowing HTTPS Through the Firewall

sudo ufw status
sudo ufw allow 'Nginx Full'
sudo ufw delete allow 'Nginx HTTP'
sudo ufw status

Step 4 — Obtaining an SSL Certificate

sudo certbot --nginx -d -d

Step 5 — Verifying Certbot Auto-Renewal

sudo certbot renew --dry-run

More details in

By toihid

Leave a Reply