Add LetsEncrypt to basic ServerPilot installation

Thanks to user fortminor from DigitalOcean community thread, I finally figured out how to add LetsEncrypt to basic ServerPilot installation. Lets walk through the step if you have DO droplet configured with ServerPilot.

First, run below script as su/root.

$ cd /usr/local/bin

$ wget

$ chmod +x

$ ./

Above script will get the ServerPilot LetsEncrypt from GitHub.

After completing the wizard, add the autorenewal to crontab.

$ crontab -e

Insert below line to the crontab & save it.

0 */12 * * * letsencrypt renew && service nginx-sp reload

Then, navigate to nginx-sp vhost.d folder.

$ cd /etc/nginx-sp/vhosts.d

Edit your app’s ssl.conf & add below settings at top of the file. This to redirect http requests to https. Replace with your domain.

server {
   listen 80;
   listen [::]:80;
   return 301$request_uri;

Backup your app’s conf & copy ssl.conf to .conf. This is to have a backup in case ServerPilot reset your app’s conf file.

$ mv example-app.conf example-app.conf.bak && cp example-app.ssh.conf example-app.conf

That’s it! Now restart nginx-sp service for the finishing move.

$ service nginx-sp restart

Here is the sample image used on this website.

Shazril Shohaimi

Certified tech nerd, who likes to meet people and discussing possibilities. Passionate at helping business grow in online. Friendliest person at Majiska Digital Solutions.