July 7, 2021 . 2 MIN READ
Bash script to generate and install Let’s Encrypt certificate for your websites on your free/paid ServerPilot account. Currently, the only easy way to add SSL to your ServerPilot-powered websites is by subscribing to the paid plan.
sudo su to act as rootsple.sh to your /usr/local/bin folder
cd /usr/local/bin && wget https://raw.githubusercontent.com/lesaff/serverpilot-letsencrypt/master/sple.sh
sudo chmod +x sple.sh to make it executablesple.sh anywhere from your console as rootroot?This script updates/create script in the /etc/nginx-sp that requires root access
/var/log/letsencrypt for detailed error messagesrootcd /etc/nginx-sp/vhosts.dssl config filesls *ssl*<appname>.ssl.conf that is causing problemRestart nginx sudo service nginx-sp restart
Add the following to your crontab (crontab -e)
For Ubuntu 14.04
0 */12 * * * /usr/local/bin/certbot-auto renew --quiet --no-self-upgrade --post-hook "service nginx-sp reload"
For Ubuntu 16.04
0 */12 * * * letsencrypt renew && service nginx-sp reload
For Ubuntu 18.04
0 */12 * * * letsencrypt renew && service nginx-sp reload
https://github.com/lesaff/serverpilot-letsencrypt
https://gist.github.com/knynkwl/7f20d57b39979e19ae0e98465eab7ece
https://rehmat.works/install-lets-encrypt-on-the-free-plan-of-serverpilot/