How to Install A Let’s Encrypt SSL Certificate on ServerPilot (DigitalOcean) Easily

If you’re like me, familiar with cPanel or you came from some shared hosting service plans, installing a SSL certificate on your own DigitalOcean VPS can be a daunting task.

You should know that with an upgrade to a paid plan, ServerPilot can automatically setup SSL certificates on your server.

But why would you pay for that when it is just a 5 mins work?

How to Install A Let’s Encrypt SSL Certificate on ServerPilot (DigitalOcean)

Rudy Affandi (lesaff) wrote a Bash script that will generate and install Let’s Encrypt certificates on your SeverPilot-managed server.

  1. Launch your terminal
  2. Enter ssh root@123.45.678.901
  3. Enter your password
  4. Enter cd /usr/local/bin && wget https://raw.githubusercontent.com/lesaff/serverpilot-letsencrypt/master/sple.sh to copy the script into your server
  5. Enter sudo chmod +x sple.sh to make the script executable
  6. Enter sple.sh to run the script
  7. Enter appname and serverpilot your App Name and User Name according to your ServerPilot settings
  8. Enter all your domain names

All right, you have just install the Let’s Encrypt SSL certificates on your server!

Automatically Renew Your Let’s Encrypt Certificates

The SSL certificates expires every 90 days. After which you have to renew them, or else the browsers will throw up warnings when visitors are accessing your website.

  1. Enter crontab -e to open up your cron job schedule
  2. Enter 0 */12 * * * letsencrypt renew && service nginx-sp reload if you are running Ubuntu 16.04 or enter 0 */12 * * * /usr/local/bin/certbot-auto renew --quiet --no-self-upgrade --post-hook service nginx-sp reload if you are running Ubuntu 14.04.
  3. Enter sudo nginx-sp restart to restart your server

That’s it! You have just installed the SSL certificates on your server!

After this, check if your the SSL certificates are properly setup with this 4-point check list after installing SSL certificates.

For WordPress users, learn how to enable https on your website.

Leave a Reply

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