DEV Community

Erik Thiart
Erik Thiart

Posted on

How to install Let's Encrypt on Nginx running Ubuntu 16.04

Install

$ sudo apt-get update
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install python-certbot-nginx
Enter fullscreen mode Exit fullscreen mode

Get Started
Certbot has a Nginx plugin, which is supported on many platforms, and certificate installation.

$ sudo certbot --nginx
Enter fullscreen mode Exit fullscreen mode

If you're feeling more conservative and would like to make the changes to your Nginx configuration by hand, you can use the certonly subcommand:

$ sudo certbot --nginx certonly
Enter fullscreen mode Exit fullscreen mode

Automating renewal
The Certbot packages on your system come with a cron job that will renew your certificates automatically before they expire. Since Let's Encrypt certificates last for 90 days, it's highly advisable to take advantage of this feature. You can test automatic renewal for your certificates by running this command:

$ sudo certbot renew --dry-run
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
dineshrathee12 profile image
Dinesh Rathee

LetsEncrypt have revoked around 3 million certs last night due to a bug that they found. Are you impacted by this, Check out ?

DevTo
[+] dev.to/dineshrathee12/letsencrypt-...

GitHub
[+] github.com/dineshrathee12/Let-s-En...

LetsEncryptCommunity
[+] community.letsencrypt.org/t/letsen...