Learn How To Install Let’s Encrypt SSL on One-Click WordPress App

September 29, 2019

Table of Contents

Introduction

Let’s Encrypt is a certificate authority service that offers free TLS/SSL certificates. This tutorial shows how to install a Let’s Encrypt SSL certificate on the One-Click WordPress app using the Let’s Encrypt installation wizard, certbot. At the end of this tutorial, your WordPress site will have a valid certificate and the nginx webserver will redirect all HTTP requests to HTTPS.

Prerequisites

This tutorial assumes that you have already deployed a One-Click WordPress app, have a domain name pointing to your server, and you are logged in as root.

Step 1 – Run certbot

https://www.itweb.services/tutorials/linux-guides/how-to-access-your-itweb.services-vps”>SSH to the server as root and run certbot. Here’s an example:

# certbot --nginx --redirect -d example.com -d www.example.com -m admin@example.com

This command explained:

  • –nginx
    • Use the nginx web server
  • –redirect
    • Redirect all HTTP requests to HTTPS.
  • -d example.com -d www.example.com
    • Install a multiple domain (SAN) certificate for example.com and www.example.com. You may use multiple -d domain entries. See the Certbot FAQ for more information about SAN certificates.
  • -m admin@example.com
    • The notification email address for this certificate.

Use certbot --help for more information.

Step 2 – Automatically Renew Certificate

Let’s Encrypt certificates are valid for 90 days. Automatically renew your certificate with cron when it’s about to expire.

SSH to the server as root and edit crontab.

# crontab -e

Append the following line to crontab:

20 3 10 * * /usr/bin/certbot renew >> /var/log/le-renew.log

This attempts to renew your certificate on the 10th of each month at 3:20 a.m. Check /var/log/le-renew.log for issues if renewal fails.

Older One-Click WordPress Deployments

If you have an older version of One-Click WordPress, you may need to install certbot. To download and install the certbot package:

# sudo add-apt-repository ppa:certbot/certbot 
# sudo apt-get update  
# sudo apt-get install python-certbot-nginx

Need help?

Do you need help setting up this on your own service?
Please contact us and we’ll provide you the best possible quote!