Certbot Docs: https://certbot.eff.org/docs/
Digital Ocean Tutorial: https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
- Install Certbot:
$ sudo add-apt-repository ppa:certbot/certbot
- Update package list:
$ sudo apt-get update
- Install Certbot Nginx package:
$ sudo apt-get install python-certbot-nginx
- Update Nginx config file:
$ sudo nano /etc/nginx/sites-available/default
- Find
server_name
line, replace_
with your doman (simple domain and www domain).
server_name example.com www.example.com;
- Verify configuration syntax:
$ sudo nginx -t
- Reload Nginx:
$ sudo systemctl reload nginx
- Check UFW firewall status:
$ sudo ufw status
(If it is not active, follow these steps to activate).
- Update UFW to allow https traffic:
$ sudo ufw allow 'Nginx Full'
$ sudo ufw delete allow 'Nginx HTTP'
- Get a Certbot certificate:
$ sudo certbot --nginx -d example.com -d www.example.com
(You may go through a series of prompts, agreements, email signup, etc.
-
Check your domain with an https call:
https://example.com
. If it makes secure connection, you're good to go. -
Verify Certbot autorenewal:
$ sudo certbot renew --dry-run
Good Job!