NameCheap doesn't support Let's Encrypt natively, But provides option so you can setup LetEncrypt SSL certificates using different utilities like getSSL or, having used both found to be quite better and simple to use + it supports auto renewal too.
1 - Enable SSH to get into your shared hosting server with your cpanel username.(You can get keys & login from your terminal or use inbuilt capnel terminal for quick access)

2 - Get the certs

#Get utility
curl | sh

#Source the Environment variables
source ~/.bashrc

#Register your email with Lets's Encrypt to be notified any renewals issue --register-account --accountemail

# At this moment a cron entry already has been setup for autorenewal which will auto renew after 60 days., You can update /dev/null to something like this if you need the log
crontab -l | grep
10 0 * * * "/home/_CPANEL_USERNAME_/"/ --cron --home "/home/_CPANEL_USERNAME_/" >> /home/_CPANEL_USERNAME_/.acme_cron_log

3 – Issue a test cert to check if all working

#webroot will be any directory in which your domain exist, give path accordingly. --issue --webroot ~/public_html -d --staging

4 – issue an actual Certificate --issue --webroot ~/public_html -d --force

#In ourput you will see success if all goes fine & key/Certs/chaincerts/csr will be stored under below location, you can refer those if you intend to apply those using cpanel GUI manually


5 - Apply Cert to website using cPanel hook --deploy --deploy-hook cpanel_uapi --domain

6 – You should be able to see your domain with SSL in cpanel under SSL/TLS -> Manage all certs
7 - Force HTTP-HTTPS redirection
If you see option to enable you can enforce HTTP from cpanel itself:


In case it is greyed out, which could be in case you have multiple domains like for which you don’t have the cert , Enable the redirection from “redirects” or simply add below lines in .htaccess file

#always backup as a thumb of rule
vi ~/public_html/.htaccess 


vi ./ 

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

8 – test your website in new window with URL: or in http it should redirect automatically to https)

So you are all done now, If you need a more detailed Article you can checkout the original article on below link:


最后修改:2021 年 11 月 12 日