ubuntu
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]
Shashikant Dwivedi
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! π€
Keep reading
Adjacent essays.
How to Install Redis on Ubuntu Server and Enable Remote Access
Step-by-step guide to installing Redis on Ubuntu server, configuring for remote connections, and securing with passwords. Perfect for beginnersβget started in minutes!
Read article
Creating PostgreSQL Users: A Quick Setup Guide π
Learn how to create a PostgreSQL superuser securely with our quick and easy guide. Follow step-by-step instructions to set up a superuser in just minutes!
Read article
π PostgreSQL Installation Guide for Ubuntu: Your Complete Walkthrough!
Learn how to install and configure PostgreSQL on Ubuntu with our beginner-friendly, step-by-step guide! Get your database server up and running in just 15 minutes.
Read article