SSL

In this guide, you’ll learn how to use acme.sh to obtain a free SSL certificate.

1. Install acme

First, install the acme.sh tool by running the following command:

curl https://get.acme.sh | sh

2. Set up Email

Next, register your email for notifications:

~/.acme.sh/acme.sh --register-account -m your_email@example.com

3. Obtain SSL Certificate

To obtain an SSL certificate for your domain(s), use the following commands. Below is how to obtain a certificate for both a single and multiple domains:

~/.acme.sh/acme.sh --issue --standalone -d yourdomain.com
~/.acme.sh/acme.sh --issue --standalone -d yourdomain.com -d example.com

4. Install the Certificate

After obtaining the certificate, install it in the appropriate directory. Use the following commands for different installations:

~/.acme.sh/acme.sh --install-cert -d yourdomain.com \
--cert-file /var/lib/marzneshin/certs/yourdomain/fullchain.pem \
--key-file /var/lib/marzneshin/certs/yourdomain/privkey.pem
~/.acme.sh/acme.sh --install-cert -d yourdomain.com \
--cert-file /var/lib/marznode/certs/yourdomain/fullchain.pem \
--key-file /var/lib/marznode/certs/yourdomain/privkey.pem

5. Auto-Renewal

To ensure automatic renewal of your SSL certificate, install a cron job by running:

~/.acme.sh/acme.sh --install-cronjob