Production-ready pure Bash Let's Encrypt certificate automation with Marzban, Pasarguard, PasarguardBot, PG-Node, and manual deployment.
No Python required — works on any Linux server with Bash.
- Certificate issuance via
certbotoracme.sh(auto-detected) - Single domain, SAN (multiple domains), and wildcard (
*.example.com) - DNS challenge for wildcards with pluggable DNS providers (Cloudflare first)
- Panel integration: Marzban, Pasarguard, PasarguardBot, PG-Node, or manual/custom path
- Interactive CLI with numeric panel selection (1/2/3/4)
- Manual renewal via
autossl renew(no background service) - Expiration checker, logging, dry-run mode
- Backup existing certificates before overwrite
# One-liner
bash <(curl -Ls https://raw.githubusercontent.com/AmirKenzo/Auto-SSL-Domain/main/scripts/install.sh)
# Or clone and install
git clone https://github.com/AmirKenzo/Auto-SSL-Domain.git
cd Auto-SSL-Domain
sudo bash scripts/install.shsudo autossl
sudo autossl issuesudo autossl issue
# Enter: example.com
# Choice [1-5]: 2 (Marzban)sudo autossl issue
# Enter: example.com www.example.com api.example.comPort 80 must be free. No Cloudflare token needed.
sudo autossl issue
# Enter: example.com www.example.comsudo autossl issue
# Enter: *.example.com example.com
# Add TXT record when prompted, then press Enterexport CF_Token="your_cloudflare_api_token"
sudo autossl issue
# Enter: *.example.com example.comsudo autossl --dns issue
# Manual TXT if no API key, automatic if CF_Token is setsudo autossl --dry-run issuesudo autossl --backend certbot issue
sudo autossl --backend acme.sh issuesudo autossl listShows all certs, domains (SAN), panel path, expiry date and days remaining.
sudo autossl renew
sudo autossl renew -d example.com
sudo autossl check
sudo autossl check -d example.com --warn-days 14sudo autossl update # pull latest from GitHub
sudo autossl uninstall # remove tool (asks before deleting config)| Panel | Path |
|---|---|
| Marzban | /var/lib/marzban/certs/<domain>/ |
| Pasarguard | /var/lib/pasarguard/certs/<domain>/ |
| PasarguardBot | /var/lib/pasarguardbot/certs/<domain>/ |
| PG-Node | /var/lib/pg-node/certs/<domain>/ |
| None | /etc/autossl/certs/<domain>/ or custom |
Each domain folder:
fullchain.pem
privkey.pem
Unlike Marzban/Pasarguard, selecting PasarguardBot also wires the certificate into the bot itself:
- If PasarguardBot is installed at
/opt/pasarguardbot(its.envfile exists), AutoSSL setsSSL_CERTFILEandSSL_KEYFILEin/opt/pasarguardbot/.envto point at the deployedfullchain.pem/privkey.pem, then runspasarguardbot restartto apply it (HTTPS in PasarguardBot's API server). - If PasarguardBot isn't found at that path, AutoSSL only deploys the cert files and logs a message asking you to set
SSL_CERTFILE/SSL_KEYFILEmanually. - This also happens automatically on
autossl renewfor any domain tracked with the PasarguardBot panel.
Never required. Without API key, DNS challenges use manual TXT records.
Set API key only if you want automatic DNS:
export CF_Token="your_api_token"
# or edit /etc/autossl/cloudflare.ini (uncomment and set token)sudo autossl renew
sudo autossl renew -d example.comautossl.sh
lib/
├── common.sh
├── domain.sh
├── dns.sh
├── issuer.sh
├── deploy.sh
├── backup.sh
├── panels.sh
├── state.sh
├── expiration.sh
└── renewal.sh
scripts/install.sh
- Add
detect_dns_yourprovider()inlib/dns.sh - Call it from
detect_dns_provider()
| Path | Purpose |
|---|---|
/var/log/autossl/autossl.log |
Main log |
/etc/autossl/state/<domain>.conf |
Per-domain state |
- Linux (Debian/Ubuntu, RHEL, Arch, …)
- Bash 4+ (pre-installed on all Linux servers)
certbotoracme.shopenssl,curl,socat,dig- Root/sudo access
MIT