Install free SSL certification using CertBot on Ubuntu Apache VPS.

Free SSL Certificate using CertBot Apache on Ubuntu prashantsuthar.com

So many people are looking for FREE SSL for their website. Today we are going to explore How to install FREE SSL Certificate using CertBot on Ubuntu Apache server.

Before start article we need some prerequisite for this article.

  1. SSH with sudo root user and installed Apache on VPS ( How to install Linux Apache, MySQL with PHPMYADMIN, PHP (LAMP) on Ubuntu ) .
  2. Domain name A record with WWW and without WWW point to the VPS public IP. (How to point Domain name to VPS ).
  3. Virtual Host created on VPS. ( How to Setup Virtual Hosts on Ubuntu )

This tutorial will use /etc/apache2/sites-available/example1.com.conf
as an example and domain name example1.com

step 1: Install CertBot / Add a CertBot PPA

You need to add CertBot PPA to your list of repositories.

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

step 2: Get and Install certificates.

sudo apt-get install certbot python3-certbot-apache
sudo certbot --apache

Run this command to get a certificate and have Certbot edit your Apache configuration automatically to serve it, turning on HTTPS access in a single step.

 


sudo certbot --apache -d example1.com -d www.example1.com

This runs certbot with the –apache plugin, using -d to specify the names you’d like the certificate to be valid for. If you are using first time CertBot in server then its promt for an email address. After that CertBot ask for some HTTPS configuration. Which output is similar to this.

After choosing the option you will get confirmation SSL installed on your server.

Step 3: Verify CertBot Auto-Renewal

Let’s Encrpt’s certificates are only valid for 90 days. But don’t worried set cron tab script to /etc/cron.d  this script run twice a day to renew automatically renew any certificate. If you want to test renewal process. Let’s do dry run test with CertBot.

 


sudo certbot renew --dry-run

If there is no any error. You installed the Let’s Encrypt client certbot, downloaded SSL certificates for your domain, configured Apache to use these certificates, and set up automatic certificate renewal. You can find full documents from here.

I hope you like this article. Keep visiting my website for more upcoming articles. If you need any help with Install free SSL certification using CertBot on Ubuntu Apache VPS  you can contact me. You can ask me questions in comments also. You can connect me on social media as well links are below in the footer section. Keep connected. Happy Coding.

Prashant Sutharhttps://prashantsuthar.com
My self Prashant Suthar, I had experience worked with NodeJS, Core PHP, WordPress, CodeIgniter, Shopify, Prestashop, Opencart and many frameworks. I had some basic knowledge about server setup and maintenance. I also worked with third parties APIs like Twillio audio,video, SMS API, FB messenger API and many more. I am working as team lead & sr. developer in Ahmedabad, GJ, IN.

Comments

Similar Articles