Technique Memo

SSL certificate generation

03 Mar 2024

Obtaining SSL Certificates with acme.sh

Installation

There are two main ways to install acme.sh:

Using the official installer:

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

Installation from Git:

git clone https://github.com/acmesh-official/acme.sh.git ~/.acme.sh

Issue a Certificate:

Single Domain:

acme.sh --issue -d your_domain.com

Multiple Domains (wildcard or comma-separated):

acme.sh --issue  -d your_domain.com,www.your_domain.com -d *.your_domain.com

(Replace your_domain.com with your actual domain name)

Webroot Validation:

acme.sh will attempt to validate your domain ownership by creating temporary files in your webroot directory. Ensure you have write permissions to this directory.

Install Certificate:

(The specific steps may vary depending on your server.)

After successful issuance, use the following command to copy the certificate and key to your server’s desired location:

acme.sh --install-cert -d your_domain.com \
  --cert-file /path/to/your_cert.pem \
  --key-file /path/to/your_key.pem

(Replace /path/to/your_cert.pem and /path/to/your_key.pem with your desired paths)

Renewal:

acme.sh automatically renews your certificate before it expires. You can also manually renew using:

acme.sh --renew -d your_domain.com

Additional Notes:

Visit the official acme.sh documentation for detailed explanations and advanced options: https://github.com/acmesh-official/acme.sh Remember to replace your_domain.com with your actual domain name throughout the process. This guide assumes you have basic knowledge of server administration and file permissions.

Tweet