In today’s digital world, security is non-negotiable. Whether you're running a personal blog or managing a business website, encrypting traffic between your server and users is essential. That’s where Let’s Encrypt comes in — a free, automated certificate authority that simplifies securing your Apache web server with HTTPS.
In this tutorial, you’ll learn how to install and configure an SSL certificate for Apache using Let’s Encrypt on Debian 12.
Before diving into the process, make sure you have:
yourdomain.com
) pointed to your server’s IPCertbot is the official tool to obtain and renew Let’s Encrypt certificates
sudo apt update
sudo apt install certbot python3-certbot-apache -y
Make sure your Apache virtual host file is correctly configured for your domain. For example
sudo nano /etc/apache2/sites-available/yourdomain.com.conf
Ensure it includes a ServerName directive
ServerName yourdomain.com
ServerAlias www.yourdomain.com
Then enable the virtual host
sudo a2ensite yourdomain.com.conf
sudo systemctl reload apache2
To additionally let in HTTPS traffic, allow the “WWW Full” profile and delete the redundant “WWW” profile allowance
sudo ufw allow 'WWW Full'
sudo ufw delete allow 'WWW'
Your status should now look like this
sudo ufw status
Output
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
WWW Full ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
WWW Full (v6) ALLOW Anywhere (v6)
Run the following Certbot command to request and install your certificate
sudo certbot --apache
Certbot will prompt you to choose the domain and whether you want to redirect HTTP to HTTPS. Choose to redirect it's the most secure option.
Let’s Encrypt certificates are valid for 90 days, but Certbot can automatically renew them.
To check renewal:
sudo certbot renew --dry-run
A systemd timer runs automatically, but it’s good practice to verify it’s working.
Visit https://yourdomain.com in your browser you should see the padlock icon next to the URL. You can also test your setup using SSL Labs’ SSL Test.
Congratulations! Your Apache server on Debian 12 is now secured with a free SSL certificate from Let’s Encrypt. Not only have you protected your users’ data, but you've also improved your SEO rankings and gained visitor trust.
At Technology Elevator, we don't just write guides — we build solutions. Whether you're setting up secure servers or launching full-scale web and mobile applications, our experts are here to elevate your tech.
🔥 What we offer:
👉 Ready to scale securely and smartly?
Contact us today and let's secure your success!