Add LetsEncrypt SSL To Your Magento Store On Ubuntu 22.04 & Apache

If you own a Magento store, you may have heard about SSL certificates and their importance in terms of security and customer trust.

We recommend using our KVM VPS if you need UK Magento hosting.

Our VPS allows full admin access so you can run whichever commands you need.

But why exactly is it so important to have an SSL certificate for your Magento store?

An SSL (Secure Sockets Layer) certificate is a digital certificate that encrypts the connection between a website and a user's web browser.

This encryption helps to protect sensitive information, such as login credentials and financial data from being intercepted by third parties.

In today's online landscape, customers are becoming increasingly aware of the importance of security when shopping online.

Having an SSL certificate not only helps to protect your customers' data but also helps to build trust and credibility with your audience.

In addition to the benefits for your customers, having an SSL certificate can also improve the ranking of your store in search engines.

Google has stated that having an SSL certificate is a ranking factor, so having one can help to improve your store's search engine visibility.

Overall, an SSL certificate is a crucial element for any online store, and it's especially important for a Magento store.

So if you haven't already done so, it's time to consider getting an SSL certificate for your Magento store.

If you're not sure how to get started with Magento, check out our article showing exactly how to install Magento on Ubuntu 22.04.

Below, we show you how to do it!

Installing A LetsEncrypt SSL Certificate For Magento

Installing a Let's Encrypt SSL certificate on Magento 2 with Ubuntu 22.04 and Apache is a simple process that can greatly improve the security of your online store. Here's how to do it:

1. First, make sure that you have a valid domain name and that your Magento 2 installation is set up and functioning properly.

2. Next, you will need to install the Certbot tool, which is used to obtain and install SSL certificates from Let's Encrypt.
To do this, open a terminal and enter the following command:

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install certbot python3-certbot-apache

3. Now that you have Certbot installed, you can use it to obtain an SSL certificate for your domain.

To do this, enter the following command:

sudo certbot --apache -d yourdomain.com

Replace "yourdomain.com" with your actual domain name.

This command will prompt you to enter your email address and agree to the terms of service.

4. Once the SSL certificate has been obtained, it's time to configure your Magento 2 installation to use it.
First, open the Magento 2 backend by navigating to yourdomain.com/admin in your web browser.

5. From here, log in to the Magento 2 backend and go to Stores > Configuration > General > Web.

6. Under the Base URLs section, change the "Use Secure URLs on Storefront" and "Use Secure URLs in Admin" options to "Yes".

7. Under the Base URLs (Secure) section, change the "Secure Base URL for Static View Files" and "Secure Base URL for User Media Files" options to "https://yourdomain.com/".

8. Click the "Save Config" button at the top of the page to save your changes.

9. Finally, you will need to update your Magento 2 database to reflect the changes you just made. To do this, enter the following command in the terminal:

php bin/magento setup:upgrade

This will update your Magento 2 database and complete the installation of your SSL certificate.

Congratulations! Your Magento 2 store is now using a secure SSL certificate from Let's Encrypt.

This will help protect your customers' data and improve your store's security.