How to Install a Free AutoSSL for Your Domain on a LAMP Stack
Leave a comment on How to Install a Free AutoSSL for Your Domain on a LAMP Stack
Securing your website with an SSL certificate is no longer optional — it’s essential. SSL (Secure Sockets Layer) encrypts communication between your server and visitors’ browsers, protecting sensitive data and building trust. You’ve probably noticed the padlock icon in a browser’s address bar; that’s SSL at work.
The good news? You don’t need to pay for SSL. With AutoSSL using CertBot, you can automatically issue and renew SSL certificates for free. In this guide, we’ll show you how to install and configure AutoSSL for your domain on a LAMP stack (Linux, Apache, MySQL/MariaDB, PHP) running on AlmaLinux OS.
Prerequisites
Before we begin, make sure you already have:
- A VPS or server running AlmaLinux OS
- A LAMP stack installed and configured
- An Apache Virtual Host file set up for your domain
If you need help with setting up a LAMP stack or creating a Virtual Host, check out our earlier tutorials.
Step 1: Update Your Server
Start by logging into your server via SSH. Once logged in, update your system’s packages:
dnf update -y
This ensures your server has the latest updates and security patches.
Step 2: Rename Your Virtual Host File
If you created your Apache Virtual Host file with a placeholder domain, update it now. This step is important because CertBot detects the domain names from your configuration.
For example, rename it with this command:
mv /etc/httpd/conf.d/0001-domain.com.conf /etc/httpd/conf.d/0001-yourdomain.com.conf
Replace domain.com with your actual domain name. Skipping this step may cause SSL generation errors.
Step 3: Install CertBot
First, install the EPEL repository (if you haven’t already from a previous setup):
dnf -y install epel-release
Then, install CertBot for Apache:
dnf -y install certbot-apache
Step 4: Generate Your SSL Certificate
Run CertBot with:
certbot
A wizard will guide you through the setup. You’ll be asked to:
- Enter your email address (for renewal notifications)
- Agree to the terms of service
- Select your domain name from the detected list
- Choose whether to redirect all traffic to HTTPS
Once complete, CertBot will install and configure your SSL certificate automatically.
Step 5: Verify SSL Installation
Open your browser and visit your website using https://yourdomain.com. If everything is configured correctly, you’ll see the padlock icon in the address bar.
Your SSL certificate will now auto-renew. CertBot handles this for you, but in the rare event renewal fails, you’ll receive an email notification to take action.
Conclusion
With just a few commands, you’ve successfully installed a free AutoSSL certificate on your LAMP stack using CertBot. This not only secures your site but also boosts visitor trust and helps improve SEO rankings.
At RackNerd, we make it easy to get started with reliable hosting. Whether you’re running a personal site, a blog, or an e-commerce store, our affordable VPS plans provide the performance and flexibility you need. Explore our hosting solutions today at racknerd.com.