November 20, 2019

Free SSL Certificate Setup for WordPress on Google Cloud (Bitnami)

Free SSL Certificate Setup for WordPress on Google Cloud (Bitnami)
An SSL Certificate enables the transmission of data across safe networks and prevents hackers from stealing personal information such as credit card numbers, names, and addresses. In this tutorial, we will learn how to install a free SSL certificate on WordPress hosted on Google Cloud.

Prerequisite: Before starting this tutorial, you should have WordPress installed on Google Cloud and Set up a custom domain for your wordpress website.

1. Connect to your Instance by SSH

Log in to Google Cloud Dashboard, go to Compute Engine -> VM Instances.

Free SSL Certificate Setup for WordPress on Google Cloud

Once inside your Compute Engine, click on the SSH button.

Free SSL Certificate Setup for WordPress on Google Cloud

2. Generate SSL Certificates

To generate new SSL certificates execute the following command. Remember to replace codersstuff@gmail.com, codersstuff.com and www.codersstuff.com with your e-mail and domain name.

sudo /opt/bitnami/letsencrypt/scripts/generate-certificate.sh -m codersstuff@gmail.com -d codersstuff.com -d www.codersstuff.com

Free SSL Certificate Setup for WordPress on Google Cloud

Press Y and press Enter to Continue for each of the three questions.

Free SSL Certificate Setup for WordPress on Google Cloud

3. Configure Redirect Http to Https

Redirect all traffic to the HTTPS version of your website by editing bitnami.conf file. To open the bitnami.conf file for editing copy and paste the below command.

sudo nano /opt/bitnami/apache2/conf/bitnami/bitnami.conf

Free SSL Certificate Setup for WordPress on Google Cloud

Paste the following three lines of code below, in the same location as shown in the picture. Save the file by pressing Ctrl+x and then Press  for yes, lastly Press Enter.

RewriteEngine On 
RewriteCond %{HTTPS} !=on 
RewriteRule ^/(.*) https://www.codersstuff.com/$1 [R,L]

Free SSL Certificate Setup for WordPress on Google Cloud

4. Restart Apache Server

Lastly, For the changes to take effect you need to restart your Apache web server by executing below command.

sudo /opt/bitnami/ctlscript.sh restart apache

Free SSL Certificate Setup for WordPress on Google Cloud - last step

Congratulation! You have successfully installed an SSL certificate on your WordPress website. If you have any questions feel free to leave a comment below.

Naffys Mir

I'm Naffys Mir, Programming Geek and Founder of CodersStuff.com. Coders Stuff is a Blog Packed with Loads of High-quality Programming Tutorials and a Ton of Engaging Advice and Insight into Front and Back End Technologies.

View all posts

12 comments

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