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/senseiner/serverpilot-letsencript/main/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 messagesroot
cd /etc/nginx-sp/vhosts.d
ssl
config filesls *ssl*
<appname>.ssl.conf
that is causing problemRestart nginx
sudo service nginx-sp restart
Check that the nginx config is correct
sudo nginx-sp -t
Add the following to your crontab (crontab -e
)
For Ubuntu 16.04
0 */12 * * * letsencrypt renew && service nginx-sp reload
For Ubuntu 18.04
0 */12 * * * letsencrypt renew && service nginx-sp reload
For Ubuntu 20.04
0 */12 * * * letsencrypt renew && service nginx-sp reload