acme.sh commands cheat sheet

acme.sh is a shell script for issuing and automatically renewing free SSL certificates, and it doesn't require root. This cheat sheet brings together the commands for every stage: installation, choosing the certificate authority, issuing with HTTP or DNS validation, wildcard certificates, installing the certificate on the web server, renewal, notifications, and revoking. You can search for a command, filter by topic, and copy it with one click.

Installing and updating

  • curl https://get.acme.sh | sh -s email=my@example.com

    Installs acme.sh in the user's ~/.acme.sh folder, creates the acme.sh alias, and adds a cron job that checks the certificates several times a day and renews them when needed. The email address is used to register the account with the certificate authority. Caution: the command runs a script from the internet directly in the shell, so it's best to review the script before running it, or to install from Git. After installing, close the terminal window and open it again, so the alias works.

  • wget -O - https://get.acme.sh | sh -s email=my@example.com

    The same installation, with wget instead of curl. Here too, the script runs directly from the internet.

  • git clone https://github.com/acmesh-official/acme.sh.git && cd acme.sh && ./acme.sh --install -m my@example.com

    Installs from a copy of the official repository on GitHub. This way, you can review the code before installing.

  • acme.sh --upgrade

    Updates acme.sh to the latest version. The tool is updated often, and the developers recommend working with the latest version.

  • acme.sh --upgrade --auto-upgrade

    Updates acme.sh and turns on automatic updates from now on.

  • acme.sh --upgrade --auto-upgrade 0

    Turns off automatic updates.

Certificate authority (CA) and account

  • acme.sh --set-default-ca --server letsencrypt

    Sets Let's Encrypt as the default certificate authority. In recent versions of acme.sh, the default is ZeroSSL, and after this command, every issuance without --server goes to Let's Encrypt.

  • acme.sh --set-default-ca --server zerossl

    Sets ZeroSSL back as the default certificate authority.

  • acme.sh --issue --server letsencrypt -d example.com -w /var/www/html

    Chooses a certificate authority for one command only, without changing the default. Other values for --server are zerossl, google, and letsencrypt_test, or the full URL of an ACME server.

  • acme.sh --register-account -m my@example.com --server zerossl

    Registers a ZeroSSL account with an email address. Registration is a one-time step, required before the first issuance.

  • acme.sh --register-account --server zerossl --eab-kid xxxxxxxx --eab-hmac-key xxxxxxxx

    Registers a ZeroSSL account with the EAB credentials from your account on the ZeroSSL website, as an alternative to registering with an email address.

  • acme.sh --update-account -m new@example.com

    Updates the account email address with the certificate authority.

Issuing a certificate with HTTP validation

  • acme.sh --issue -d example.com -w /var/www/html

    Issues a certificate in webroot mode: the tool writes a temporary validation file in the site folder, and the certificate authority checks it over port 80. Write access to the folder is required. When a web server is already running on the server, this is the recommended mode.

  • acme.sh --issue -d example.com -d www.example.com -w /var/www/html

    Issues one certificate for several names. Add -d for each name. All the names must point to the server.

  • acme.sh --issue --nginx -d example.com -d www.example.com

    Nginx mode: the tool temporarily changes the Nginx configuration for validation, then restores it to its original state. This mode is for issuing only, and doesn't install the certificate in the configuration. Requires root or sudo.

  • acme.sh --issue --apache -d example.com -d www.example.com

    Apache mode: validation runs through Apache, without writing files in the site folder and without changing the configuration files. This mode is for issuing only. Requires root or sudo.

  • acme.sh --issue --standalone -d example.com

    Standalone mode: the tool starts a built-in web server on port 80 for validation. This mode suits a server with no web server. Port 80 must be free, and you need root or permission to listen on the port.

  • acme.sh --issue --alpn -d example.com

    Validation over port 443 (TLS-ALPN) with the built-in server, for example when port 80 is blocked. Port 443 must be free.

DNS validation and wildcard certificates

  • export CF_Token="your-api-token"

    An example for one DNS provider, Cloudflare: sets an API token with permission to edit DNS records. Each provider has its own name and its own variables, and the full list is in the acme.sh documentation.

  • export CF_Zone_ID="your-zone-id"

    Sets the zone ID of the domain in Cloudflare. To issue certificates for several domains in the same account, set CF_Account_ID instead.

  • acme.sh --issue --dns dns_cf -d example.com -d '*.example.com'

    Issues a wildcard certificate with DNS validation: the tool adds the validation record through the DNS provider's API and deletes it when done. A certificate for *.example.com doesn't cover example.com itself, so request both names. The credentials are saved in ~/.acme.sh/account.conf and are also used for automatic renewal.

  • acme.sh --issue --dns -d example.com --yes-I-know-dns-manual-mode-enough-go-ahead-please

    DNS manual mode, manual validation for a DNS provider with no API: the command shows a TXT record that you add manually. Caution: a certificate issued this way doesn't renew automatically, and the documentation recommends this mode for testing only.

  • acme.sh --renew -d example.com --yes-I-know-dns-manual-mode-enough-go-ahead-please

    Completes issuance in DNS manual mode, after you've added the TXT record and it has propagated in DNS.

  • acme.sh --issue --dns dns_cf -d example.com --challenge-alias aliasdomain.com

    DNS alias mode: validation takes place in another domain that has an API. First, create a CNAME record from _acme-challenge.example.com to _acme-challenge.aliasdomain.com.

Key type, testing, and troubleshooting

  • acme.sh --issue -d example.com -w /var/www/html --keylength ec-384

    Issues an ECC certificate with an ECDSA P-384 key. By default, acme.sh issues ECC certificates with an ec-256 (ECDSA P-256) key.

  • acme.sh --issue -d example.com -w /var/www/html --keylength 2048

    Issues a certificate with a 2048-bit RSA key, for example for older software that doesn't support ECC. Other values: 3072 and 4096.

  • acme.sh --issue --staging -d example.com -w /var/www/html

    Issues a certificate from the staging server, so you can test your settings without worrying about issuance rate limits. Browsers don't trust such a certificate, so after the test succeeds, issue again without --staging. The --test option is the same.

  • acme.sh --issue -d example.com -w /var/www/html --debug 2

    Runs the command with detailed output, to find out why issuance failed.

Installing the certificate on the web server

  • acme.sh --install-cert -d example.com --key-file /etc/nginx/ssl/example.com.key --fullchain-file /etc/nginx/ssl/fullchain.pem --reloadcmd "service nginx force-reload"

    Copies the key and the certificate chain to the paths Nginx uses, and reloads Nginx. The paths and the command are saved and run again automatically after every renewal. Without a working --reloadcmd, the server keeps showing the old certificate even after renewal.

  • acme.sh --install-cert -d example.com --cert-file /etc/apache2/ssl/cert.pem --key-file /etc/apache2/ssl/key.pem --fullchain-file /etc/apache2/ssl/fullchain.pem --reloadcmd "service apache2 force-reload"

    The same for Apache. Point the web server to the paths in the command, not to the files in the ~/.acme.sh folder: the files there are for the tool's internal use, and their structure may change.

  • acme.sh --to-pkcs12 -d example.com

    Exports the certificate and the key to a PFX file, for example for a Windows server. To protect the file with a password, add --password.

Viewing certificates and renewal

  • acme.sh --list

    Lists all the certificates the tool manages, with the key type, the certificate authority, the issue date, and the next renewal date.

  • acme.sh --info -d example.com

    Shows the saved settings of the certificate, for example the validation method, the installation paths, and the reload command.

  • acme.sh --info

    Shows the acme.sh working folder and the saved global settings. Caution: the output may include saved credentials for the DNS provider's API, so don't share it.

  • acme.sh --renew -d example.com --force

    Renews the certificate right away, even if its renewal date hasn't arrived yet. For an ECC certificate, add --ecc, as in the example in the documentation. Caution: repeated forced renewals can hit the certificate authority's issuance rate limits.

  • acme.sh --renew-all

    Renews all the certificates that are due for renewal.

  • acme.sh --cron

    Runs the renewal check manually, the same action the cron job performs.

  • crontab -l

    Shows the user's cron jobs. The installation adds a job that runs acme.sh --cron several times a day, at a minute and hours chosen at random during installation.

    Example: 27 3,9,15,21 * * * "/home/user/.acme.sh"/acme.sh --cron --home "/home/user/.acme.sh" > /dev/null

  • acme.sh --install-cronjob

    Reinstalls the cron job if it was deleted. With a normal installation, there's no need to run it.

Notifications

  • acme.sh --set-notify --notify-hook mail

    Sets up email notifications from the renewal job. Each notification channel has its own settings variables, such as the sender and recipient addresses, which are listed in the documentation.

  • acme.sh --set-notify --notify-hook telegram

    Sets up notifications on Telegram. The documentation lists more channels, for example Slack, Discord, and Microsoft Teams.

  • acme.sh --set-notify --notify-level 1

    Sends a notification only when there's an error. The default is 2: a notification on a successful renewal and on an error. The value 3 also notifies you about a certificate that wasn't renewed because it isn't due yet, and the value 0 turns notifications off.

  • acme.sh --set-notify --notify-mode 1

    Sends a separate message for each certificate. The default, 0, combines all the notifications in one message.

Revoking, removing, and uninstalling

  • acme.sh --revoke -d example.com

    Revokes the certificate with the certificate authority. Caution: revoking is final and can't be undone, so install a new certificate for the site first. Use it mainly when the private key was exposed.

  • acme.sh --revoke -d example.com --revoke-reason 1

    Revokes the certificate with a reason. The value 1 means the key was compromised (keyCompromise), and the possible values are 0 to 10, as defined in RFC 5280.

  • acme.sh --remove -d example.com

    Removes the certificate from the acme.sh certificate list, so it won't be renewed anymore. The files aren't deleted from the disk. Caution: if the site still uses the certificate, it will expire and won't be renewed.

  • acme.sh --uninstall

    Uninstalls acme.sh and its cron job. Caution: after uninstalling, certificates won't renew automatically.

The default CA and automatic renewal

  • Certificate authority: in recent versions, acme.sh issues certificates from ZeroSSL by default. To issue from Let's Encrypt, set it as the default with --set-default-ca, or add --server letsencrypt to each command.
  • Renewal: the cron job checks the certificates several times a day. By default, a certificate is renewed 30 days after it was issued, and when the certificate authority publishes a suggested renewal window (ARI), the tool follows it automatically.
  • Shorter certificates: under the schedule Let's Encrypt has published, certificates issued from February 10, 2027 will be valid for 64 days, and certificates issued from February 16, 2028 will be valid for 45 days. The 30-day default also suits these certificates. A --days value you set manually determines when renewal happens, so make sure it's shorter than the certificate's validity period.
  • Certificate files: after issuing, run --install-cert with --reloadcmd, and point the web server to the paths in the command. The files in the ~/.acme.sh folder are for internal use only.

The domain example.com and the paths and tokens on this page are examples, so replace them with your real values. You can check the certificate your site actually shows with the SSL certificate checker tool.

Did you know?

With our web hosting plans, an SSL certificate is activated for your site with one click, at no cost, and it renews automatically, with no commands needed. On a Linux VPS, you connect over SSH with full root access, and install and run acme.sh with every command on this page.

Linux VPS plans

acme.sh FAQ

What is acme.sh, and how is it different from Certbot?

Both tools issue and renew free SSL certificates over the same protocol, ACME. acme.sh is written entirely in shell script, doesn't need Python, doesn't require root, and supports automatic DNS validation with many DNS providers. Its default certificate authority is ZeroSSL, while Certbot works with Let's Encrypt by default. The Certbot commands are on the Certbot commands page.

How do I issue a Let's Encrypt certificate with acme.sh?

Run acme.sh --set-default-ca --server letsencrypt once, and from then on, every issuance goes to Let's Encrypt. For a single issuance, you can add --server letsencrypt to the command without changing the default.

How do I issue a wildcard certificate with acme.sh?

A wildcard certificate requires DNS validation. Set the credentials for your DNS provider's API in environment variables, and run the issuance with --dns and the provider's name, for example dns_cf. Request both example.com and *.example.com, because a certificate for *.example.com doesn't cover the domain itself. The credentials are saved, and renewal runs automatically.

How do I check that acme.sh automatic renewal is working?

The acme.sh --list command shows the next renewal date of each certificate, and the crontab -l command shows the scheduled renewal job. You can check the certificate your site actually shows, including its expiration date, with the SSL certificate checker tool.

Why do I need --install-cert if the certificate is already in the ~/.acme.sh folder?

The files in the ~/.acme.sh folder are for the tool's internal use, and their structure may change. The --install-cert command copies the certificate to the paths you choose and saves the reload command, so after every renewal, the new certificate is copied and the web server starts using it.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement