 {"id":444915,"date":"2023-12-17T21:30:22","date_gmt":"2023-12-18T04:30:22","guid":{"rendered":"https:\/\/jorgep.com\/blog\/?p=444915"},"modified":"2025-03-10T15:33:20","modified_gmt":"2025-03-10T22:33:20","slug":"adding-a-free-ssl-cert-to-namecheap","status":"publish","type":"post","link":"https:\/\/jorgep.com\/blog\/adding-a-free-ssl-cert-to-namecheap\/","title":{"rendered":"Adding A Free SSL Cert to NameCheap"},"content":{"rendered":"\n<p><a href=\"https:\/\/jorgep.com\/namecheap\">Namecheap.com<\/a> 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.<\/p>\n\n\n\n<p>Fortunately,  you can use one of the free certificate issuers like: Let&#8217;s Encrypt, ZeroSSL or even Cloudflare  to install using the Namecheap cPanel.   <br>These are the steps I followed to issue and install a Let&#8217;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.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>I am glad to have found this way &#8211; 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!<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2\/18\/2025 Update &#8211;   <\/h3>\n\n\n\n<p>I found a way to install \/ deploy the certificate without having to go to the CPanel interface&#8230;  That will take care of steps 4 &amp; 5  <\/p>\n\n\n\n<p>in one swoop!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>acme.sh\/acme.sh --issue -d yourdomainname.com  -d www.yourdomainname.com  -w \/home\/yourusername\/public_html\/yourdomainname --server letsencrypt --force\n\n\n.acme.sh\/acme.sh --deploy -d yourdomainname.com  -d www.yourdomainname.com  --deploy-hook cpanel_uapi<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2\/19\/2025 Update: <\/h2>\n\n\n\n<p>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.!)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/renewssl.sh  \"yourdomainname.com\" \"\/home\/yourusername\/public_html\/yourdomainname\"<\/code><\/pre>\n\n\n\n<p>and the batch file follows: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\n# Example usage from the command line:\n# issue_and_deploy_cert \"$1\" \"$2\"\n# Example usage:\n#     renewssl \"yourdomainname.com\" \"\/home\/yourusername\/public_html\/yourdomainname\"\n\nLOG_FILE=\"\/var\/log\/ssl_cert_manager.log\" #Or somewhere else that is writeable.\nLOG_FILE=\"$HOME\/logs\/some_renewalssl.log\"\n\n\nissue_and_deploy_cert() {\n  local domain=\"$1\"\n  local webroot=\"$2\"\n\n  if ! .acme.sh\/acme.sh --issue -d \"$domain\" -d \"www.$domain\" -w \"$webroot\" --server letsencrypt --force; then\n    echo \"Error: Failed to issue certificate for $domain\"\n    echo \"$(date) - Error: Failed to issue certificate for $domain\" >> \"$LOG_FILE\"\n    return 1 # Indicate failure\n  fi\n\n  if ! .acme.sh\/acme.sh --deploy -d \"$domain\" -d \"www.$domain\" --deploy-hook cpanel_uapi; then\n   echo \"$(date) - Error: Failed to deploy certificate for $domain\" >> \"$LOG_FILE\"\n    echo \"Error: Failed to deploy certificate for $domain\"\n    return 1 # Indicate failure\n  fi\n  \n      echo \"$(date) - Successfully issued and deployed certificate for $domain\" >> \"$LOG_FILE\"\n      \n  echo \"Successfully issued and deployed certificate for $domain\"\n  return 0 # Indicate success\n}\n\n# Check if the correct number of arguments is provided\nif &#91; $# -ne 2 ]; then\n  echo \"Usage: $0 &lt;domain> &lt;webroot>\"\n  exit 1\nfi\n\nif ! issue_and_deploy_cert \"$1\" \"$2\"; then\n  echo \"Certificate operation failed.\"\n  exit 1\nelse\n  echo \"Certificate operation completed successfully.\"\n  exit 0\nfi\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Remove existing SSL (If any)<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"278\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-94-1024x278.png\" alt=\"\" class=\"wp-image-444922\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-94-1024x278.png 1024w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-94-300x81.png 300w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-94-768x208.png 768w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-94.png 1468w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"491\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-96-1024x491.png\" alt=\"\" class=\"wp-image-444923\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-96-1024x491.png 1024w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-96-300x144.png 300w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-96-768x369.png 768w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-96-1536x737.png 1536w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-96.png 1565w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"233\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-97-1024x233.png\" alt=\"\" class=\"wp-image-444924\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-97-1024x233.png 1024w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-97-300x68.png 300w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-97-768x175.png 768w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-97.png 1033w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Enable Shell Access ( if not already enabled)<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"532\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-91-1024x532.png\" alt=\"\" class=\"wp-image-444916\" style=\"width:769px;height:auto\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-91-1024x532.png 1024w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-91-300x156.png 300w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-91-768x399.png 768w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-91.png 1275w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"379\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-92-1024x379.png\" alt=\"\" class=\"wp-image-444917\" style=\"width:781px;height:auto\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-92-1024x379.png 1024w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-92-300x111.png 300w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-92-768x285.png 768w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-92.png 1074w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3:  Install Script to Manage ( One-time task on your tenant instance) <\/h2>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"809\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-93-1024x809.png\" alt=\"\" class=\"wp-image-444918\" style=\"width:732px;height:auto\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-93-1024x809.png 1024w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-93-300x237.png 300w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-93-768x607.png 768w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-93.png 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Go to Terminal under cPanel Advanced and type: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> curl https:\/\/get.acme.sh | sh<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"563\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-95-1024x563.png\" alt=\"\" class=\"wp-image-444920\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-95-1024x563.png 1024w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-95-300x165.png 300w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-95-768x423.png 768w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-95-1536x845.png 1536w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-95.png 1652w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Generate the certificate.<\/h2>\n\n\n\n<p>.acme.sh\/acme.sh &#8211;issue -d yourdomainname.com -d optional-seconddomainname.com -w \/home\/yourusername\/public_html\/ &#8211;server letsencrypt<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>acme.sh\/acme.sh --issue -d yourdomainname.com   -d www.yourdomainname.com    -w \/home\/yourusername\/public_html\/yourdomainname<\/code><\/pre>\n\n\n\n<p>The certificates will be located in the acme directory under the domain name you requested.     <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Install certificate on tenant<\/h2>\n\n\n\n<p>As we mentioned in step 4,  the certificate information will be located in the acme directory under the domain name you requested.     <\/p>\n\n\n\n<p>Go back to CPanel and go to Security\/TLS section <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"278\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-94-1024x278.png\" alt=\"\" class=\"wp-image-444922\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-94-1024x278.png 1024w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-94-300x81.png 300w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-94-768x208.png 768w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-94.png 1468w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>and then go to Manage SSL sites<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"491\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-96-1024x491.png\" alt=\"\" class=\"wp-image-444923\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-96-1024x491.png 1024w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-96-300x144.png 300w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-96-768x369.png 768w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-96-1536x737.png 1536w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-96.png 1565w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Scroll below all of the existing certificates, you will see the Install an SSL Website section, Select your domain from the dropdown  and then <\/p>\n\n\n\n<p>Copy and paste the data inside the CER and KEY files in the  corresponding fields.   Leave Certificate Authority Bundle: (CABUNDLE) field <\/p>\n\n\n\n<p>Click on Install Certificate<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"785\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-98-1024x785.png\" alt=\"\" class=\"wp-image-444987\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-98-1024x785.png 1024w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-98-300x230.png 300w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-98-768x589.png 768w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-98-1536x1177.png 1536w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-98.png 1566w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"784\" height=\"593\" src=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-101.png\" alt=\"\" class=\"wp-image-445056\" srcset=\"https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-101.png 784w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-101-300x227.png 300w, https:\/\/jorgep.com\/blog\/wp-content\/uploads\/image-101-768x581.png 768w\" sizes=\"auto, (max-width: 784px) 100vw, 784px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>\n","protected":false},"author":2,"featured_media":461826,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","ngg_post_thumbnail":0,"episode_type":"","audio_file":"","podmotor_file_id":"","podmotor_episode_id":"","cover_image":"","cover_image_id":"","duration":"","filesize":"","filesize_raw":"","date_recorded":"","explicit":"","block":"","itunes_episode_number":"","itunes_title":"","itunes_season_number":"","itunes_episode_type":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[441],"tags":[904],"class_list":["post-444915","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech-talk","tag-ssl"],"taxonomy_info":{"category":[{"value":441,"label":"Tech Talk"}],"post_tag":[{"value":904,"label":"SSL"}]},"featured_image_src_large":["https:\/\/jorgep.com\/blog\/wp-content\/uploads\/jorgep-BlogPostGeneric.jpg",1024,512,false],"author_info":{"display_name":"Jorge Pereira","author_link":"https:\/\/jorgep.com\/blog\/author\/jorge\/"},"comment_info":0,"category_info":[{"term_id":441,"name":"Tech Talk","slug":"tech-talk","term_group":0,"term_taxonomy_id":451,"taxonomy":"category","description":"","parent":0,"count":672,"filter":"raw","cat_ID":441,"category_count":672,"category_description":"","cat_name":"Tech Talk","category_nicename":"tech-talk","category_parent":0}],"tag_info":[{"term_id":904,"name":"SSL","slug":"ssl","term_group":0,"term_taxonomy_id":914,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/posts\/444915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/comments?post=444915"}],"version-history":[{"count":0,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/posts\/444915\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/media\/461826"}],"wp:attachment":[{"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/media?parent=444915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/categories?post=444915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jorgep.com\/blog\/wp-json\/wp\/v2\/tags?post=444915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}