Logo

dev-resources.site

for different kinds of informations.

Get a free SSL certificates for your shared-hosting cPanel domain!

Published at
11/30/2024
Categories
ssl
namecheap
letssencrypt
free
Author
saad4software
Categories
4 categories in total
ssl
open
namecheap
open
letssencrypt
open
free
open
Author
13 person written this
saad4software
open
Get a free SSL certificates for your shared-hosting cPanel domain!

Providers like Namecheap give a free SSL certificate with one-year validation for every domain and subdomain you create! it is awesome!
Yet, after finishing this one year, or creating too many subdomains (like I do 😅), you will have to pay 11$ up to 186$ for a single domain, 1 year, SSL certificate!
This article will walk you through using Let's Encrypt's certbot to get a free 3 months SSL certificate for domains without shell access (like shared access domains)

We will cover

  • installing certbot on Ubuntu Linux.
  • generate SSL challenge and pass it to namecheap domain.
  • install the certificates manually using domain cpanel

Install certbot

it is a straightforward operation, Ubuntu comes with snap so

sudo snap install --classic certbot
Enter fullscreen mode Exit fullscreen mode

please check this for other operating systems. simple and easy

Generate the free SSL certificate

looking at my account, I found this subdomain hna.xxx.net

Expired SSL certificate

let's generate a new certificate for this domain. Issue this command at the terminal (after installing chatbot of course)

sudo certbot certonly --manual --preferred-challenges http -d hna.xxx.net -d www.hna.xxx.net
Enter fullscreen mode Exit fullscreen mode

Certbot will ask you to fulfill the HTTP challenge by creating a file on your domain or subdomain with a certain value

http challenge

great, let's create this local file called 2QIY-W... with that special value

Challenge file

it is time to upload it to the website directory at .well-known/acme-challenge, simply use the cpanel file manager to reach that folder, or create it if it doesn't exist

Challenge directory

in my case, I was able to find the .well-known/ folder, but I created the acme-challenge/ folder manually

upload the challenge file, and press enter in our terminal to continue the challenge process

Uploading the challenge file

in my case, it requested uploading another file, number of challenge files is equal to the number of domains we want to create a new certificate for, in our case, we used hna.xxx.net, and www.hna.xxx.net. Usually, I would add the backend domain to the same certificate, somewhat like backend.hna.xxx.net, but hna is a full-stack Laravel project, so there is no need for that.

Uploading the other challenge file

after uploading all challenge files to the requested directories, we can press enter in our terminal to continue the process

Generating the certificates

great job! we have the certificates now! all we need to do is to upload them to our domain

Install the certificate using CPanel

We have the certificates in /etc/letsencrypt/live/ directory, which is a highly secured folder, so I would recommend copying the certificate and its private key out of it.

sudo cp /etc/letsencrypt/live/hna.xxx.net/privkey.pem /home/user/Desktop
sudo cp /etc/letsencrypt/live/hna.xxx.net/cert.pem /home/user/Desktop
Enter fullscreen mode Exit fullscreen mode

and after copying them, let's make them easier to move around by changing their permissions

cd /home/user/Desktop
sudo chmod 777 cert.pem
sudo chmod 777 privkey.pem
Enter fullscreen mode Exit fullscreen mode

nice, but not secure, so be aware to delete those files after uploading them to the website. moving to CPanel now

look for the SSL/TLS in the security section

CPanel security section

we will start by uploading the private key, by choosing Generate, view, upload, or delete your private keys.

Upload the private key

scroll down to "upload key" section, make sure to select the private key and click on "upload"

Upload key

it should show something like this

Upload key successfully

good, now to upload the certificate itself, we need to choose Generate, view, upload, or delete SSL certificates from the first SSL/TLS page

Upload Certificate

similar to uploading key, we need to scroll to the upload certificate section, choose our certificate file, and press the upload certificate button

Upload certificate

upload certificate successfully

finally, let's install it after uploading it

from the first SSL/TLS page, we choose Manage SSL sites

Manage SSL

Scroll down to "Install an SSL Website", select the domain, click on "Autofill by domain"

Autofill certificate data

now scroll to the bottom of the page and click on "Install Certificate"

Install Certificate

Done! 😎

New certificate

Did you have any unexpected issues? please share and let's try solving them together
Do you have a better or easier way to do it? please share

ssl Article's
30 articles in total
Favicon
Building and Deploying a New API (Part 3)
Favicon
Using Cloudflare SSL with Elastic Beanstalk instances
Favicon
Generate your Let's Encrypt Digital Certificates for all your domains using Apache
Favicon
Renew LetsEncrypt SSL Certificate in WordPress by Bitnami
Favicon
Building an S3 Static Website with CloudFront Using Terraform
Favicon
You May Prefer to Know Less About PKI Flaws but Now Is Too Late
Favicon
Understanding SSL and Its Importance
Favicon
Heartbleed: The Bug That Shook the Internet
Favicon
How to Ignore cURL SSL Errors
Favicon
Secure Nginx with Let's Encrypt on Ubuntu
Favicon
How to Update SSL Certificate in SafeLine WAF through a File
Favicon
Deploy Vite-React Project in AWS EC2 using custom domain and free SSL Certificate.
Favicon
5 Steps for a Quick and Effective Transition to 90-Day TLS/SSL Certificates
Favicon
Guide to SSL Errors: What do they mean and how to fix them
Favicon
How to remotely EV code-sign a windows application using ssl.com
Favicon
Instant Domain Insights: Why Every Tech Professional Needs DNS Checker Pro
Favicon
INSY 8211 & Intro to Linux Administration - part_1 [Network and Web Server Configuration]
Favicon
Day 32: Securing Your Personal Blog with SSL/TLS (A Beginner's Guide)
Favicon
Understanding SSL/TLS: The Role of Encryption and Security Protocols in Internet Communication
Favicon
Get a free SSL certificates for your shared-hosting cPanel domain!
Favicon
Choosing an SSL certificate: paid or free — or whether you can do without one
Favicon
Chain of Trust: Decoding SSL Certificate Security Architecture
Favicon
Docker Server Certificate with SSL
Favicon
HTTPS and SSLs: Why They Matter, How to Use Them
Favicon
🚀 Deploying Node.js Application with PM2, NGINX, and SSL Configuration 🚀
Favicon
Types of SSL Certificates
Favicon
AWS Certificate Manager Implementation
Favicon
Migration vom Nginx Proxy Manager zu Traefik 🚀
Favicon
Migrating from Nginx Proxy Manager to Traefik 🚀
Favicon
Self hosted supabase setup with Authelia and Caddy

Featured ones: