DevOps
Getting Free SSL Certificates with Certbot - The No-Stress Guide! π
Secure your website with free SSL certificates using Certbot on Ubuntu & Nginx. A simple step-by-step guide with troubleshooting tips. Perfect for beginners! [2024]

Hey there! Tired of that annoying "Not Secure" warning on your website? Let's fix that! I'll show you how to get free SSL certificates using Certbot on Ubuntu. Trust me, it's way easier than it sounds!
Before you run Certbot
Your domainβs DNS A/AAAA records must point at this server, and something must answer on port 80 (usually Nginx) so Letβs Encrypt can complete HTTP validation.
What We're Gonna Do π―
- Get that sweet HTTPS working
- Set up auto-renewal (because who wants to do this manually?)
- Make your site secure and professional-looking
Before We Start... π
Make sure you've got:
- Ubuntu server (duh!)
- Nginx is up and running
- A domain pointing to your server
- 5 minutes of free time
Let's Do This! π
1. Installing Certbot
First, let's get the tools we need. Copy-paste these commands (I'll explain what they do):
# Update your system
sudo apt update
# Install Certbot and its Nginx plugin
sudo apt install certbot python3-certbot-nginx
2. Getting Your Certificate π
Here comes the fun part! Just run:
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
Replace yourdomain.com with your actual domain (I know, obvious, but had to say it! π
)
Certbot will ask you some questions:
- Email address? (for renewal notifications - they won't spam you)
- Agree to terms? (just type 'A' for agree)
- Share email? (up to you - I usually say no)
- Redirect HTTP to HTTPS? (definitely, yes! Type 2)
3. Testing It Out π§ͺ
Visit your site with https:// - you should see that lovely padlock! π
Auto-Renewal (The Set-It-and-Forget-It Part) β°
Certbot sets up auto-renewal by default (neat, right?). But let's make sure it's working:
sudo certbot renew --dry-run
If you see no errors, you're golden! Certificates will auto-renew when they're about to expire.
Troubleshooting (When Things Go South) π
Having issues? Don't panic! Here are some common hiccups:
"Something went wrong."
- Check if Nginx is running:
sudo systemctl status nginx - Make sure your domain points to your server
- Check Nginx config:
sudo nginx -t
"Unable to bind to port 80."
- Something's probably using port 80
- Check with:
sudo lsof -i :80 - Stop whatever's hogging it
Pro Tips! π‘
- Keep your email address updated (so you don't miss renewal notifications)
- Don't mess with the renewal scripts (they know what they're doing)
- Test renewal monthly if you're paranoid (like me!)
You're All Set! π
Congrats! You've just:
- Secured your site
- Made it look professional
- Improved your SEO (Google loves HTTPS!)
- Probably learned something new!
Need More Help? π
If something's not working:
- Check Certbot logs:
sudo certbot --logs - Visit Certbot's official docs
- Or drop a comment below - I'll try to help!
Remember: Everyone struggles with SSL at first. If something goes wrong, take a deep breath, grab a coffee β, and try again!
P.S. If this helped you out, share it with other devs! Sharing is caring! π€
Written by Shashikant Dwivedi
Engineer, occasional writer, full-time noticer. Based in Prayagraj, India. New essays land roughly twice a month.
Keep reading
Adjacent essays.

DevOps
Setting Up Nginx as a Reverse Proxy - The Easy Way! π
Oct 25, 2024 Β· 2 min

DevOps
How To Install And Configure Nginx On Your Linux Server
Sep 14, 2024 Β· 4 min

DevOps
π PostgreSQL Installation Guide for Ubuntu: Your Complete Walkthrough!
Jan 1, 2025 Β· 2 min
The newsletter
New articles in your inbox.
Occasional articles on engineering, tooling, and software development practices. No marketing, no fluff β just the article, when it's ready.
Unsubscribe with one click. Your email never leaves the list.