Install FREE SSL Certificate for WordPress on Google Cloud -Bitnami. This post, provides all steps to install Let’s Encrypt Certificate for your WordPress installation on Google Cloud with Bitnami.

Not using Bitnami? Choose a different Installation:


Click to Deploy


  1. WordPress Installation using Bitnami.
  2. Setup Google Cloud DNS for your Domain name.

Bitnami WordPress Installation

Bitnami is a packaged application provider for many platforms. The Package contents of Bitnami installation of WordPress on Google Cloud is listed below.

  • Apache webserver.
  • MySQL database.
  • PHP v7.2.
  • phpMyAdmin.
  • Varnish cache.
  • Latest WordPress.

Connect to your Instance by SSH

Once you have all the prerequisites ready, you can connect your instance and access it using SSH.

Go to your Google Cloud Console and navigate to Compute Engine >> VM Instances.

Click the SSH button that’s at the right of your VM Instance.

Now a new terminal will be opened and connected to your VM Instance.

Install CertBot

Execute the following command to install Certbot Client which is used to generate SSL certificates.

chmod a+x certbot-auto

Generate SSL Certificates

To generate new SSL certificates execute the following command.

Replace with your Domain name.

./certbot-auto certonly --webroot -w /opt/bitnami/apps/wordpress/htdocs/ -d -d

Once you run the command, you need to enter your email address and accept the terms and conditions. Finally a set of certificated will be issued to you in this directory (/etc/letsencrypt/live/

Install FREE SSL Certificate

Edit your bitnami.conf file and make the folowing changes.

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

Paste the following code below the line DocumentRoot "/opt/bitnami/apache2/htdocs"

Replace with your Domain name.

ServerAlias yourdomainname .com
Redirect permanent /

Now scroll down below and find the default directives of SSLCertificateFile and SSLCertificateKeyFile

Comment the both line s by placing a # symbol at the starting of the line.

Paste the following certificates below the two lines.

SSLCertificateFile "/etc/letsencrypt/live/" 
SSLCertificateKeyFile "/etc/letsencrypt/live/"
SSLCertificateChainFile "/etc/letsencrypt/live/"

So your output will be like this.


#SSLCertificateFile "/opt/bitnami/apache2/conf/server.cert"
#SSLCertificateKeyFile "/opt/bitnami/apache2/conf/server.key"
SSLCertificateFile "/etc/letsencrypt/live/"
SSLCertificateKeyFile "/etc/letsencrypt/live/"
SSLCertificateChainFile "/etc/letsencrypt/live/"

Hit Ctrl+x followed by Y and Enter to save the file.

Update Domain URls

Changing your website URLs via Settings > General is disabled in the Bitnami version, so need to change your URLs by editing your wp-config.php folder.

sudo nano /opt/bitnami/apps/wordpress/htdocs/wp-config.php

Replace the URLs with the below details.

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');

define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] . '/');

Restart Apache server

For the changes to take effect you need to restart your Apache web server.

sudo /opt/bitnami/ restart apache

Setup Auto-renewal

To setup auto-renewal for your certificate tou need to set up cronjob to check the certificate expiry and renew it automatically.

sudo mv certbot-auto /etc/letsencrypt/

Set up a cronjob.

sudo crontab -e

Choose 1 to select the nano editor.

Paste the following line to the last.

45 2 * * 6 cd /etc/letsencrypt/ && ./certbot-auto renew && /opt/bitnami/ restart

Hit Ctrl+X followed by Y and Enter to install the cronjob. This setting will check every week and renew the certificate which is close to expiry.


Now you have learned how to install FREE SSL Certificate for your WordPress with Bitnami on Google Cloud.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.


  1. I want to know how to install vista cpanel in google cloud.
    In vista cpanel is free?
    Please help me….

Write A Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Where Writing Meets Entrepreneurship!

Get FREE Google Cloud Tutorials.
Please help us get 1000 likes in Facebook. Thank You!

Stay Connected!

Get latest tutorials on Google Cloud and Open Source topics