Adding A Free SSL Cert to NameCheap

Namecheap.com is a great place to buy domain names. It also has some great shared hosting services. Unfortunately when you buy and host a domain name with them, they only give you a 1-year FREE SSL certificate and them you have to pay $8/year for each which can be expensive if you have many subdomains or domains. Although many hosting service providers do include free SSL certificates beyond the first year, the price of those services is much higher than Namecheap hosting.
Fortunately, you can use one of the free certificate issuers like: Let’s Encrypt, ZeroSSL or even Cloudflare to install using the Namecheap cPanel.
These are the steps I followed to issue and install a Let’s Encrypt certificate using the Automatic Certificate Management Environment (ACME script) which provides an easy-to-use method of automating interactions between a certificate authority.
I am glad to have found this way – as I have found that the price, performance and reliability of Namecheap hosting is much better value than other hosting providers. Hope this helps others navigate this!
2/18/2025 Update –
I found a way to install / deploy the certificate without having to go to the CPanel interface… That will take care of steps 4 & 5
in one swoop!
acme.sh/acme.sh --issue -d yourdomainname.com -d www.yourdomainname.com -w /home/yourusername/public_html/yourdomainname --server letsencrypt --force
.acme.sh/acme.sh --deploy -d yourdomainname.com -d www.yourdomainname.com --deploy-hook cpanel_uapi
2/19/2025 Update:
got curious and, with the help of Gemini AI, end up creating a bash shell file to automate the process! this works only on namecheeap hosting site.!)
./renewssl.sh "yourdomainname.com" "/home/yourusername/public_html/yourdomainname"
and the batch file follows:
#!/bin/bash
# Example usage from the command line:
# issue_and_deploy_cert "$1" "$2"
# Example usage:
# renewssl "yourdomainname.com" "/home/yourusername/public_html/yourdomainname"
LOG_FILE="/var/log/ssl_cert_manager.log" #Or somewhere else that is writeable.
LOG_FILE="$HOME/logs/some_renewalssl.log"
issue_and_deploy_cert() {
local domain="$1"
local webroot="$2"
if ! .acme.sh/acme.sh --issue -d "$domain" -d "www.$domain" -w "$webroot" --server letsencrypt --force; then
echo "Error: Failed to issue certificate for $domain"
echo "$(date) - Error: Failed to issue certificate for $domain" >> "$LOG_FILE"
return 1 # Indicate failure
fi
if ! .acme.sh/acme.sh --deploy -d "$domain" -d "www.$domain" --deploy-hook cpanel_uapi; then
echo "$(date) - Error: Failed to deploy certificate for $domain" >> "$LOG_FILE"
echo "Error: Failed to deploy certificate for $domain"
return 1 # Indicate failure
fi
echo "$(date) - Successfully issued and deployed certificate for $domain" >> "$LOG_FILE"
echo "Successfully issued and deployed certificate for $domain"
return 0 # Indicate success
}
# Check if the correct number of arguments is provided
if [ $# -ne 2 ]; then
echo "Usage: $0 <domain> <webroot>"
exit 1
fi
if ! issue_and_deploy_cert "$1" "$2"; then
echo "Certificate operation failed."
exit 1
else
echo "Certificate operation completed successfully."
exit 0
fi
Step 1: Remove existing SSL (If any)



Step 2: Enable Shell Access ( if not already enabled)


Step 3: Install Script to Manage ( One-time task on your tenant instance)

Go to Terminal under cPanel Advanced and type:
curl https://get.acme.sh | sh

Step 4: Generate the certificate.
.acme.sh/acme.sh –issue -d yourdomainname.com -d optional-seconddomainname.com -w /home/yourusername/public_html/ –server letsencrypt
acme.sh/acme.sh --issue -d yourdomainname.com -d www.yourdomainname.com -w /home/yourusername/public_html/yourdomainname
The certificates will be located in the acme directory under the domain name you requested.
Step 5: Install certificate on tenant
As we mentioned in step 4, the certificate information will be located in the acme directory under the domain name you requested.
Go back to CPanel and go to Security/TLS section

and then go to Manage SSL sites

Scroll below all of the existing certificates, you will see the Install an SSL Website section, Select your domain from the dropdown and then
Copy and paste the data inside the CER and KEY files in the corresponding fields. Leave Certificate Authority Bundle: (CABUNDLE) field
Click on Install Certificate

