Hi Guys, SSL is the most prominent factor in SEO and digital marketing, even most browsers show it as non-secure when you don’t have SSL installed on your site and your visitors get away. So in this article, I will cover how to install a free SSL certificate if you use any cloud server with Ubuntu OS. I’m taking the example of Digital Ocean.
I have just set up a sub-domain http://nexgi.laestrella.store (and this blog is in the same continuation of that – to understand better please go through How to setup Sub-domain in digital Ocean & Activate SSL)
In this we will learn or do:
- Check Certbot is installed or not.
- What is Certbot?
- How to check if Certbot is already installed?
- Install SSL on domain or sub-domain?
- Install on non-www
- Install on www
- Both non-www and www
- Restart your server
- Test SSL certificate
Step1. Check whether Certbot is installed or not.
What is Certbot?
Certbot is a client that helps install SSL certificates and provides automatic redirection facilities to HTTP –> HTTPS. In simple language, you can say Certbot is software that helps to install SSL certificates.
How to check if Certbot is already installed?
Open your terminal through SSH or putty and type the following command –
certbot
You are getting this No command ‘Certbot’ found – which means you need to install it.
Install it by pressing the following command
sudo add-apt-repository ppa:certbot/certbot
Then
sudo apt-get update
Then Final
sudo apt-get install python-certbot-apache
Step 2. Install SSL on domain or sub-domain
There are three possibilities of this command to install SSL on your domain or sub-domain (Replace your domain/sub-domain from the bold text)
- If you want to install it on non-www
use the command:sudo certbot --apache -d nexgi.laestrella.store
- If you want to install it on www
use the command:sudo certbot --apache -d www.nexgi.laestrella.store
- In case you want to install it on both non-www and www
use the command:sudo certbot --apache -d nexgi.laestrella.store -d www.nexgi.laestrella.store
Then it will ask for redirection – select 1. (No. Redirection – check read marker in below image).
and it will install your SSL certificates.
Just restart your server by pressing the following command –
sudo service apache2 restart
You can test your configuration at (replace bold with your domain/sub-domain)
https://www.ssllabs.com/ssltest/analyze.html?d=nexgi.laestrella.store https://www.ssllabs.com/ssltest/analyze.html?d=www.nexgi.laestrella.store
That’s it – you are ready for testing.
Just hit your domain with HTTPS like in my case
https://nexgi.laestrella.store/
& https://www.nexgi.laestrella.store/
Thanks for any query or support you can contact us.