Skip to content

cPanel Setup

For shared hosting or cPanel accounts.

Use acme.sh because it works well in limited SSH environments and supports the cpanel_uapi deploy hook.

1. Open Terminal

Open:

text
cPanel -> Advanced -> Terminal

If Terminal is unavailable, ask the hosting provider to enable SSH / Shell Access.

2. Set Variables

bash
export DOMAIN="example.com"
export EMAIL="[email protected]"
export ACME_SERVER="your Server URL"
export EAB_KID="your EAB MAC ID"
export EAB_HMAC_KEY="your EAB MAC key"
export WEBROOT="$HOME/public_html"

Single-domain certificates should include example.com and www.example.com.

3. Install acme.sh

bash
curl https://get.acme.sh | sh
source ~/.bashrc 2>/dev/null || source ~/.zshrc 2>/dev/null || true

If command not found appears:

bash
~/.acme.sh/acme.sh --version

4. Register the ACME Account

bash
~/.acme.sh/acme.sh --register-account \
  --server "$ACME_SERVER" \
  --eab-kid "$EAB_KID" \
  --eab-hmac-key "$EAB_HMAC_KEY" \
  --accountemail "$EMAIL"

5. Issue and Deploy to cPanel

Single domain, including the root domain and www:

bash
~/.acme.sh/acme.sh --issue \
  --webroot "$WEBROOT" \
  --domain "$DOMAIN" \
  --domain "www.$DOMAIN" \
  --server "$ACME_SERVER" \
  --eab-kid "$EAB_KID" \
  --eab-hmac-key "$EAB_HMAC_KEY" \
  --deploy-hook cpanel_uapi

Multi-domain:

bash
~/.acme.sh/acme.sh --issue \
  --webroot "$WEBROOT" \
  --domain example.com \
  --domain www.example.com \
  --domain example.net \
  --domain shop.example.org \
  --server "$ACME_SERVER" \
  --eab-kid "$EAB_KID" \
  --eab-hmac-key "$EAB_HMAC_KEY" \
  --deploy-hook cpanel_uapi

Wildcard, including the root domain and *.:

bash
export CF_Token="Cloudflare API Token"
export CF_Account_ID="Cloudflare Account ID"

~/.acme.sh/acme.sh --issue \
  --dns dns_cf \
  --domain "$DOMAIN" \
  --domain "*.$DOMAIN" \
  --server "$ACME_SERVER" \
  --eab-kid "$EAB_KID" \
  --eab-hmac-key "$EAB_HMAC_KEY" \
  --deploy-hook cpanel_uapi

WARNING

Wildcard certificates require DNS validation. Replace dns_cf and API variables for your DNS provider.

Redeploy an existing certificate:

bash
~/.acme.sh/acme.sh --deploy \
  --domain "$DOMAIN" \
  --deploy-hook cpanel_uapi

6. Check

Open:

text
cPanel -> SSL/TLS -> Manage SSL Sites

Confirm the new certificate is installed, then open:

text
https://example.com

7. Renewal Test

bash
~/.acme.sh/acme.sh --cron --force