DEV Community

StuartCreed
StuartCreed

Posted on • Updated on

How to add a free SSL to an NGINX server on Ubuntu

In your terminal:

sudo app-get install python3-certbot-nginx

sudo certbot --nginx -d websitename.com -d www.websitename.com

When prompted select "2: redirect":

Alt Text

The website will now show as secure.

This expires every 90 days. Add this to a crontab so that it runs everyday to avoid this expiring. To do this run the following in your terminal:

crontab -e

Paste in the following

0 12 * * * /usr/bin/certbot renew --quiet

Top comments (0)