How To Install LetsEncrypt SSL With Nginx on CentOS 6

r00t January 6, 2016

letsencrypt-ssl-logo

In this tutorial we will show you how to install and configuration of LetsEncrypt SSL with Nginx on your CentOS 6 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. I will show you through the step by step installation LetsEncrypt SSL in CentOS 6.

Install LetsEncrypt SSL With Nginx on CentOS 6

Step 1. First, you need to enable EPEL repository on your system and start by ensuring your system is up-to-date.

Step 2. Install LEMP server.

A CentOS 6 LEMP server is required. If you do not have LEMP installed, you can follow our guide here.

Step 3. Installing LetsEncrypt SSL.

Clone LetsEncrypt git project to your server:

Then change into the project folder:

Run the commands below to generate a SSL certificate for your website or blogs:

Assuming you did everything right, you should see this:

letsencrypt-ssl-generate

LetsEncrypt puts its keys in this directory /etc/letsencrypt

Step 3. Generating Your SSL Key and CSR.

First create SSL directory to host your SSL certificates.

Then follow the steps below to generate a server key, certificate signing request and self-signed certificate. If you want to install a trusted certificate from a trusted certificate authority, then you’ll need to send copy of the CSR to a certificate authority to generate a trusted certificate.

Create the server private key, run the commands below:

Then run the commands below to generate a certificate signing request key using the server private key to create a SSL certificate:

When you run the above commands, you’ll be prompted to answer few questions. Follow the sample guide below:

  • Common Name: The fully-qualified domain name, or URL, you’re securing.
    If you are requesting a Wildcard certificate, add an asterisk (*) to the left of the common name where you want the wildcard, for example *.idroot.net.
  • Organization: The legally-registered name for your business. If you are enrolling as an individual, enter the certificate requestor’s name.
  • Organization Unit: If applicable, enter the DBA (doing business as) name. If you’re securing a single blog, then type the blog owner’s name here.
  • City or Locality: Name of the city where your organization is registered/located.
  • State or Province: Name of the state or province where your organization is located.
  • Country: The two-letter International Organization for Standardization (ISO) format country code for where your organization is legally registered.

Step 4. Configure the Certificate for Nginx.

You’re ready to install the certificate on Nginx  server. Example configuration for Nginx webserver is as followed:

Save your configuration and restart Nginx webserver:

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

letsencrypt-encrypted-connection

Congratulation’s! You have successfully installed LetsEncrypt SSL. Thanks for using this tutorial for installing LetsEncrypt SSL with Nginx on your CentOS 6 system. For additional help or useful information, we recommend you to check the official LetsEncrypt SSL web site.

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 a best deal!
Share on Google+0Share on Facebook0Tweet about this on TwitterShare on Tumblr0Share on StumbleUpon1Share on Reddit1Pin on Pinterest2
The Tags:

Leave a Comment