Automating SSL certificate issuance is now standard practice in modern web infrastructure management. acme.sh combined with the BEST-HOSTING DNS API lets you fully automate the retrieval and renewal of SSL/TLS certificates — including wildcard certificates — with zero manual effort.
acme.sh is an open-source shell script that implements the ACME protocol (Automatic Certificate Management Environment), used by certificate authorities like ZeroSSL, Let's Encrypt, and others to automatically issue trusted SSL/TLS certificates for free.
acme.sh is one of the most widely used ACME clients in the world — popular for its portability (no dependencies beyond a shell), simple installation, and broad support for DNS providers via DNS API plugins.
When issuing an SSL certificate, the certificate authority needs to verify that you actually control the domain. The most common method is HTTP verification — by placing a file on your web server. But that's not always an option, for example with:
*.example.com), where HTTP verification simply doesn't work by design,That's where the DNS-01 challenge comes in: instead of a file on your web server, the certificate authority verifies the existence of a special TXT record in your domain's DNS zone. The entire process can be fully automated via DNS API — acme.sh adds and removes the TXT record automatically.
BEST-HOSTING operates its own REST API for managing DNS records, designed primarily for the DNS-01 challenge automation during SSL certificate issuance. The API lets you programmatically add and remove TXT records in DNS zones managed on our platform.
Our dns_bh plugin has been accepted into the official acme.sh distribution, where it's available as part of the standard installation. There's nothing to download manually — the plugin is ready to use right after you install acme.sh.
SSL automation via the BEST-HOSTING DNS API is a great fit for anyone who:
Access to the DNS API is protected by a unique pair of credentials (BH_API_USER and BH_API_KEY), which each customer generates independently in the BEST-HOSTING customer portal under Profile / REST API.
We recommend:
BH_API_USER, BH_API_KEY) generated in the customer portal
curl https://get.acme.sh | sh -s email=your@email.com
After installation, restart your shell — the easiest way is to log out and back in — or run:
source ~/.bashrc
export BH_API_USER="your_api_user"
export BH_API_KEY="your_api_key"
acme.sh will save your credentials after the first successful use and reuse them automatically for renewals or issuing new certificates. To persist them permanently at the shell level, you can also add these lines to ~/.bashrc or ~/.profile.
Single domain certificate:
acme.sh --issue --dns dns_bh -d example.com --dnssleep 120
Wildcard certificate (domain + all subdomains):
acme.sh --issue --dns dns_bh -d example.com -d '*.example.com' --dnssleep 120
Multi-domain certificate (SAN certificate):
acme.sh --issue --dns dns_bh \
-d example.com \
-d '*.example.com' \
-d example2.com \
--dnssleep 120
The
--dnssleepparameter tells acme.sh to wait before verification to allow the TXT record to propagate across DNS. 120 seconds is the recommended safe interval.
Once issued, you can deploy the certificate to your target application, for example with nginx:
acme.sh --install-cert -d example.com \
--cert-file /etc/nginx/ssl/example.com.crt \
--key-file /etc/nginx/ssl/example.com.key \
--fullchain-file /etc/nginx/ssl/example.com.fullchain.crt \
--reloadcmd "systemctl reload nginx"
acme.sh remembers all parameters from the initial issuance and will automatically renew your certificate approximately 30 days before it expires. A cron job is added automatically during installation — renewals happen completely hands-free.
You can check the status of automatic renewals at any time:
acme.sh --list
acme.sh supports sending notifications when a certificate is issued or renewed — including failure alerts. This is especially useful in automated environments where you want to know whether renewal was successful without having to check manually.
Supported platforms include Telegram, Discord, Slack, Matrix, email via SMTP, Pushover, and more. Notifications are configured once and apply to all certificates managed by that acme.sh installation.
Discord:
export DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/..."
acme.sh --set-notify \
--notify-hook discord \
--notify-level 2
Telegram:
export TELEGRAM_BOT_APITOKEN="your_bot_token"
export TELEGRAM_CHAT_ID="your_chat_id"
acme.sh --set-notify \
--notify-hook telegram \
--notify-level 2
The
--notify-levelparameter controls when notifications are sent:
0— disabled1— on failure only2— on successful renewal or on failure3— always, even when no renewal was needed — every day
Have questions or need help getting set up? Reach out to our technical support team.