acme.sh: install, configure and renew certificates

acme.sh is a pure shell ACME client with no Python or root requirement, so it suits teams that want a small dependency footprint. This page covers install, validation modes, DNS hooks, service installation and how to confirm renewals keep happening.

On this page

How acme.sh automates certificate renewal on a small footprint

acme.sh is a pure shell ACME client that installs a daily cron job and renews certificates automatically, which suits a team that renews certificates by hand today and wants that work to stop depending on a person. It is written for bash, dash and sh, needs no Python, and does not require root, so it can run under an ordinary service account on a small host. As certificate lifetimes shorten under the CA/Browser Forum rules, a manual renewal every few months becomes a renewal every few weeks, and the installed cron job is what keeps that schedule from landing on someone's calendar. Teams should confirm the lifetime their CA issues before they set expectations, since the README describes renewal timing and not the lifetime itself.

The person who has to act is whoever installs the client and owns the host. Installation is one command, curl | sh -s email=my@example.com, or a git clone followed by ./acme.sh --install -m my@example.com. The installer adds a daily entry to the crontab, of the form 0 0 * * * "/home/user/.acme.sh"/acme.sh --cron --home "/home/user/.acme.sh" > /dev/null, so the job runs under the installing user. Before relying on it, check that the cron daemon runs on the host, that the user's crontab was written, and that the --home path matches where the client actually lives.

Renewal timing has two triggers. By default, a certificate renews every 30 days. If the CA advertises ACME Renewal Information (RFC 9773) and its suggestedWindow has opened, acme.sh renews earlier, following the CA's own guidance. The default CA is ZeroSSL.com, and the README lists Let's Encrypt, SSL.com, Google Public CA and Actalis among the alternatives, so the CA chosen decides whether ARI is available. Confirm which CA the host uses and whether it advertises renewalInfo, since that determines how early renewals can happen. Run a forced renewal with acme.sh --renew -d example.com --force in a test setup to confirm the job works end to end before the first real expiry.

What shorter certificate lifetimes change for acme.sh users

This table sets out the lifetime steps the sources cover against what each step means for an acme.sh deployment, including renewal timing, the 30-day default and ARI-driven early renewal. Where the sources give no lifetime figure, the table says so and tells you what to confirm in your own CA's documentation.

Lifetime stepWhat it means for acme.shWhat to check
Default renewal intervalacme.sh renews certificates every 30 days by default, per the acme.sh README.Confirm the interval your CA issues and that it stays above 30 days.
Early renewal with ARIWhen the CA advertises renewalInfo, acme.sh renews earlier once the suggestedWindow has started (RFC 9773).Check that your CA publishes renewalInfo and that acme.sh is current enough to use it.
Daily cron checkThe installer adds a daily cron job that runs acme.sh --cron, which decides whether each certificate is due.Confirm the cron entry exists for the account that owns the certificates.
Shorter CA lifetimesThe sources reviewed do not state the lifetime figure for each CA; the README does not name a maximum lifetime.Look up the lifetime your CA issues in its own documentation before planning renewal intervals.
Manual forced renewalRenewal can be forced with acme.sh --renew -d example.com --force, adding --ecc for ECC certificates.Use forced renewal for testing only, since frequent forced renewals add load on the CA.
Manual reissue stepsRenewal steps tied to fixed manual schedules stop matching the cadence once lifetimes shorten.Replace calendar reminders with the cron job and ARI-driven renewal.
Key type at renewalThe default key type is ECDSA P-256 (ec-256); renewal keeps the key length the certificate was issued with.Confirm the key length in your configuration before depending on it across renewals.
Service reload after renewalThe --install-cert step with --reloadcmd runs your reload command each time a renewal installs new files.Test the reload command so services pick up renewed certificates without a manual restart.

How acme.sh issues, stores and renews certificates

acme.sh is a pure shell client, written to run under bash, dash or sh without Python and without root, so it fits hosts where a small dependency footprint matters. Its installer adds a daily cron job that runs acme.sh --cron against the install's home directory, which is what checks for certificates that need renewal. By default the client issues certificates from ZeroSSL.com CA and uses an ECDSA P-256 key (ec-256). The README also names Let's Encrypt, SSL.com, Google Public CA, Actalis, Pebble in strict mode and any RFC 8555-compliant CA as alternatives, so confirm which CA your policy allows before accepting the default, and check the CA's own documentation for its account and rate-limit terms.

Certificates are kept under the install's home directory, typically ~/.acme.sh, with a separate tree per domain holding the account, the issued files and the configuration used to renew them. Renewal runs every 30 days by default, or earlier once the CA's ARI suggestedWindow has started, where the CA advertises renewalInfo under RFC 9773. Check your CA's documentation to see whether it publishes that endpoint, since the window it returns can shorten your renewal interval.

Copying files into a service is a separate step from renewal. The --install-cert command writes the key and full-chain files to paths you choose and stores a --reloadcmd, which acme.sh runs after each successful renewal so the service loads the new certificate. Test that command by hand, confirm the service picks up the new certificate, and check the file permissions on the key. Forced renewal with --renew --force is useful for that test, and --ecc selects the ECC certificate when a domain has both RSA and ECC entries.

Which validation mode to choose with acme.sh

These modes prove control of a name over HTTP. Webroot writes a challenge file into a directory your existing web server already serves, so the web server keeps running. Standalone on port 80 has acme.sh start its own temporary listener, which means nothing else can hold that port during issuance. Standalone TLS-ALPN on port 443 answers the challenge over TLS on that port instead.

  • Webroot: needs a web root that your server serves on port 80 for the domain. The README example is acme.sh --issue -d example.com -w /var/www/html.
  • Standalone on port 80: needs port 80 reachable from the CA and free on the host. The README example is acme.sh --issue --standalone -d example.com.
  • Standalone TLS-ALPN on port 443: needs port 443 reachable from the CA and free on the host, and it does not need port 80.
  • Limits: the README does not state that HTTP-based modes issue wildcard certificates, so do not plan wildcards on these modes.
  • Wildcards: check the README's wildcard example, which uses DNS, before assuming any HTTP mode covers *.example.com.

Before choosing a standalone mode, confirm that the port is reachable from the public internet and that no other service needs it during renewal.

Installing acme.sh and issuing the first certificate

This sequence installs acme.sh as a shell-only client under a user account, confirms the daily renewal job it creates, issues a first certificate through a validation mode that suits the server, and installs that certificate into a service with a reload command. The result is a certificate that renews on its own from the first run onward.

  1. Install acme.sh with curl, wget or git

    Run the installer as the account that will own the certificates, since acme.sh does not require root. The README gives curl | sh -s email=my@example.com, a wget equivalent, and a git route that clones and runs ./acme.sh --install -m my@example.com. Replace the example address with a mailbox your team monitors, because the CA uses it for account notices. The step is done when the installer reports success and the client files appear in the home directory of that account. Check the README for the current installer details before you run it on a production host.

  2. Confirm the daily cron entry

    The installer adds a daily job of the form 0 0 * * * "/home/user/.acme.sh"/acme.sh --cron --home "/home/user/.acme.sh" > /dev/null, with your own home path in place of /home/user. List the crontab for the account that installed acme.sh and check that this line is present. This job drives renewal, so a missing entry means certificates will not renew automatically. If the entry is absent, add it yourself and confirm the path matches the account's home directory. The step is done when the entry appears in that account's crontab.

  3. Choose a validation mode for the host

    Pick the mode that matches where the name points. The README lists webroot, standalone on port 80, standalone TLS-ALPN on port 443, Apache, Nginx, DNS, DNS alias, stateless and DNS persist. Webroot suits a host where a web server already serves files on port 80. DNS validation suits wildcard names and hosts that cannot take inbound traffic on port 80 or 443. Confirm that port 80 is reachable from the internet for HTTP validation, or that you can create DNS records at your provider for DNS validation. The step is done when you have written down the mode and the reason for it.

  4. Issue the first certificate

    For webroot validation, run acme.sh --issue -d example.com -w /var/www/html with the document root your web server uses. For a wildcard certificate validated through DNS, run acme.sh --issue -d example.com -d '*.example.com' --dns dns_cf, where dns_cf is the hook for one DNS provider. Use the DNS hook that matches your provider from the dnsapi page of the acme.sh wiki, and set the provider credentials the hook documents before you run the command. The default key type is ECDSA P-256 (ec-256), and you can choose another with --keylength. The step is done when the output shows the certificate was issued and saved under the acme.sh home directory.

  5. Install the certificate into the service

    Copy the key and certificate to paths the service reads, and tell the service to reload when renewal runs. The README shows acme.sh --install-cert -d example.com --key-file /path/to/keyfile/in/nginx/key.pem --fullchain-file /path/to/fullchain/nginx/cert.pem --reloadcmd "service nginx force-reload". Replace the paths and the reload command with the ones your service uses. The --install-cert step is what makes later renewals update the files in place, so it should run once after issuance. The step is done when the files exist at those paths and the service serves the new certificate.

  6. Test renewal before you rely on it

    Force a renewal with acme.sh --renew -d example.com --force, and add --ecc when the certificate uses an ECC key. Watch the output for the reload command running and for the service reloading without errors. This test shows that the install path, the reload command and the account permissions all work before the daily job needs them. Note that a forced renewal issues a new certificate against the CA, so use it deliberately. The step is done when the forced renewal completes and the service still serves a valid certificate.

  7. Keep acme.sh and the job current

    Check that the client upgrades cleanly with acme.sh --upgrade, or turn on automatic upgrades with acme.sh --upgrade --auto-upgrade and turn them off with acme.sh --upgrade --auto-upgrade 0. Record which option your team chose, because an unattended upgrade changes the client on the host without a change ticket. Review the README periodically for the default CA and renewal behavior, which the README says is 30 days by default or earlier when the CA's ARI window opens. The step is done when the upgrade policy is written down and the cron entry from the second step is still in place.

What has to be in place before acme.sh can renew

acme.sh is designed to have a small footprint, but renewal still depends on a few things being true on the host. Check each item below before you rely on automated renewal, because a missing piece usually shows up only when the renewal window opens.

A POSIX shell

acme.sh is written in pure shell and the README says it works with bash, dash and sh. Confirm which shell your cron job will actually use, since the installer's cron entry runs the script directly and the shell environment on a minimal server can differ from your interactive login. Test a manual acme.sh --cron run under the same user and environment that the scheduler uses, so you catch path or shell differences before renewal depends on them.

acme.sh README

No Python dependency

The README states acme.sh needs no Python, which keeps the install footprint small and avoids a runtime that must be patched separately. Teams that want a minimal dependency list should still confirm that the tools the script calls on their platform, such as curl or wget and standard utilities, are present and at versions their security policy allows. Record those tools in your host inventory so they are not removed during unrelated cleanup.

Non-root operation

The README says acme.sh does not require root, so it can run under a dedicated service account with its own home directory. Running it as a non-root user limits what a compromised renewal process can reach. The service account still needs write access to the certificate and key paths it installs into, which is often where permissions cause renewal to fail.

Network access to the CA and validation

Renewal makes outbound calls to the certificate authority and, for most modes, the validation path must be reachable from the internet or from your DNS provider. Confirm that the host can reach the CA's ACME endpoint and that your web server or DNS zone is reachable for the challenge you choose. Firewall and proxy rules are a common cause of renewal failures that appear only after a change to network policy.

DNS API credentials for DNS modes

DNS modes such as --dns dns_cf need API credentials for your DNS provider, which the provider's dnsapi page in the acme.sh wiki describes. Store these credentials with restricted permissions, scope them to the zones they need, and rotate them on your normal schedule. Expired or revoked DNS credentials stop renewal silently until the next run reports an error, so include them in your renewal monitoring.

Write access to web root and key paths

Webroot mode writes challenge files into the directory you specify, for example -w /var/www/html, and --install-cert writes the key and certificate to the paths you set. The account running acme.sh needs write access to those locations, and the web server must serve the challenge path. Check both before the first renewal, since a permission gap typically surfaces only when the certificate nears expiry.

A working cron job

The installer creates a daily cron entry that runs acme.sh --cron, and renewal depends on that job running. Confirm the entry exists in the crontab of the user who installed acme.sh and that the scheduler is active after reboots. Route the job's output to a log or monitoring system, since the default entry discards output to /dev/null and hides failures.

How to confirm acme.sh renewals keep happening

A successful install does not prove that renewals will keep running. The acme.sh installer adds a daily cron job, and that entry is the only thing that triggers renewal on a standard setup, so the first check is to confirm it is still present with crontab -l for the user that installed acme.sh. The README gives the expected form as 0 0 * * * "/home/user/.acme.sh"/acme.sh --cron --home "/home/user/.acme.sh" > /dev/null, with the home path matching your installation. Configuration management, OS upgrades, or a change of user can remove or stop that entry without any visible error, so include this check in your host baseline and re-run it after each of those events.

To test the full renewal path rather than wait for a certificate to approach its window, force a renewal with acme.sh --renew -d example.com --force, adding --ecc when the certificate uses an ECC key. Forced renewal exercises the CA connection, validation method, installation step and reload command together, so a failure in a DNS hook, a webroot permission or a --reloadcmd will surface during a planned window rather than at expiry. Run it against a staging or non-production certificate where you can, and confirm afterward that the installed file on the service has the new serial and expiry date. Check the reload command output too, since a renewal that writes new files but fails to reload the service still leaves clients with the old certificate.

Because a silent cron failure produces no alert on the host, monitor expiry from outside it. An external probe that connects to each public hostname and records the certificate's notAfter date will catch a stalled renewal even when the server believes everything is fine. Alert on a threshold well before expiry, and treat a missing or unreachable endpoint as a failure too. Internal certificates need the same treatment from a system that can reach them.

Keep a record of issue and renewal dates for each certificate, including the serial number, key type, CA, the domains covered and the date of each renewal. Auditors and customers who ask how certificates are kept current will expect this history, and it is much easier to build from logs and a simple inventory than to reconstruct after the fact. Retain the acme.sh log output and the external monitoring history for the period your policies require, and confirm that retention with your compliance lead, since this page does not set a retention period.

Questions people ask about renewing certificates with acme.sh

Does acme.sh work with any ACME certificate authority?

Yes, acme.sh works with any certificate authority that is compliant with RFC 8555, the ACME protocol specification. The acme.sh README names ZeroSSL.com as the default CA and lists Let's Encrypt, SSL.com, Google Public CA, Actalis and Pebble strict mode as other options, so you can point it at any compliant CA. Check the CA's own documentation for its directory URL and account requirements, and confirm that it supports the challenge types you plan to use before you rely on it for production renewals.

How do I choose a certificate authority other than the default in acme.sh?

The default CA is ZeroSSL.com, and the acme.sh README lists Let's Encrypt, SSL.com, Google Public CA, Actalis and Pebble strict mode as alternatives. To switch, set the CA with the --server option when you issue, and register an account with that CA using the email address it requires. Before you switch, confirm the CA's terms, account requirements and whether it supports the ACME Renewal Information extension, since renewal timing depends on what the CA advertises. Check the acme.sh README for the exact server names and syntax for your version.

How often does acme.sh renew certificates?

By default, acme.sh renews certificates every 30 days. If the certificate authority supports ACME Renewal Information (RFC 9773) and advertises a suggested window, acme.sh renews earlier once that window opens. The installer creates a daily cron job that runs acme.sh --cron, which checks each certificate and renews any that are due. Because the lifetime of public certificates is shortening, confirm the lifetime your CA issues and check the acme.sh README for how renewal timing is configured.

What happens when an acme.sh certificate renewal fails?

When a renewal fails, acme.sh does not replace the working certificate, so the service keeps serving the current one until it expires. The daily cron job retries renewals, so a temporary problem such as a DNS delay or an unreachable challenge path can recover on its own. Check the cron output and acme.sh logs for the cause, and confirm the challenge path, DNS provider credentials and CA reachability before you assume the problem is resolved. Set up alerts on certificate expiry as a second line of defense, because a silent failure can go unnoticed until the certificate expires.

Does acme.sh support wildcard certificates with DNS providers?

Yes, acme.sh issues wildcard certificates through DNS validation. The acme.sh README shows the form acme.sh --issue -d example.com -d '*.example.com' --dns dns_cf, where dns_cf is the hook for Cloudflare. Wildcard names require DNS validation, so webroot and standalone modes cannot issue them. The acme.sh README points to its wiki's dnsapi page for the list of supported DNS providers, and you should check that page for the hook name and credential variables for your provider.

Can acme.sh issue certificates for internal names?

Whether acme.sh can issue certificates for internal names depends on whether the certificate authority can validate them. Public CAs validate names through challenges such as HTTP-01, TLS-ALPN-01 or DNS-01, which require the name to be reachable or controllable from the public internet or from a DNS zone you control. Internal names that resolve only on a private network generally cannot be validated by a public CA through these challenges. For internal names, confirm whether your CA supports the names you need, or consider an internal certificate authority, and check the acme.sh README for the challenge modes that suit your environment.

When should a team get outside help with acme.sh renewals?

Get outside help when renewals fail in ways your team cannot diagnose, when you need to migrate from one CA to another across many services, or when certificates must meet compliance controls that your team has not yet documented. Outside help is also useful when you plan a move to shorter certificate lifetimes, since that change multiplies the number of renewals and the places they must succeed. DeployOpen plans and implements self-hosted certificate automation inside your own infrastructure, and most engagements are fixed-scope, with scope and timelines agreed in writing before work starts. DeployOpen does not publish a price list, so a quote follows from the written scope.

When acme.sh automation needs outside help

Bring in outside help when the number of certificates or the number of targets outgrows what one shell script and a daily cron job can reliably manage. acme.sh renews certificates from a single host, and each service on that host has to be wired up with acme.sh --install-cert and a --reloadcmd. If your estate has dozens of services, load balancers, appliances or network devices that acme.sh cannot reach through a hook, the install and reload logic for each one becomes the real workload, and it has to be written, tested and kept working through every upgrade. Confirm in your own inventory how many endpoints need a certificate, which of them accept a file copy and a reload command, and which need a vendor API or a manual step. The acme.sh README documents the install and reload flow; the vendor documentation for each appliance decides whether it can be reached that way at all.

Regulated environments need a different kind of help. If your auditors expect evidence of each renewal, such as who ran it, when, which CA issued the certificate, and that the service accepted it, a daily cron job writing to /dev/null does not provide that record on its own. The installer's cron line sends output to /dev/null, so logging, alerting and retention of renewal results have to be designed in deliberately. Similarly, if the environment has no POSIX shell, restricted or absent cron, or policies that forbid running a shell client under a service account, acme.sh may not fit as installed. Ask your security and platform teams to confirm which of these constraints apply before you commit to a design. A partner can build the logging, the scheduling and the evidence trail to match your controls and hand over the results for review.

The last case is time. Writing and testing DNS provider hooks, reload commands and renewal checks for each target takes engineering effort that is hard to estimate in advance, and it has to be retested whenever the CA, the DNS provider or the target software changes. If your team lacks that time, or wants the work fixed in writing before it starts, a fixed-scope engagement from DeployOpen can cover the inventory, the hooks, the reload paths and the verification, with deliverables agreed in advance. DeployOpen does not publish prices, so ask for a written scope and quote. Any cost estimate should come from that scope, and you should confirm the effort in your own environment before accepting it.

How an acme.sh renewal moves from cron to the reloaded service

The daily cron entry installed by acme.sh runs acme.sh --cron, which checks each certificate against its renewal window, including the CA's ARI suggested window where the CA advertises renewalInfo. When a renewal is due, validation runs through the configured mode (webroot, standalone or DNS), the CA issues the certificate, and acme.sh installs it to the key and fullchain paths you set with --install-cert. The --reloadcmd then runs against the service. Check that cron is active, that the install paths are the ones the service reads, and that the reload command succeeds after a test run with --renew --force.

The path from the daily cron entry to the reloaded service.

How DeployOpen works on this

DeployOpen plans and builds acme.sh deployments in your own infrastructure, from the shell install and cron schedule through DNS hooks and service reloads. We scope each engagement in writing, build it against your platforms, and hand over documentation and support.

How we scope

  • We list every host, web server and service that needs a certificate and the CA each one will use.
  • We record which challenge types apply, such as webroot, standalone, DNS or DNS persist, for each name.
  • The written scope sets deliverables and timelines before work starts, and ongoing support can be added as a retainer.

How we build

  • We install acme.sh without root, confirm the daily cron entry runs, and set the default CA and key type.
  • We configure DNS provider hooks for wildcard names and install certificates with reload commands for each service.
  • We test forced renewal, removal and the upgrade settings on staging before anything moves to production.

How we hand over

  • We document each certificate's issue command, install path, reload command and the cron job that renews it.
  • We walk your operations team through checking renewal status, forcing a renewal and removing a certificate.
  • We record which upgrade setting you chose, with the steps to enable or disable auto-upgrade later.

How we support

  • Support can cover monitoring of renewals, responses to failed challenges and updates to DNS hook credentials.
  • We can review acme.sh upgrades and CA changes, including whether the ARI renewal window behaves as expected.
  • Retainers are available for continuous support, and you should confirm response times in your written scope.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.