Nginx Linux

How to enable Nginx HTTPS on Raspbian (Raspberry PI)

HTTPS, the secure version of HTTP, becomes mandatory for websites/apps. HTTPS certificate used to cost money, but now it’s free thanks to Let’s Encrypt.

Enables HTTPS is very simple as well. It only takes 2 steps.

Note that this post also applies to Ubuntu and Debian.

Install certbot

certbot is the commandline tool for Let’s encript. We will Install python-certbot-nginx to get it.

sudo apt-get install certbot python-certbot-nginx

Next simpllly run certbot with sudo. We use sudo because cert bot will download the HTTPS SSL certificate and modify Nginx config file automatically.

sudo certbot --nginx

After answering a few questions, you are good to go. Open your website prefixed with https. You will see a lock icon before you website url.

Automatic Renew

The certificate is valid for 3 months, which is pretty short.

But don’t worry about renewing, it will automatically do this. certbot automatically add a cron job in /etc/cron.d/certbot.



By VarHowto Editor

Welcome to VarHowto!

2 replies on “How to enable Nginx HTTPS on Raspbian (Raspberry PI)”

This is what i get:
user001@raspberrypi:~ $ sudo apt-get install certbot python-certbot-nginx
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package python-certbot-nginx


Comments are closed.