How To Install Let’s Encrypt SSL for Nginx on Ubuntu 18.04 LTS

Install Let’s Encrypt SSL for Nginx on Ubuntu 18.04 LTS

In this tutorial we will show you how to install Let’s Encrypt SSL for Nginx on Ubuntu 18.04 LTS. For those of you who didn’t know, Let’s Encrypt 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, 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 for Nginx on Ubuntu 18.04 LTS server.

Install Let’s Encrypt SSL for Nginx on Ubuntu 18.04 LTS Bionic Beaver

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

Step 2. Installing Let’s Encrypt SSL on Ubuntu 18.04 LTS.

First, Add certbot to the repository:

Step 3. Setup Domain Name to Server Block.

Certbot automates the configuration of SSL for Nginx by looking for the server_name directive that matches the domain you’re requesting a certificate for. If you have already configured the server_name directive previously, you can skip to Step 4.

Step 4. Generate Certs using Certbot.

First, We can now generate certs using certbot. Replace with your own domain:

Enter an email address where you can be contacted in case of urgent renewal and security notices:

Press a and ENTER to agree to the Terms of Service:

Press n and ENTER to not share your email address with EFF:

If successful, you will be able to choose between enabling both HTTP and https access or forcing all requests to redirect to https:

Press 2 and ENTER to redirect HTTP traffic to HTTPS:

Step 5. Set up auto-renewal Let’s Encrypt.

Let’s Encrypt certificates are valid for 3 months, they need to be checked for renewal periodically. Certbot will automatically run twice a day and renew any certificate that is within thirty days of expiration:

Congratulations! You have successfully installed Let’s Encrypt. Thanks for using this tutorial for installing Let’s Encrypt SSL on Ubuntu 18.04 LTS Bionic Beaver system. For additional help or useful information, we recommend you to check the official Let’s Encrypt website.

VPS Manage Service Offer
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 the best deal!