How to Install Let’s Encrypt with Apache on Ubuntu

Here are the steps to install

Let's Encrypt with Apache on Ubuntu


Let's Encrypt with Apache on Ubuntu


1. Update the System

Install Apache and enable the SSL module.


// Bash
sudo apt update && sudo apt upgrade -y


2. Install Certbot

Certbot is a free, open-source software that automates the process of obtaining and managing Let's Encrypt certificates.


// Bash
sudo apt install certbot python-certbot-apache


3. Allow HTTPS Through the Firewall

If you have a firewall enabled, you'll need to adjust the settings to allow HTTPS traffic.


// Bash
sudo ufw allow 443


4. Obtain an SSL Certificate

Certbot will guide you through the process of obtaining a Let's Encrypt certificate.


//Bash
sudo certbot certonly --apache


5. Verify Certbot Auto-Renewal

Certbot will automatically renew your certificate every 90 days.


Bash
sudo certbot renew


6. Verifying HTTPS Configuration

To test your HTTPS configuration, you can use the following command:


Bash
curl -v -H 'Host: example.com' https://example.com/


This command will print the response headers from your web server. The response should include the following headers:

Server: Apache/2.4.46 (Ubuntu)

X-Powered-By: PHP/7.4.3

Content-Type: text/html; charset=UTF-8

Note : Check if below points if you are facing issue

If you see these headers, then your HTTPS configuration is correct.

Here are some additional tips for installing Let's Encrypt with Apache on Ubuntu 22.04:

Make sure that your domain name is pointed to your server's IP address.

If you are using a virtual host, make sure that the virtual host is configured correctly.

If you are using a load balancer, make sure that the load balancer is configured correctly.

If you are using a reverse proxy, make sure that the reverse proxy is configured correctly.

If you are using a content delivery network (CDN), make sure that the CDN is configured correctly.

I hope this helps! Let me know if you have any other questions.



Image/Logos Credit - pngwing.com

Contact - info@getcloud.in


Previous Post Next Post

Ads

Ads