Post Date: September 12, 2020
Last Updated: November 16, 2026
Introduction
Securing your WordPress website with an SSL certificate is essential for protecting user information, encrypting website communication and building visitor trust. An SSL/TLS certificate enables HTTPS, ensuring that data exchanged between your website and visitors is encrypted.
Let’s Encrypt is a free Certificate Authority (CA) that provides SSL/TLS certificates for websites. It allows website administrators to secure their websites without purchasing a commercial SSL certificate.
If you are running WordPress on a Linux server using the Bitnami application stack, you can install a Let’s Encrypt SSL certificate using the Lego client and configure Apache to use the certificate.
In this tutorial, we will explain how to generate, install, configure and renew a free Let’s Encrypt SSL certificate for a Bitnami WordPress website running on Linux.
Prerequisites
Before installing the SSL certificate, ensure that you have the following:
- A Linux server with Bitnami WordPress installed.
- Root or sudo access to the server.
- A registered domain name.
- DNS A records pointing to your server’s public IP address.
- Ports 80 (HTTP) and 443 (HTTPS) accessible through your firewall.
- A valid email address for Let’s Encrypt registration.
Note: These instructions cover a traditional Bitnami virtual machine installation using Apache. Commands and certificate paths may differ depending on your Bitnami image and server configuration.
Step 1: Connect to Your Linux Server
First, connect to your Bitnami WordPress server using SSH.
Open your terminal and execute the following command:
ssh bitnami@YOUR_SERVER_IP
Replace YOUR_SERVER_IP with your server’s public IP address.
If you are using a root account, you can connect using:
ssh root@YOUR_SERVER_IP
Check the status of the Bitnami services:
sudo /opt/bitnami/ctlscript.sh status
This command helps identify whether Apache or another web server is running.
Step 2: Verify Your Domain DNS Configuration
Before requesting an SSL certificate, ensure that your domain points to the correct server IP address.
Run the following commands:
dig +short example.com
dig +short www.example.com
Replace example.com with your actual domain name.
Both domain records should resolve to the correct public IP address of your Bitnami WordPress server.
Important: Let’s Encrypt must be able to validate your domain. Make sure your DNS records are configured correctly and that the required validation ports are accessible.
Step 3: Install the Lego Client
Lego is a command-line client that automates the generation and management of Let’s Encrypt SSL certificates.
Connect to your server and execute the following commands to download the latest Linux AMD64 release:
cd /tmp curl -Ls https://api.github.com/repos/go-acme/lego/releases/latest \ | grep browser_download_url \ | grep linux_amd64 \ | cut -d '"' -f 4 \ | wget -i -
Extract the downloaded archive:
tar xf lego_v*_linux_amd64.tar.gz
Create the Let’s Encrypt directory:
sudo mkdir -p /opt/bitnami/letsencrypt
Move the Lego executable into the directory:
sudo mv lego /opt/bitnami/letsencrypt/lego
Verify the installation:
sudo /opt/bitnami/letsencrypt/lego --version
Note: If you are using a different CPU architecture, download the corresponding Lego release instead of the AMD64 binary.
Step 4: Generate a Let’s Encrypt SSL Certificate
Once the Lego client is installed, you can generate an SSL certificate for your WordPress domain.
First, stop the Bitnami services:
sudo /opt/bitnami/ctlscript.sh stop
Execute the following command to request the SSL certificate:
sudo /opt/bitnami/letsencrypt/lego \ --tls \ --email="admin@example.com" \ --domains="example.com" \ --domains="www.example.com" \ --path="/opt/bitnami/letsencrypt" run
Replace the following values:
admin@example.com– Your valid email address.example.com– Your primary website domain.www.example.com– Your www subdomain.
Accept the Let’s Encrypt terms of service when prompted.
After successful domain validation, the certificate and private key will be generated inside:
/opt/bitnami/letsencrypt/certificates/
The generated files will be:
example.com.crt example.com.key
The .crt file contains the SSL certificate, while the .key file contains the private key.
Important: Never share your private key publicly. Keep it protected and accessible only to authorized users.
Step 5: Configure the SSL Certificate in Apache
After generating the certificate, configure Apache to use the newly generated SSL certificate.
For Bitnami Apache installations, the certificate files are generally stored in:
/opt/bitnami/apache/conf/bitnami/certs/
First, back up the existing certificate and key:
sudo cp /opt/bitnami/apache/conf/bitnami/certs/tls.crt \ /opt/bitnami/apache/conf/bitnami/certs/tls.crt.backup sudo cp /opt/bitnami/apache/conf/bitnami/certs/tls.key \ /opt/bitnami/apache/conf/bitnami/certs/tls.key.backup
Replace the existing certificate and key references with symbolic links to the new Let’s Encrypt files:
sudo ln -sf /opt/bitnami/letsencrypt/certificates/example.com.crt \ /opt/bitnami/apache/conf/bitnami/certs/tls.crt sudo ln -sf /opt/bitnami/letsencrypt/certificates/example.com.key \ /opt/bitnami/apache/conf/bitnami/certs/tls.key
Replace example.com with your actual domain name.
Protect the private key:
sudo chown root:root /opt/bitnami/letsencrypt/certificates/example.com.key sudo chmod 600 /opt/bitnami/letsencrypt/certificates/example.com.key
Note: These paths apply to the documented Bitnami Apache stack. Verify your Apache certificate configuration before replacing existing files.
Step 6: Configure HTTP to HTTPS Redirection
After installing the SSL certificate, configure your website to redirect HTTP traffic to HTTPS.
Open the Bitnami Apache configuration file:
sudo nano /opt/bitnami/apache/conf/bitnami/bitnami.conf
Locate the appropriate HTTP virtual host configuration and add the following rewrite directives inside the HTTP virtual host:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*)$ https://example.com/$1 [R=301,L]
Replace example.com with your preferred primary domain.
Save the configuration file and exit the editor.
Important: Ensure the HTTPS virtual host is correctly configured and the certificate covers the requested domain before enabling redirection. If your installation already has HTTPS redirection configured, avoid adding duplicate rules.
Step 7: Restart Apache and Verify the SSL Certificate
After completing the configuration, start the Bitnami services:
sudo /opt/bitnami/ctlscript.sh start
Check the Apache service status:
sudo /opt/bitnami/ctlscript.sh status
You can also check the Apache configuration syntax:
sudo /opt/bitnami/apache/bin/apachectl -t
If the configuration is correct, Apache should return:
Syntax OK
Now open your website in a browser:
https://example.com
Verify the following:
- The website loads successfully over HTTPS.
- The browser displays a secure connection.
- The SSL certificate is valid.
- Both www and non-www domain names work as expected.
- HTTP requests redirect to HTTPS.
Step 8: Configure Automatic SSL Certificate Renewal
Let’s Encrypt certificates have a limited validity period. Therefore, you should configure automatic renewal to prevent your SSL certificate from expiring.

Create a renewal script:
sudo nano /opt/bitnami/letsencrypt/renew-certificate.sh
Add the following commands:
#!/bin/bash sudo /opt/bitnami/ctlscript.sh stop apache sudo /opt/bitnami/letsencrypt/lego \ --tls \ --email="admin@example.com" \ --domains="example.com" \ --domains="www.example.com" \ --path="/opt/bitnami/letsencrypt" renew --days 90 sudo /opt/bitnami/ctlscript.sh start apache
Replace the email address and domain names with your actual details.
Save the file and provide executable permissions:
sudo chmod +x /opt/bitnami/letsencrypt/renew-certificate.sh
Open the root user’s crontab:
sudo crontab -e
Add the following entry to schedule the renewal script:
0 0 1 * * /opt/bitnami/letsencrypt/renew-certificate.sh
This schedules the script to run at midnight on the first day of every month.
Important: Test the renewal process before relying on the scheduled job. Configure error logging and ensure Apache is restarted even if renewal fails. Monitor the certificate expiry date regularly.
Conclusion
Installing a Let’s Encrypt SSL certificate on Bitnami WordPress is an effective way to secure your website without purchasing a commercial SSL certificate.
By following the steps in this guide, you can generate a certificate, configure Apache, enable HTTPS redirection and schedule certificate renewal on your Linux server.
Regular SSL certificate monitoring and renewal are important for maintaining website security and ensuring uninterrupted HTTPS access.
If you encounter SSL installation or configuration issues, verify your DNS settings, firewall rules, Apache configuration and certificate file permissions before troubleshooting further.
Frequently Asked Questions (FAQs)
1. Is Let’s Encrypt SSL certificate free for Bitnami WordPress?
Yes. Let’s Encrypt provides free SSL/TLS certificates that can be installed on Bitnami WordPress servers. You can use these certificates to enable HTTPS and encrypt communication between your website and visitors.
2. How long is a Let’s Encrypt SSL certificate valid?
Let’s Encrypt certificates have a validity period of 90 days. You should configure automatic renewal and regularly monitor the certificate expiry date to avoid HTTPS connection errors.
3. How can I fix a Let’s Encrypt SSL certificate installation error?
First, check whether your domain DNS records point to the correct server IP address. Then verify that ports 80 and 443 are accessible, Apache is configured correctly, and the certificate and private key files are valid. Check the server logs for additional error details.
Related Articles
How to Install / Update WordPress Automatically Without Using FTP
Need Help Installing an SSL Certificate on Your WordPress Website?
Are you looking to secure your Bitnami WordPress website with a free Let’s Encrypt SSL certificate?
Pheonix Solutions provides reliable WordPress hosting, SSL certificate installation, Linux server administration, website management, and technical support.
Our team can help you install and configure SSL certificates, enable HTTPS redirection, troubleshoot Apache SSL configuration issues, automate certificate renewal, and improve your website security.
Get in touch with our team to discuss your WordPress security requirements and get professional technical assistance.
