Install Free SSL(Let’s Encrpt) Hostinger – Shared Web-hosting
With Recent update, hostinger broke the Free SSL by Let’s Encrpt.
Their article seems to be outdated and have a deprecation notice.
Don’t worry, We have an alternative.
What you’ll need
Before you begin this guide you’ll need the following:
- Hostinger Premium or Business account.
- SSH client.
Please follow the below link which explains how to add SSH KEYS TO THE HOSTINGER
Step 2 – Installing ACME client and Composer
We will use ACME client written in PHP and composer to generate Let’s Encrypt SSL certificate.
First of all, you will have to connect to your hosting account via SSH and download all required components. If you are running macOS or Linux, you can use terminal to connect via SSH, Windows users can take advantage of Putty SSH client.
- Connect to your hosting account using SSH information from Step 1.3. In our example, it would be:
ssh -p 65002 user@userip - Clone acme client from github repository. Cloning can be done by executing the following command:
git clone https://github.com/Neilpang/acme.sh.git
- Move to the directory
cd ./acme.sh
- Install
./acme.sh –install –force
Use --force since hostinger doesn't have run cron from terminal. This would bypass the check's
Step 3 – Issue a cert
Scenario 1: Single domain.
./acme.sh --issue -d example.com -w /home/user/public_html
Scenario 2: Multiple domain.
./acme.sh --issue -d example.com -d www.example.com -w /home/wwwroot/example.com
You must point and bind all the domains to the same webroot dir: /home/user/public_html
.
Once the above command’s execution is complete, you will be treated with four file’s[Fri Oct 25 11:09:20 UTC 2019] Your cert is in /home/user/.acme.sh/example.org/example.org.cer
[Fri Oct 25 11:09:20 UTC 2019] Your cert key is in /home/user/.acme.sh/example.org/example.org.key
[Fri Oct 25 11:09:20 UTC 2019] The intermediate CA cert is in /home/user/.acme.sh/example.org/ca.cer
[Fri Oct 25 11:09:20 UTC 2019] And the full chain certs is there: /home/user/.acme.sh/example.org/fullchain.cer
Copy the cert contents from /home/user/.acme.sh/example.org/example.org.cer and paste it to Certificate (CRT) in Custom SSL of Hostinger Hpanel#cat /home/user/.acme.sh/example.org/example.org.cer
Copy the contents from cert key in home/user/.acme.sh/example.org/example.org.key and paste it to Private key: (KEY) in Custom SSL of Hostinger Hpanel#cat /home/user/.acme.sh/example.org/example.org.key
Copy the contents from example.org.key and paste it to Private key: (KEY) in Custom SSL of Hostinger Hpanel#cat /home/user/.acme.sh/example.org/example.org.key
Copy the contents from intermediate CA cert in /home/user/.acme.sh/example.org/ca.cer and paste it to Certificate authority bundle (CABUNDLE) in Custom SSL of Hostinger Hpanel#cat /home/user/.acme.sh/example.org/ca.cer
Finally submit,
Your SSL Certificate is applied