### Install acme.sh from Git clone Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-install Installs acme.sh by cloning the repository and then running the install script. Replace 'my@example.com' with your email address. ```bash git clone --depth 1 https://github.com/acmesh-official/acme.sh.git cd acme.sh ./acme.sh --install -m my@example.com ``` -------------------------------- ### Example: Issue Certificate with Let's Encrypt tlsserver Profile Source: https://github.com/acmesh-official/acme.sh/wiki/Profile-selection Requests a certificate using Let's Encrypt's 'tlsserver' profile. Ensure the webroot path is correct for your setup. ```bash acme.sh --issue --server letsencrypt -d example.com \ -w /home/username/public_html \ --cert-profile tlsserver ``` -------------------------------- ### Enable Logging During Installation Source: https://github.com/acmesh-official/acme.sh/wiki/Enable-acme.sh-log Use the --log parameter when installing acme.sh to enable logging from the start. This setting persists for future operations. ```bash acme.sh --install --log ``` -------------------------------- ### Pre/Post Hook for Standalone Server Source: https://context7.com/acmesh-official/acme.sh/llms.txt Execute shell commands before and after certificate operations. This example stops and starts Nginx for standalone challenges. ```shell acme.sh --issue -d example.com --standalone \ --pre-hook "systemctl stop nginx" \ --post-hook "systemctl start nginx" \ --renew-hook "echo 'cert renewed for example.com' | mail -s 'Cert Renewed' admin@example.com" ``` -------------------------------- ### Install acme.sh from Git Source: https://github.com/acmesh-official/acme.sh/blob/master/README.md Installs acme.sh by cloning the repository and running the install script. This method allows for advanced installation options. ```bash git clone https://github.com/acmesh-official/acme.sh.git cd ./acme.sh ./acme.sh --install -m my@example.com ``` -------------------------------- ### Install acme.sh from GitHub using wget Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-install Installs acme.sh by downloading the script directly from GitHub using wget and executing it with installation options. Replace 'my@example.com' with your email address. ```bash wget -O - https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh | sh -s -- --install-online -m my@example.com ``` -------------------------------- ### Install acme.sh using wget Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-install Installs acme.sh by downloading the script via wget and executing it. Replace 'my@example.com' with your email address. ```bash wget -O - https://get.acme.sh | sh -s email=my@example.com ``` -------------------------------- ### Install acme.sh from GitHub using curl Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-install Installs acme.sh by downloading the script directly from GitHub using curl and executing it with installation options. Replace 'my@example.com' with your email address. ```bash curl https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh | sh -s -- --install-online -m my@example.com ``` -------------------------------- ### Run Netlify DNS API Test Locally Source: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test Example of setting up environment variables and executing a test for the Netlify DNS API. ```bash export NETLIFY_ACCESS_TOKEN="xxxx" acme.sh --issue -d mytest.myExample.com --dns dns_netlify ``` -------------------------------- ### Install Certificates for lighttpd Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-run-on-DD-WRT-with-lighttpd Installs the generated certificates to the location expected by lighttpd. This step is crucial for lighttpd to serve traffic over HTTPS. ```bash ``` -------------------------------- ### Start FreeBSD VM with AnyVM.org Source: https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM Use this command to initiate a FreeBSD virtual machine locally. Refer to AnyVM.org documentation for advanced configurations and options. ```bash python3 anyvm.py --os freebsd ``` -------------------------------- ### Install acme.sh Online Source: https://github.com/acmesh-official/acme.sh/blob/master/README.md Installs acme.sh using curl or wget. Replace 'my@example.com' with your email address. ```bash curl https://get.acme.sh | sh -s email=my@example.com ``` ```bash wget -O - https://get.acme.sh | sh -s email=my@example.com ``` -------------------------------- ### DNS TXT Record Example (dig output) Source: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Dev-Guide Example output from 'dig' command showing TXT records for a wildcard certificate challenge. This illustrates the expected format for DNS TXT records. ```text ; <<>> DiG 9.10.3-P4-Ubuntu <<>> -t txt _acme-challenge.example.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35476 ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4000 ;; QUESTION SECTION: ;_acme-challenge.example.com. IN TXT ;; ANSWER SECTION: _acme-challenge.example.com. 3600 IN TXT "tye6yGOxJEffnXDzZKNJjOHSsCFtKwU_5L0ykmY8CzE" _acme-challenge.example.com. 3600 IN TXT "XhVGx_0VVeR5yiaGLHHXrRl2sAbZhI7IugMSdbfR4go" ``` -------------------------------- ### Install acme.sh using curl Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-install Installs acme.sh by downloading the script via curl and executing it. Replace 'my@example.com' with your email address. ```bash curl https://get.acme.sh | sh -s email=my@example.com ``` -------------------------------- ### Example Hexonet Login Format Source: https://github.com/acmesh-official/acme.sh/wiki/dnsapi2 Illustrates the correct format for the Hexonet_Login environment variable, combining username and role ID. ```sh export Hexonet_Login='neilpang!testid' ``` -------------------------------- ### Install Dependencies on Ubuntu/Debian Source: https://github.com/acmesh-official/acme.sh/wiki/Install-preparations Installs openssl, cron, socat, and curl using apt-get on Ubuntu or Debian systems. ```bash apt-get install openssl cron socat curl ``` -------------------------------- ### Setup Webserver Challenge Directory Source: https://github.com/acmesh-official/acme.sh/wiki/sudo Creates a directory for acme.sh challenges and sets ownership to the non-root user when using the webserver method. ```sh sudo mkdir -p /var/www/EXAMPLE.COM/htdocs/.well-known/acme-challenge sudo chown acme:acme /var/www/EXAMPLE.com/htdocs/.well-known/acme-challenge ``` -------------------------------- ### Extended Description for Software/Protocol API Source: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Structural-Info-description This example shows how to format provider information when the API is for software or a protocol rather than a specific domain provider. The title is descriptive text, and subsequent lines starting with a space provide an extended description. ```shell dns_acmedns_info='acme-dns Server API The acme-dns is a limited DNS server with RESTful API to handle ACME DNS challenges. Site: github.com/joohoi/acme-dns ' ``` -------------------------------- ### Install Certificate for Nginx Source: https://github.com/acmesh-official/acme.sh/blob/master/README.md Installs a certificate and key for Nginx, reloading the service. Ensure the reload command is correct for your system. ```bash 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" ``` -------------------------------- ### Set Both Start and Expiration Dates (Relative) Source: https://github.com/acmesh-official/acme.sh/wiki/Validity Combine relative --valid-from and --valid-to durations to specify the certificate's validity period. The example shows a relative start time and a relative expiration duration. ```bash # The cert will be valid in 2 hours, and then live for 50 days to expire: acme.sh --issue -d example.com --dns dns_cf --valid-from "+2h" --valid-to "+50d" ``` -------------------------------- ### Install SSL Certificate for SolusVM Master (Nginx) Source: https://github.com/acmesh-official/acme.sh/wiki/Deploy-ssl-to-SolusVM Installs the issued certificate and key to the Nginx SSL directory. It also restarts the Nginx service, sshwebsocket, and generates an ssl.pem file for novnc websockify. ```bash acme.sh --installcert -d solusvm.yourdomain.com --keypath /usr/local/svmstack/nginx/ssl/ssl.key --fullchainpath /usr/local/svmstack/nginx/ssl/ssl.crt --reloadcmd "service svmstack-nginx restart; /usr/local/svmstack/sshwebsocket/quit; /usr/local/svmstack/sshwebsocket/port_check; cd /usr/local/svmstack/nginx/ssl && cat ssl.key ssl.crt > ssl.pem" ``` -------------------------------- ### Initiate SSH Deploy Hook Source: https://github.com/acmesh-official/acme.sh/wiki/deployhooks Use this command to start the certificate deployment process using the SSH deploy hook. ```sh acme.sh --deploy -d example.com --deploy-hook ssh ``` -------------------------------- ### Install Dependencies on Alpine Linux Source: https://github.com/acmesh-official/acme.sh/wiki/Install-preparations Installs openssl, curl, and socat using apk on Alpine Linux systems. ```bash apk --no-cache add -f openssl curl socat ``` -------------------------------- ### Run DNS API Test Locally Source: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test Example of how to set environment variables and run a DNS API test from the command line. ```bash export MyDnsKey1=myValue1 export MyDnsKey2=myValue2 acme.sh --issue -d mytest.myExample.com --dns dns_myapi ``` -------------------------------- ### Install acme.sh Packages on OpenWrt Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-run-on-OpenWrt Installs the acme.sh client and optional DNS API support for certificate verification. Use the second command if the first fails. ```bash opkg install luci-ssl-openssl acme luci-app-acme ``` ```bash opkg install acme-acmesh-dnsapi ``` ```bash opkg install acme-dnsapi ``` -------------------------------- ### Install and Configure acme.sh for User 2 Source: https://github.com/acmesh-official/acme.sh/wiki/Utilize-multiple-DNS-API-keys This snippet demonstrates setting up acme.sh for a second user, including exporting a different API key. This approach is useful for isolating configurations and keys between different user accounts. ```bash su acmeuser2 curl https://get.acme.sh | sh -s email=my@example.com source ~/.acme.sh/acme.sh.env export MYDNS_APIKey2=xxxxxxx acme.sh --issue -d domain1.com --dns .... ``` -------------------------------- ### Install Certificate with Custom Paths and Reload Commands Source: https://github.com/acmesh-official/acme.sh/wiki/sudo Installs a certificate, specifying custom paths for the key, CA, and full chain, and defines commands to reload services upon successful installation. ```sh acme.sh --installcert -d mail.example.com --keypath /etc/ssl/acme/example.com.key --capath /etc/ssl/acme/example.com.ca --fullchainpath /etc/ssl/acme/example.com.crt --reloadcmd "sudo /etc/init.d/postfix restart && sudo /etc/init.d/dovecot restart" ``` -------------------------------- ### Install Dependencies on Kali Linux Source: https://github.com/acmesh-official/acme.sh/wiki/Install-preparations Installs openssl, cron, socat, and curl using apt-get on Kali Linux systems. ```bash apt-get -qqy install openssl cron socat curl ``` -------------------------------- ### --install-cert (Install Certificate to Server) Source: https://context7.com/acmesh-official/acme.sh/llms.txt Copies the issued certificate files to the specified target paths on the server and executes a reload command to apply the new certificate. Settings are persisted for automatic renewal and re-deployment. ```APIDOC ## --install-cert (Install Certificate to Server) ### Description Copy issued cert files to target paths and run a reload command. Settings are persisted so future renewals automatically re-deploy. ### Method `acme.sh --install-cert` ### Parameters #### Path Parameters None #### Query Parameters - **-d DOMAIN** (string) - Required - The domain for which the certificate was issued. - **--key-file KEY_PATH** (string) - Required - Path to save the private key file. - **--fullchain-file FULLCHAIN_PATH** (string) - Required - Path to save the full chain certificate file. - **--cert-file CERT_PATH** (string) - Optional - Path to save the certificate file (often included in fullchain). - **--ca-file CA_PATH** (string) - Optional - Path to save the CA certificate file. - **--reloadcmd RELOAD_COMMAND** (string) - Required - Command to reload the web server or service. - **--ecc** (flag) - Optional - Flag to indicate if the certificate uses an ECC key. ### Request Example ```sh # Install to Nginx acme.sh --install-cert -d example.com \ --key-file /etc/nginx/ssl/example.com.key \ --fullchain-file /etc/nginx/ssl/example.com.crt \ --reloadcmd "systemctl reload nginx" # Install to Apache acme.sh --install-cert -d example.com \ --cert-file /etc/apache2/ssl/cert.pem \ --key-file /etc/apache2/ssl/key.pem \ --ca-file /etc/apache2/ssl/ca.pem \ --fullchain-file /etc/apache2/ssl/fullchain.pem \ --reloadcmd "service apache2 force-reload" # Install ECC cert acme.sh --install-cert -d example.com --ecc \ --key-file /etc/nginx/ssl/example.com.key \ --fullchain-file /etc/nginx/ssl/example.com.crt \ --reloadcmd "systemctl reload nginx" ``` ### Response #### Success Response Upon successful installation, certificate files are copied and the reload command is executed. #### Response Example (No specific response body is detailed, but successful execution implies certificate files are deployed and the service is reloaded.) ``` -------------------------------- ### Install GNU sed and wget on Solaris Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-use-on-Solaris-based-operating-sytsems Installs the required GNU sed and wget packages using the pkg command. Ensure you have the necessary permissions to install packages. ```bash pkg install gnu-sed wget ``` -------------------------------- ### Install Certificate for Apache Source: https://github.com/acmesh-official/acme.sh/blob/master/README.md Installs a generated certificate into Apache configuration files. Use this command to copy certs to their final destination, not the internal acme.sh folder. ```bash acme.sh --install-cert -d example.com \ --cert-file /path/to/certfile/in/apache/cert.pem \ --key-file /path/to/keyfile/in/apache/key.pem \ --fullchain-file /path/to/fullchain/certfile/apache/fullchain.pem \ --reloadcmd "service apache2 force-reload" ``` -------------------------------- ### Install SSL Certificate with acme.sh Source: https://github.com/acmesh-official/acme.sh/wiki/Deploy-ssl-certs-to-apache-server Run this command to install the SSL certificate and key files. The parameters should be configured in your .acme.sh configuration file. The 'reloadcmd' parameter is OS-dependent. ```bash acme.sh --install-cert -d online.domain.com \ --cert-file /etc/apache2/ssl/online.domain.com-cert.pem \ --key-file /etc/apache2/ssl/online.domain.com-key.pem \ --fullchain-file /etc/apache2/ssl/fullchain.pem \ --reloadcmd "service apache2 force-reload" ``` -------------------------------- ### Advanced acme.sh Installation Source: https://context7.com/acmesh-official/acme.sh/llms.txt Performs an advanced installation from a git clone, allowing custom directories and disabling the cron job. Verify the installation with `acme.sh --version`. ```sh git clone --depth 1 https://github.com/acmesh-official/acme.sh.git cd acme.sh ./acme.sh --install \ --home ~/myacme \ --config-home ~/myacme/data \ --cert-home ~/mycerts \ --accountemail "my@example.com" \ --nocron ``` ```sh # Verify installation acme.sh --version # acme.sh v3.1.4 ``` -------------------------------- ### Register Account with LetsEncrypt CA Source: https://github.com/acmesh-official/acme.sh/wiki/Server Example of registering an account using the 'letsencrypt' CA. This command requires specifying the server and an email address. ```bash acme.sh --register-account --server letsencrypt -m myemail@example.com ``` -------------------------------- ### Install opkg and CA Certificates Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-run-on-DD-WRT-with-lighttpd Installs the opkg package manager and CA certificates required for HTTPS communication. Ensure JFFS is enabled and mounted to /opt. ```bash opkg update; opkg install ca-certificates socat ``` -------------------------------- ### Netim DNS API Setup and Usage Source: https://github.com/acmesh-official/acme.sh/wiki/dnsapi2 Set environment variables for Netim user and secret. Then, issue a certificate using the dns_netim provider. ```shell export NETIM_USER='XX1234' export NETIM_SECRET='mypassword' ./acme.sh --issue --dns dns_netim -d example.domain.com ``` -------------------------------- ### Example BuyPass Certificate Source: https://github.com/acmesh-official/acme.sh/wiki/BuyPass.com-CA This is an example of a certificate issued by BuyPass, showing its BEGIN/END markers and key details. ```text -----BEGIN CERTIFICATE----- MIIGbDCCBFSgAwIBAgIKCRFsFobOdP0VfTANBgkqhkiG9w0BAQsFADBLMQswCQYD VQQGEwJOTzEdMBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMM FEJ1eXBhc3MgQ2xhc3MgMiBDQSA1MB4XDTE4MTIyOTAxMzIyNVoXDTE5MDYyNzIx NTkwMFowGjEYMBYGA1UEAwwPYnV5cGFzcy5hY21lLnNoMIIBIjANBgkqhkiG9w0B AQEFAAOCAQ8AMIIBCgKCAQEA0H5zERFpOG5en3JRnIZ6LXxDohtID0IbsdK2vjla ARwuClpJzfcRd0iWZtsV0sUy4zlNv0CZEvwxM1egpL1cEpfrDzMOjpy7OmSyBiEV Y6KxhBr/UNdYWZNaoWEQyHTaaYsEyoMTIL8Wt7uqnoxrVHrY4goYiJTqk8Xk8Skj 3QSLSb/jkLFfCl7gdAbgylXKhq8id5gp7VUnCUB5cp7wq1n6GCbn2k4HRzKLNXT2 4AZm/a+nNbhA6hBRm79hl2lvtefYM7wB+LbDODLT3AxabT3fjHPprAtcZ296H+gG +w11urMCOtgADU9jgLikXkQNPQ1ZffbANs5+lN5MAwyNYwIDAQABo4ICgTCCAn0w CQYDVR0TBAIwADAfBgNVHSMEGDAWgBQnUqRvLSqrQJOQ7NZpy/58YTt8QjAdBgNV HQ4EFgQUYtkEq1qyZWbHkD5GhIhHxqALb+8wDgYDVR0PAQH/BAQDAgWgMB0GA1Ud JQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSAEGDAWMAoGCGCEQgEaAQIH MAgGBmeBDAECATA6BgNVHR8EMzAxMC+gLaArhilodHRwOi8vY3JsLmJ1eXBhc3Mu bm8vY3JsL0JQQ2xhc3MyQ0E1LmNybDAvBgNVHREEKDAmgg9idXlwYXNzLmFjbWUu 7iCE3d3dy5idXlwYXNzLmFjbWUuc2gwagYIKwYBBQUHAQEEXjBcMCMGCCsGAQUF BzABhhdodHRwOi8vb2NzcC5idXlwYXNzLmNvbTA1BggrBgEFBQcwAoYpaHR0cDov L2NydC5idXlwYXNzLm5vL2NydC9CUENsYXNzMkNBNS5jZXIwggEFBgorBgEEAdZ5 AgQCBIH2BIHzAPEAdgC72d+8H4pxtZOUI5eqkntHOFeVCqtS6BqQlmQ2jh7RhQAA AWf3l0qaAAAEAwBHMEUCICYVuYUQuwAqgWv0dlM/p6+nbHOkrod/t+US2Qua1Ybw AiEA8YS0Nh/N7opKZF4p8g3vaICQG2g/Y8uqKUuTA3Dz1IIAdwBVgdTCFpA2AUrq C5tXPFPwwOQ4eHAlCBcvo6odBxPTDAAAAWf3l0vpAAAEAwBIMEYCIQDyRw4nBKTF qIVL8NX7vROojrXu4wpeRjx2PGsPKFl4fwIhAJyE9KedaBY7QP/YQp1JKm9gXw64 2KSv3vizaM1xSQ2DMA0GCSqGSIb3DQEBCwUAA4ICAQCMUUgNvRZrUBF0yZD1MKvd aJ7UuGqisfuJroDhFHNFWqhahIPr3kFOA1YWTZdg/8xlnkfwZ5Q4qoC9U4y08Iy7 +nyzSHohDg1uH16JiuLyh1I/aq34wDWGEzRAKHL3FGRQYE8+xk3xT5lzVjZpuc07 sxjez02Mbd5UbrflRXjT+l0KAC2kUrZ1CI8CjHdmA74RL3GRIL/hZaWBDTp64xr/ QKJqXUKZdUIY2CGUTDKKF/RVdLqHle3wF2u0Hog/10HwlTf/KRmohPdD4XPGrU1Y PKSfP5HGIhAPOSAbpyeR0wN0GAR84VNF2PVgttqtJCAqVLfs8dscMDce4Yujrg4a i+aTB5pPb0fm+wa+z6kwFtu8Aauag9jN7bAw13dq6VpiLxVCPBa1mmMgjJCj5Abl rcV5itofkhz1E/ZVTH+k2KzBICqE2DZkxLVGEuhY9k6RuicY6FWZ83eIZKx3Dmci 2FBnNob0b1jvC79lo3eyDB6G8+dFs29l8RvrNLdxiZlidLJdjbcEQd+OZ3ZWlVS7 cw3G6VZh1+8limcZechXCa/aonf2JyadWfCxZRZRJsy1NMLT7yd3w6haubgZ0f2 a96zwu5nXXQ7xbawEajLy6Qll9yejmKSVUVoyTH1AoZoaA/NOnjnQXveeiktArlg 86H+f+G4O5uuktiHIeAYNg== -----END CERTIFICATE----- ``` -------------------------------- ### Install and Configure acme.sh for User 1 Source: https://github.com/acmesh-official/acme.sh/wiki/Utilize-multiple-DNS-API-keys This snippet shows the process of installing acme.sh as a specific user and setting up an environment variable for a DNS API key. It's intended for use when managing separate acme.sh instances per user. ```bash su acmeuser1 curl https://get.acme.sh | sh -s email=my@example.com source ~/.acme.sh/acme.sh.env export MYDNS_APIKey1=xxxxxxx acme.sh --issue -d domain1.com --dns .... ``` -------------------------------- ### Selectel API v1 Key Setup Source: https://github.com/acmesh-official/acme.sh/wiki/dnsapi Export the API key for Selectel API v1. This key is used for authentication with the Selectel DNS API. ```shell export SL_Key="" ``` -------------------------------- ### Deploy to Linux Server with Nginx via SSH Source: https://github.com/acmesh-official/acme.sh/wiki/deployhooks This example shows deploying certificates to a standard Linux server with Nginx. It configures SSH access and specifies paths for the private key, full chain, and CA certificate. ```sh export DEPLOY_SSH_USER="root" export DEPLOY_SSH_SERVER="example.com" export DEPLOY_SSH_KEYFILE="/etc/letsencrypt/archive/example.com/privkey2.pem" export DEPLOY_SSH_FULLCHAIN="/etc/letsencrypt/archive/example.com/fullchain2.pem" export DEPLOY_SSH_CAFILE="/etc/letsencrypt/archive/example.com/cert2.pem" export DEPLOY_SSH_REMOTE_CMD="systemctl restart nginx" acme.sh --deploy -d example.com --deploy-hook ssh ``` -------------------------------- ### Install acme.sh Online Source: https://context7.com/acmesh-official/acme.sh/llms.txt Installs acme.sh, its alias, and cron job using curl or wget. Specify your email address for registration. ```sh # Install online with your registration email curl https://get.acme.sh | sh -s email=my@example.com ``` ```sh # Or via wget wget -O - https://get.acme.sh | sh -s email=my@example.com ``` -------------------------------- ### Install Certificate to Proxmox with acme.sh Source: https://github.com/acmesh-official/acme.sh/wiki/Home Installs a previously issued certificate to Proxmox, configuring it for the PVE proxy and setting up automatic renewal. ```bash /root/.acme.sh/acme.sh --installcert -d \ --certpath /etc/pve/local/pveproxy-ssl.pem \ --keypath /etc/pve/local/pveproxy-ssl.key \ --capath /etc/pve/local/pveproxy-ssl.pem \ --reloadcmd "systemctl restart pveproxy" ``` -------------------------------- ### Deploy to MyDevil.net Source: https://github.com/acmesh-official/acme.sh/wiki/deployhooks Use the --deploy-hook mydevil option with the domain to deploy the certificate to MyDevil.net. This command will remove the old certificate and install the new one. ```sh acme.sh --deploy --deploy-hook mydevil -d example.com ``` -------------------------------- ### Spaceship DNS API Setup and Usage Source: https://github.com/acmesh-official/acme.sh/wiki/dnsapi2 Configure environment variables for Spaceship API key and secret. Optionally specify the root domain. Then, issue a certificate using the dns_spaceship provider. ```shell export SPACESHIP_API_KEY='8azEY0VMllj859ZqepH7' export SPACESHIP_API_SECRET='JkZcYYVvSgwSAOXugXrBZ38nbhcanwiZvYP1MtTu0erI32Vmdxtcxn0tTGGL7SGW' export SPACESHIP_ROOT_DOMAIN='(Optional) ' ./acme.sh --issue --dns dns_spaceship -d example.domain.com ``` -------------------------------- ### Install SSL Certificate on DD-WRT Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-run-on-DD-WRT-with-lighttpd Use this command to install a certificate for a specific domain on DD-WRT. Replace [ddwrtdomain] with your actual domain. The reloadcmd restarts lighttpd after combining the certificate and key into a single file. ```bash ./acme.sh --install-cert -d [ddwrtdomain] --home /jffs/usr/ssl \ --cert-file /jffs/etc/lighttpd_ssl/host.crt \ --key-file /jffs/etc/lighttpd_ssl/host.key \ --fullchain-file /jffs/etc/lighttpd_ssl/fullchain.crt \ --reloadcmd "cat /jffs/etc/lighttpd_ssl/host.crt /jffs/etc/lighttpd_ssl/host.key > /jffs/etc/lighttpd_ssl/hostkey.pem; stopservice lighttpd; startservice lighttpd" ``` -------------------------------- ### Set Both Start and Expiration Dates (Absolute and Relative) Source: https://github.com/acmesh-official/acme.sh/wiki/Validity Combine --valid-from and --valid-to to specify both the start and end times for certificate validity. The example shows an absolute start date and a relative expiration duration. ```bash # The cert will be valid from "2022-04-01T08:10:33Z", and then live for 40 days to expire: acme.sh --issue -d example.com --dns dns_cf --valid-from "2022-04-01T08:10:33Z" --valid-to "+40d" ``` -------------------------------- ### Deploy to Qiniu.com (Basic) Source: https://github.com/acmesh-official/acme.sh/wiki/deployhooks Export your Qiniu AK and SK as environment variables. Then, use the --deploy-hook qiniu with your domain to deploy the certificate. ```sh $ export QINIU_AK="foo" $ export QINIU_SK="bar" $ acme.sh --deploy -d example.com --deploy-hook qiniu ``` -------------------------------- ### Install Certificate to Apache Source: https://context7.com/acmesh-official/acme.sh/llms.txt Installs a issued certificate to Apache, specifying certificate, key, CA, and fullchain files, along with a reload command. Settings are persisted for automatic renewal deployment. ```sh # Install to Apache acme.sh --install-cert -d example.com \ --cert-file /etc/apache2/ssl/cert.pem \ --key-file /etc/apache2/ssl/key.pem \ --ca-file /etc/apache2/ssl/ca.pem \ --fullchain-file /etc/apache2/ssl/fullchain.pem \ --reloadcmd "service apache2 force-reload" ``` -------------------------------- ### Zonomi API Key Setup Source: https://github.com/acmesh-official/acme.sh/wiki/dnsapi Export the API key for Zonomi DNS API. This key is obtained from the Zonomi website. ```shell export ZM_Key="" ``` -------------------------------- ### Set Certificate Start Date (Relative Days) Source: https://github.com/acmesh-official/acme.sh/wiki/Validity Use --valid-from with a relative duration in days (e.g., +1d) to set the certificate's activation time. ```bash #The cert will be valid in 1 day from now: acme.sh --issue -d example.com --dns dns_cf --valid-from "+1d" ``` -------------------------------- ### Using Technitium DNS via Lexicon `ddns` API Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-use-lexicon-DNS-API This example demonstrates using the Lexicon `ddns` API with Technitium DNS for an internal ACME server. It requires specific TSIG key setup in Technitium and environment variables for the DNS server IP and TSIG token. `--dnssleep 0` is used to skip public DNS checks. ```bash export PROVIDER=ddns # Format: export LEXICON_DDNS_DDNS_SERVER= export LEXICON_DDNS_DDNS_SERVER=10.1.0.5 # Format: export LEXICON_DDNS_TOKEN=:: export LEXICON_DDNS_TOKEN=hmac-sha256:lexicon:12345abcde acme.sh --issue \ -d test.example.com \ --dns dns_lexicon \ --server https://hcv.ff.lan/v1/pki_int/acme/directory \ --dnssleep 0 ``` -------------------------------- ### Install acme.sh Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-use-on-embedded-FreeBSD Install acme.sh using the advanced installation option, specifying the persistent storage path for its home directory. ```shell ./acme.sh --install --home ``` -------------------------------- ### KingHost API Credentials Setup and Issuance Source: https://github.com/acmesh-official/acme.sh/wiki/dnsapi Export KingHost username and password, then issue an SSL certificate. API access must be enabled on the KingHost panel. ```shell export KINGHOST_Username="yourusername" export KINGHOST_Password="yourpassword" ./acme.sh --issue --dns dns_kinghost -d example.com -d *.example.com ``` -------------------------------- ### HestiaCP DNS API Setup and Usage Source: https://github.com/acmesh-official/acme.sh/wiki/dnsapi2 Configure environment variables for HestiaCP host, access key, secret key, and username. Then, issue a certificate using the dns_hestiacp provider. ```shell export HESTIA_HOST="https://panel.domain.com:8083" export HESTIA_ACCESS="your_access_key" export HESTIA_SECRET="your_secret_key" export HESTIA_USER="your_username" acme.sh --issue -d example.com -d *.example.com --dns dns_hestiacp ``` -------------------------------- ### Set Certificate Start Date (Relative Hours) Source: https://github.com/acmesh-official/acme.sh/wiki/Validity Use --valid-from with a relative duration in hours (e.g., +2h) to set the certificate's activation time. ```bash #The cert will be valid in 2 hours from now: acme.sh --issue -d example.com --dns dns_cf --valid-from "+2h" ``` -------------------------------- ### Advanced acme.sh installation Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-install Performs an advanced installation of acme.sh, allowing customization of installation, configuration, certificate, and account directories, along with account email and key. This is useful for managing multiple installations or specific directory structures. ```bash git clone --depth 1 https://github.com/acmesh-official/acme.sh.git cd acme.sh ./acme.sh --install \ --home ~/myacme \ --config-home ~/myacme/data \ --cert-home ~/mycerts \ --accountemail "my@example.com" \ --accountkey ~/myaccount.key \ --accountconf ~/myaccount.conf \ --useragent "this is my client." ``` -------------------------------- ### Register ZeroSSL Account with Email Source: https://github.com/acmesh-official/acme.sh/wiki/ZeroSSL.com-CA Register a new ZeroSSL account using your email address. This is a one-time setup required before issuing certificates. ```bash acme.sh --register-account -m myemail@example.com --server zerossl ``` -------------------------------- ### Enable Logging for Certificate Issuance Source: https://github.com/acmesh-official/acme.sh/wiki/Enable-acme.sh-log If logging was not enabled during installation, you can enable it for any command, such as issuing a certificate, by including the --log parameter. ```bash acme.sh --issue .... --log ``` -------------------------------- ### DNS Provider Info with Options Source: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Structural-Info-description Demonstrates how to declare configuration options for a DNS provider. Options are listed under the 'Options:' section, with each option on a new line. Options can include titles, default values, and optionality markers. ```shell dns_example_info='Example.org Site: Example.org Docs: github.com/acmesh-official/acme.sh/wiki/dnsapi2#dns_example Options: Example_Token API Token Issues: github.com/acmesh-official/acme.sh/issues/9000 Author: Your Name ' ``` -------------------------------- ### Install acme.sh on Synology NAS Source: https://github.com/acmesh-official/acme.sh/wiki/Synology-NAS-Guide Installs acme.sh from source, disabling cron jobs and specifying a custom home directory. Ensure you have wget installed. ```shell sudo su cd ~ wget https://github.com/acmesh-official/acme.sh/archive/master.tar.gz tar xvf master.tar.gz cd acme.sh-master/ ./acme.sh --install --nocron --home /usr/local/share/acme.sh --accountemail "email@gmail.com" source ~/.profile ``` -------------------------------- ### Install acme.sh Source: https://github.com/acmesh-official/acme.sh/wiki/Simple-guide-to-add-TLS-cert-to-cpanel This command downloads and installs the acme.sh script. After installation, you need to log out and log back into SSH, or run 'source ~/.bashrc' to apply the changes. ```bash curl https://get.acme.sh | sh ``` -------------------------------- ### Configure All Notification Parameters Together Source: https://github.com/acmesh-official/acme.sh/wiki/notify Combines multiple notification settings including hooks, level, and mode in a single command. Ensure all desired parameters are included for comprehensive notification setup. ```sh acme.sh --set-notify --notify-hook mailgun --notify-hook mail \ --notify-level 2 \ --notify-mode 0 ``` -------------------------------- ### Deploy RDP Certificate using windows_rdp Hook Source: https://github.com/acmesh-official/acme.sh/wiki/deployhooks This example shows the minimal configuration required to deploy an RDP certificate to a remote Windows host. Ensure the DEPLOY_WIN_RDP_HOST environment variable is set. ```sh export DEPLOY_WIN_RDP_HOST=winserver.example.com acme.sh --deploy -d winserver.example.com --deploy-hook windows_rdp ``` -------------------------------- ### Example Issued Certificate Source: https://github.com/acmesh-official/acme.sh/wiki/Google-Trust-Services-CA This is an example of a certificate issued by Google Trust Services CA. ```pem -----BEGIN CERTIFICATE----- MIIFejCCBGKgAwIBAgIRAIQeIGxefiDpDgAAAAADL4YwDQYJKoZIhvcNAQELBQAw RjELMAkGA1UEBhMCVVMxIjAgBgNVBAoTGUdvb2dsZSBUcnVzdCBTZXJ2aWNlcyBM TEMxEzARBgNVBAMTCkdUUyBDQSAxUDUwHhcNMjIwMzMwMTMzNDM1WhcNMjIwNjI4 MTMzNDM0WjAbMRkwFwYDVQQDExBnY2EubmVpbHBhbmcuY29tMIIBIjANBgkqhkiG 9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvogb9TZAG+wfJ9VA/hcf3NfW/BM8bx+hXfdq BtLAlMhxNRzhI+TBj1y2mFuYPuq7C+cmJVmmcG+zuMka33nEX7RFCn2AMcp2Dh7m frw2jfqhruBqYiaCt74FLHz//O+WNY68LPdYgEuKdh1W0UE5tgcn7sIUGv3ClQVG u5kit7EYViAXD9ey+kImLgdqFeD1n2v79F+nYmu/nAJ8lPXHk1ADmjATxP7tNWmQ XopH/1ThWeiMzb+nCb+y6fs7Fw89Q8ECP3Q+HbBzyWh3x8zptZbb1bh6SrJ7Uz3c yz/M5hcn+EbX5ZNWsoNnYu5O8GPwC5MbLnKEgVQyjUJ0Q34bJQIDAQABo4ICjDCC AogwDgYDVR0PAQH/BAQDAgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAwGA1UdEwEB /wQCMAAwHQYDVR0OBBYEFErTzUpCbi/cp3bNK7i1cc+AF+J0MB8GA1UdIwQYMBaA FNX8ng3fHsrdCJeXbivFX8Ur9ey4MHgGCCsGAQUFBwEBBGwwajA1BggrBgEFBQcw AYYpaHR0cDovL29jc3AucGtpLmdvb2cvcy9ndHMxcDUvRXZZZFdCRVNaY1kwMQYI KwYBBQUHMAKGJWh0dHA6Ly9wa2kuZ29vZy9yZXBvL2NlcnRzL2d0czFwNS5kZXIw LwYDVR0RBCgwJoIQZ2NhLm5laWxwYW5nLmNvbYISKi5nY2EubmVpbHBhbmcuY29t MCEGA1UdIAQaMBgwCAYGZ4EMAQIBMAwGCisGAQQB1nkCBQMwPAYDVR0fBDUwMzAx oC+gLYYraHR0cDovL2NybHMucGtpLmdvb2cvZ3RzMXA1L2h0QUlJRUV0WGNZLmNy bప్రత్యCCAQUGCisGAQQB1nkCBAIEgfYEgfMA8QB2AEHIyrHfIkZKEMahOglCh15OMYsb A+vrS8do8JBilgb2AAABf9s/9SMAAAQDAEcwRQIhAJXQxese0g6ilHanInWFe9wP yZp5jTbIKRZ8T/0DJrmAAiBQcQ4U5bOcvuwHq63IdDTQ3JVLXibT+RMujzCZl1lW jQB3ACl5vvCeOTkh8FZzn2Old+W+V32cYAr4+U1dJlwlXceEAAABf9s/9HoAAAQD AEgwRgIhAPN4hN8H84vkDbz6FQk8/VfypAfnj0J+F9kCwsndMtSBAiEAprEIgKtM i0totuQ8YQK69oATZ9ancTPAE4w9iGBwGDswDQYJKoZIhvcNAQELBQADggEBAIE4 tkICIps1tXncYwnERecZDPeyk7BaeiS4D2gcFnP5zRJI9s6hpwlDLumcAcNMF4DV xT1Xm/GDkvv3c+tAgcYyoKRjeLZcgzZb1TVnG/yWT3Q+vcyNvYy/UuZQuF019plC oCvo5zyV0qeArps3WtyJOQ5QGuEmp8Vr3nQcG0MJpXNgMV1wE9S0TWn7AJ+x2csr G8iQjR+0nJBVqnVCuRDArh2qYFQd/W5zFj46n/Edzx0jrc38RiBorx4IT0Pfm23o +XvkdKDqdDquzq7FdYa5wDXlwQJOuf4BRPBo7a5f4fJpRcL3QSDwewSSHhDKQXFH 74yQYKaw0gRoE71IEmk= -----END CERTIFICATE----- ``` -------------------------------- ### Install Dependencies on CentOS Source: https://github.com/acmesh-official/acme.sh/wiki/Install-preparations Installs openssl, crontabs, socat, and curl using yum on CentOS systems. ```bash yum -q -y install openssl crontabs socat curl ``` -------------------------------- ### Register Account and Get Thumbprint Source: https://github.com/acmesh-official/acme.sh/wiki/Stateless-Mode Use this command to register a new account or check an existing one and retrieve the ACCOUNT_THUMBPRINT. This thumbprint is essential for stateless mode configuration. ```bash root@ed:~# acme.sh --register-account [Mon Feb 6 21:40:18 CST 2017] Registering account [Mon Feb 6 21:40:19 CST 2017] Already registered [Mon Feb 6 21:40:21 CST 2017] Update success. [Mon Feb 6 21:40:21 CST 2017] ACCOUNT_THUMBPRINT='6fXAG9VyG0IahirPEU2ZerUtItW2DHzDzD9wZaEKpqd' ``` -------------------------------- ### Using lexicon TransIP API Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-use-lexicon-DNS-API Configure environment variables for TransIP username and API key file path. ```bash export PROVIDER=TRANSIP export LEXICON_TRANSIP_USERNAME="username" export LEXICON_TRANSIP_API_KEY="/path/to/file.key" acme.sh --issue -d test.acme.sh --dns dns_lexicon ``` -------------------------------- ### Install Dependencies on CentOS 5 Source: https://github.com/acmesh-official/acme.sh/wiki/Install-preparations Installs openssl, vixie-cron, socat, and curl using yum on CentOS 5 systems. ```bash yum -q -y install openssl vixie-cron socat curl ``` -------------------------------- ### Reg.ru API Error Example Source: https://github.com/acmesh-official/acme.sh/wiki/dnsapi2 An example of an API response indicating an access denial due to an incorrect IP address. ```json response='{ "charset" : "utf-8", "error_code" : "ACCESS_DENIED_FROM_IP", "error_params" : { "command_name" : "service/get_list" }, "error_text" : "Access to API from this IP denied", "messagestore" : null, "result" : "error" }' ``` -------------------------------- ### Enable Initial Certificate Creation for Synology DSM Source: https://github.com/acmesh-official/acme.sh/wiki/deployhooks Execute `export SYNO_CREATE=1` once when issuing a certificate for the first time to ensure it is created on Synology DSM. This variable is not needed for subsequent renewals. ```bash export SYNO_CREATE=1 ``` -------------------------------- ### Example Service Principal ID Source: https://github.com/acmesh-official/acme.sh/wiki/How-to-use-Azure-DNS This is an example of the output format for a service principal ID, which is used in credential reset commands. ```json "id": "daaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", ``` -------------------------------- ### Configure OpenMediaVault Deployment Source: https://github.com/acmesh-official/acme.sh/wiki/deployhooks Set environment variables for OpenMediaVault deployment. DEPLOY_OMV_WEBUI_ADMIN is required, and DEPLOY_OMV_HOST and DEPLOY_OMV_SSH_USER are optional for remote deployment. ```sh export DEPLOY_OMV_WEBUI_ADMIN="admin" export DEPLOY_OMV_HOST="192.168.1.200" export DEPLOY_OMV_SSH_USER="root" ``` -------------------------------- ### Install acme.sh Manually Source: https://github.com/acmesh-official/acme.sh/wiki/Synology-RT1900ac-and-RT2600ac-install-guide Use this command to download and install acme.sh when crontab is unavailable. Ensure to use the --nocron flag. ```shell $ wget https://github.com/Neilpang/acme.sh/archive/master.tar.gz $ tar xvf master.tar.gz $ cd acme.sh-master/ $ ./acme.sh --install --nocron --home /volume1/@appstore/acme.sh ``` -------------------------------- ### Enable and Start systemd Timer Source: https://github.com/acmesh-official/acme.sh/wiki/Using-systemd-units-instead-of-cron Commands to start the acme.sh renewal timer and ensure it is enabled to run automatically on system boot. ```shell sudo systemctl start acme_letsencrypt.timer ``` ```shell sudo systemctl enable acme_letsencrypt.timer ``` -------------------------------- ### Deploy to Qiniu.com (Multiple Domains) Source: https://github.com/acmesh-official/acme.sh/wiki/deployhooks To deploy multiple domains, separate them with spaces in the QINIU_CDN_DOMAIN environment variable. ```sh $ export QINIU_CDN_DOMAIN="cdn1.example.com cdn2.example.com" $ acme.sh --deploy -d example.com --deploy-hook qiniu ``` -------------------------------- ### Start acme.sh Daemon with Docker Compose Source: https://github.com/acmesh-official/acme.sh/wiki/Run-acme.sh-in-docker This command starts the acme.sh daemon service defined in your docker-compose.yml file in detached mode. ```sh docker compose up -d ```