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)

Hi!I'm Noah!

Hey, my name is Noah and I’m the one who set up this ad!


My job is to get you to join DEV, so if you fancy doing me a favor, I’d love for you to create an account.
Β 
If you found DEV from searching around, here are a couple of our most popular articles on DEV: