$ sudo su -
# apt install git socat
# mkdir /root/src
# cd /root/src
# git clone https://github.com/Neilpang/acme.sh.git
# cd acme.sh
# ./acme.sh --install --accountemail "[email protected]"
# cd ~/.acme.sh
# nano account.conf
change to your DNS provider info
Dynu_ClientId='235bb9ee-b3c4-9823-g728-5b363hwes6ef5'
Dynu_Secret='DSsrgbzxcWERQWeASDsad432sdfasdFASDF'
Change the DNS provider name if needed
./acme.sh --test --debug --debug --issue --dns dns_dynu -d sub.domain.tld
./acme.sh --debug --debug --issue --dns dns_dynu -d sub.domain.tld --force
mkdir -p /etc/ssl/localcerts
./acme.sh --debug --installcert -d sub.domain.tld --certpath /etc/ssl/localcerts/sub.domain.tld.pem --keypath /etc/ssl/localcerts/sub.domain.tld.key --fullchainpath /etc/ssl/localcerts/sub.domain.tld-fullchain.cer --reloadcmd "systemctl reload nginx.service"
If everything went fine the certificates will be renewed and reinstalled automatically from the cron job.
Now you would just need to configure Apache/Nginx/etc to use the certificates installed at the local folder defined above.
e.g. ( /etc/ssl/localcerts ).