Here are all the commands needed
First time setup (only do it once per account):
curl https://get.acme.sh | sh
source ~/.bashrc
acme.sh --set-default-ca --server letsencrypt
acme.sh --register-account --accountemail me@mydomain.com
What each line does:
- Download and executes the ACME shell script
- Reloads the environment
- Sets Let’s Encrypt as the default
- Creates / Registers your account
For each domain (DO NOT use for subdomains)
acme.sh --issue --webroot ~/public_html -d mydomain.com -d www.mydomain.com --staging acme.sh --issue --webroot ~/public_html -d mydomain.com -d www.mydomain.com --force acme.sh --deploy --deploy-hook cpanel_uapi --domain mydomain.com --domain www.mydomain.com
What each line does:
- Does a test to check if your DOMAIN PATH is correct.
- Obtains a certificate from the Certificate Authority (i.e. Let’s Encrypt / ZeroSSL).
- Registers the certificate to your domain and cPanel (HTTPS will work now).
For each subdomain (DO NOT use for domains)
acme.sh --issue --webroot ~/subdomain.mydomain.com -d subdomain.mydomain.com --staging acme.sh --issue --webroot ~/subdomain.mydomain.com -d subdomain.mydomain.com --force acme.sh --deploy --deploy-hook cpanel_uapi --domain subdomain.mydomain.com
What each line does:
- Does a test to check if your SUBDOMAIN PATH is correct.
- Obtains a certificate from the Certificate Authority (i.e. Let’s Encrypt / ZeroSSL).
- Registers the certificate to your subdomain and cPanel (HTTPS will work now).
To enable auto-renewal for a domain
acme.sh --deploy --deploy-hook cpanel_uapi --domain mydomain.com --domain www.mydomain.com >/dev/null 2>&1
What each line does:
- Adds a CRON job to ensure the domain auto-renews indefinitely.
To stop auto-renewal for a domain
acme.sh --remove --domain mydomain.com
What each line does:
- Stops the auto-renewal process for the specified domain.