How To Install Let’s Encrypt SSL on Ubuntu With Apache

In this tutorial we will show you how to install and configuration of Let’s Encrypt SSL with Nginx on your Ubuntu server. For those of you who didn’t know, LetsEncrypt is a free open certificate authority (CA) that provides free certificates for websites and other services. The service, which is backed by the Electronic Frontier Foundation, Mozilla, Cisco Systems, and Akamai. Unfortunately, LetsEncrypt.org certificates currently have a 3 month lifetime. This means you’ll need to renew your certificate quarterly for now.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Let’s Encrypt SSL on a Ubuntu 16.04 LTS (Xenial Xerus) server.

Install Let’s Encrypt SSL on Ubuntu With Apache

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

1

2

3

apt-getupdate

apt-getupgrade

apt-getinstallgit

Step 2. Install LAMP (Linux, Apache, MariaDB, PHP) server.

A Ubuntu 16.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here.

Step 3. Installing Let’s Encrypt SSL.

Next, run the commands below to clone Let’s Encrypt git project to your server and this will create a folder called letencrypt in the /opt directory:

1

gitclonehttps://github.com/letsencrypt/letsencrypt /opt/letsencrypt

Generating Let’s Encrypt certificates:

1

cd/opt/letsencrypt

Run the commands below to generate a SSL certificate for your domain (example.com) or website:

1

./letsencrypt-auto--apache-dexample.com

You can also use a single certificate on multiple domains and sub-domains, to do that, you’ll have to add them as additional perimeters to the command:

1

./letsencrypt-auto--apache-dexample.com-dwww.example.com

After the installation process finishes successfully a congratulation message is displayed on your console informing you about the expiration date and how you can test the configuration as illustrated on the below screenshots and you should be able to find the generated certificate files at /etc/letsencrypt/live.

Finally, now your domain should be accessible via HTTPS! Check it out at https://yourdomain.com.

Step 4. Set up auto renewal Let’s Encrypt.

Let’s Encrypt certificates are valid for 3 month, but it’s recommended that you renew the certificates every 2 month to allow a margin of error. To renew that certificate, you’ll have to come back into the /opt/letsencrypt directory and run the commands below:

1

./letsencrypt-autorenew

Or you can also setup a cron job to automatically renew your certificate before it expires by editing cron and specifying how often you want to check/renew:

If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!