Nginx + Certbot on Ubuntu
Automatically enable HTTPS on your website with EFF’s Certbot, deploying Let’s Encrypt certificates. This tutorial shows you how to install Certbot w/ Nginx on Ubuntu.
Table of Contents
To install certbot
sudo apt-get updatesudo apt-get install software-properties-commonsudo add-apt-repository universesudo add-apt-repository ppa:certbot/certbotsudo apt-get updatesudo apt-get install certbot python-certbot-nginxAdd/Update your server block
Make sure your Nginx server blocks match your domain+subdomains:
server_name example.com www.example.com;
If not, edit your Nginx config:
vi /etc/nginx/sites-available/defaultAnd then restart your Nginx server:
sudo service nginx restartAdd certificate
Running this command will go through your Nginx config and add certificate locations to appropriate blocks:
sudo certbot --nginxAllow HTTPS through the firewall:
sudo ufw allow 'Nginx Full'Related snippets
- Can’t Redeem DOOM: The Dark Ages in NVIDIA App? Try This Quick Fix May 13, 2025 Trouble claiming DOOM: The Dark Ages in the NVIDIA app? Follow this quick network fix that solves the redemption glitch in minutes.
- Custom Scrollbar Selectors January 23, 2024 Customize scrollbar styles to perfectly match your unique aesthetic.