This guide will help you set up and use the Acme.sh to get SSL certificates for your website.
Before we begin, make sure you have:
| Term | What It Means |
|---|---|
| DNS Provider | The company that manages your domain name (examples: Cloudflare, GoDaddy, Namecheap) |
| API Token | A special password that lets the Acme.sh talk to your DNS provider automatically |
| EAB Credentials | Special codes your administrator gives you to verify you're allowed to get certificates |
| Terminal/Command Line | A window where you type commands to tell your computer what to do (like a text-based control panel) |
The Acme.sh is a small program that automatically gets and renews SSL certificates for you. Think of it as your personal certificate assistant that works in the background.
First, you need to open your terminal (command line):
Now we'll download and install the Acme.sh. Copy and paste this command into your terminal, then press Enter:
curl https://get.acme.sh | sh -s email=your-email@example.com
Important: Replace 'your-email@example.com' with your actual email address.This command downloads the Acme.sh and installs it to your computer. It only takes a few seconds.
After installation, you need to 'activate' the tool by telling your terminal where to find it. Type these commands one at a time:
source ~/.bashrc
These commands refresh your terminal so it knows about the new Acme.sh.
Let's make sure everything installed correctly. Type this command:
acme.sh --version
You should see something like this:
https://github.com/acmesh-official/acme.sh
v3.0.7
If you see version information like above, congratulations! The tool is installed correctly.
Enable automatic updates so the tool stays up-to-date with the latest security features:
acme.sh --upgrade --auto-upgrade
Great job! The Acme.sh is now installed and ready to use.
Now we need to create a configuration file that tells the Acme.sh where to get certificates and how to connect to your DNS provider. Think of this as filling out a form with your account information.
First, create a folder to store your settings:
mkdir -p ~/.acme.sh/config
This creates a hidden folder called '.acme.sh/config' in your home directory.
Now, open a text editor to create your configuration file:
nano ~/.acme.sh/config/acme-server.env
This opens a simple text editor where you'll add your settings.
Copy and paste this template into the editor, then replace the placeholder values with your actual information:
# Server Information
export ACME_SERVER="https://demo.acme-server.com/directory"
export EMAIL="admin@example.com"
# Your Access Codes (get these from your administrator)
export EAB_KEY="YOUR_EAB_KEY_HERE"
export HMAC_KEY="YOUR_HMAC_KEY_HERE"
# Timeout Settings (how long to wait for responses)
export Le_HTTPTimeout=600
export Le_DNSSleep=120
# Cloudflare Connection (if using Cloudflare)
export CF_Token="YOUR_CLOUDFLARE_TOKEN_HERE"
export CF_Account_ID="YOUR_CLOUDFLARE_ACCOUNT_ID"
This example demonstrates DNS configuration using Cloudflare. If you are using a different DNS provider, please refer to the supported DNS providers list to check compatibility.
What to replace:
This file contains sensitive information, so we need to protect it. Run this command:
chmod 600 ~/.acme.sh/config/acme-server.env
This makes sure only you can read this file, keeping your credentials safe.
The Acme.sh needs permission to update your DNS records automatically. If you use Cloudflare (a popular DNS provider), follow these steps to create an API token.

Now set up what this token can do. Make sure these settings are correct:
Zone Resources:
Click 'Continue to summary'
Click 'Create Token'
Important! Cloudflare will show your token only once. You need to copy it now.
Let's make sure the token works. First, load your configuration:
source ~/.acme.sh/config/acme-server.env
Then test the connection, use CURL:
curl -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \
-H "Authorization: Bearer $CF_Token" \
-H "Content-Type: application/json"
If your token is working, you'll see:
{ "success": true, "result": { "status": "active" } }
Perfect! Your Cloudflare connection is working.
Now we need to register your account with the certificate server. This tells the server, 'Hello, I'm allowed to request certificates.'
source ~/.acme.sh/config/acme-server.env
acme.sh --register-account \
--server "$ACME_SERVER" \
--eab-kid "$EAB_KEY" \
--eab-hmac-key "$HMAC_KEY"
You should see a success message like this:
[Mon Feb 9 10:30:00 UTC 2026] Registering account
[Mon Feb 9 10:30:01 UTC 2026] Registered
Excellent! Your account is now registered.
Great work! You've successfully completed the installation and setup. Here's what you accomplished:
Now that everything is set up, you're ready to request and install SSL certificates!
Check out the next guide: “Acme.sh Deployment Guide” to learn how to request, renew, and install an SSL certificate for your domain under different server environments.