ACME (acme.sh) Free SSL Certificate

ACME (acme.sh) is a shell script for generating LetsEncrypt SSL certificate. acme.sh is written in bash, so it works on any Linux server without special requirements. For getting SSL, another popular option is to use certbot.

To install, run

cd /usr/local/src
git clone https://github.com/acmesh-official/acme.sh.git
cd ./acme.sh
./acme.sh --install -m admin@serverok.in
source ~/.bashrc

When you install, it will set a daily cronjob for auto SSL renewal. You can see it with “crontab -l” command.

Advertisement

Set acme.sh to use LetsEncrypt SSL (Defaul is ZeroSSL)

acme.sh --set-default-ca --server letsencrypt

Set to ZeroSSL, run

acme.sh --set-default-ca --server zerossl

To issue an SSL certificate, run

acme.sh --issue -d example.com -d www.example.com -w /home/example.com/html/

Standalone mode (nginx)

acme.sh  --issue  -d example.com  --standalone --pre-hook "systemctl stop nginx" --post-hook "systemctl restart nginx"

Using non-standard port

acme.sh  --issue  -d example.com  --standalone --httpport 88

For more ways to issue SSL certificates, see

https://github.com/acmesh-official/acme.sh/wiki/How-to-issue-a-cert

Install SSL Certificate

To install the SSL certificate, run

acme.sh --install-cert -d DOMAIN_NAME \
--fullchain-file /etc/ssl/DOMAIN_NAME.crt \
--key-file /etc/ssl/DOMAIN_NAME.key \
--reloadcmd "systemctl restart nginx"

For Apache

acme.sh --install-cert -d DOMAIN_NAME \
--cert-file /etc/ssl/DOMAIN_NAME.crt \
--key-file /etc/ssl/DOMAIN_NAME.key \
--fullchain-file /etc/ssl/DOMAIN_NAME.ca \
--reloadcmd "service apache2 force-reload"

If you use Apache, replace “service nginx force-reload” with “service apache2 force-reload”. For CentOS/RHEL, use httpd instead of apache2.

Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement