π SSL Certificate Management In CyberPanel
We can issue an SSL certificate either via **SSH** or through the **CyberPanel dashboard**. In this guide, we will focus on installing SSL using **SSH**, which gives you more control, especially for bulk domain management or troubleshooting failed SSL requests.
βοΈ Set Default CA for acme.sh
Before issuing any SSL certificates, make sure `acme.sh` uses **Letβs Encrypt** as the default Certificate Authority:
/root/.acme.sh/acme.sh --set-default-ca --server letsencrypt
πΉ –set-default-ca β Sets the default Certificate Authority.
πΉ –server letsencrypt β Specifies Letβs Encrypt as the CA.
π₯οΈ 2. Issue SSL for a Single Domain
You can issue SSL for a single domain via SSH:
cyberpanel issueSSL --domainName domain.com
Replace `domain.com` with your actual domain.
If the process fails, you may need to remove previous SSL files.
π§Ή 2.1 Remove Existing SSL Files
If issuing SSL fails, remove old SSL data:
rm -rf /etc/letsencrypt/live/domain.com rm -rf /etc/letsencrypt/archive/domain.com rm -rf /etc/letsencrypt/renewal/domain.com.conf
Then retry:
cyberpanel issueSSL --domainName domain.com
π 3. Issue SSL for Multiple Domains
To issue SSL for multiple domains:
Create a file containing all domains:
vi /usr/src/domains.txt
Add one domain per line:
domain1.com
domain2.com
domain3.com
Run this loop to issue SSL for each domain:
for i in $(cat /usr/src/domains.txt); do cyberpanel issueSSL --domainName $i done
π 4. Issue SSL for All Domains on Server
To automatically generate a list of all domains on your server:
ls -1 /usr/local/lsws/conf/vhosts | sort -u > /usr/src/domains.txt
ls -1 β lists directories one per line.
sort -u β removes duplicates.
Output saved to /usr/src/domains.txt.
Then run the SSL loop:
for i in $(cat /usr/src/domains.txt); do cyberpanel issueSSL --domainName $i done
—
Β π‘ 5. Tips & Notes
πΉ Always backup SSL files before removing them.
πΉ Ensure ports **80** & **443** are open for Letβs Encrypt validation.
πΉ Works for both single and bulk domain issuance.
πΉ Check logs at `/usr/local/CyberCP/logs/` if CyberPanel fails.
πΉ Use `domains.txt` for easier mass SSL deployment.