How to install Let’s Encrypt SSL on CentOS 6

#Introduction

In this tutorial, How to install Let’s Encrypt SSL on CentOS 6. Let’s Encrypt is a free, automated TLS/SSL certificate web server.

Prerequisite

Your server has installed a Web server If it’s not then you can use the command to install a web server

For Nginx

# yum install nginx

For Apache

# yum install httpd mod_ssl

Install LetsEncrypt on Centos 6

curl -o /usr/local/sbin/certbot-auto https://dl.eff.org/certbot-auto
chmod a+x /usr/local/sbin/certbot-auto

Generate a SSL certificate

sudo /usr/local/sbin/certbot-auto certonly \
--manual \
--agree-tos \
--preferred-challenges=dns \
--server https://acme-v02.api.letsencrypt.org/directory \
--email huupv@devopsroles.com \
--domains devopsroles.com

certificated will be available under the folder: /etc/letsencrypt/live/devopsroles.com

/etc/letsencrypt/live/devopsroles.com/fullchain.pem
/etc/letsencrypt/live/devopsroles.com/privkey.pem

Setup a cron job for Let’s Encrypt SSL

# Setting up crontab
crontab -e

# Append the below line to the end of crontab
0 0 * * * /usr/local/sbin/certbot-auto renew --renew-hook "/sbin/service nginx reload" --quiet --agree-tos

HOW TO SETUP NGINX TO USE SSL WITH LETSENCRYPT

For example, as follow

server {
 listen 443;
 ssl on;
 server_name devopsroles.com;
 ssl_certificate /etc/letsencrypt/live/devopsroles.com/fullchain.pem;
 ssl_certificate_key /etc/letsencrypt/live/devopsroles.com/privkey.pem;
 root /etc/nginx/html;
 
}

Conclusion

You have installed Let’s Encrypt SSL on CentOS 6. I hope will this your helpful. Thank you for reading the DevopsRoles page!

About HuuPV

My name is Huu. I love technology, especially Devops Skill such as Docker, vagrant, git, and so forth. I like open-sources, so I created DevopsRoles.com to share the knowledge I have acquired. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

3 thoughts on “How to install Let’s Encrypt SSL on CentOS 6

  1. Very nice Ops article on LE/Certbot. Can’t wait for the Dev part 🙂

    How to write an Ansible playbook and how to test it on your local vagrant environment?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.