DEV Community

slashtechno
slashtechno

Posted on • Updated on

Easily Use SSL on Nginx With Certbot

Install Certbot

Full instructions are here

To install Certbot, you should have Snap installed as well. For instructions, follow this tutorial.

Then, update snap
sudo snap install core; sudo snap refresh core
Finally in order to install Cerbot, run the follwing
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot

Set up Nginx

To use Certbot you should have server_name in your Ngnix config. For example, this is a sample of how my Nginx config file looked like before Certbot.

server{
        root /home/pi/website;
        server_name example.slashtechno.com;
}
Enter fullscreen mode Exit fullscreen mode

Once you have the config set up properly, restart nginx. On most systems it will be the following command.
sudo service nginx restart

Using Certbot

Running Certbot for use with Nginx

sudo certbot --nginx

Removing a certificate

sudo certbot delete

Top comments (0)