In this short story, I will share my experience about using the Let’s Encrypt SSL certificate for cPanel hostname. As you know, cPanel provides a free SSL certificate for cPanel hostname as default. But some times it now works for Iranian domain, so you can use the following steps to have a valid SSL certificate for your cPanel services.
Install the Certbot from EPEL
Run following command to install certbot from epel repo
Create deploy-hook script for Certbot
Create hostname-ssl.sh file
Now make it executable
Issue a certificate for cPanel hostname
With the following command you will be able to issue a Let’s Encrypt valid certificate for cPanel HOSTNAME
Certificate renew cron job
For the certificate, auto-renew add the following cron job