
SSL Certificate Setup for WordPress on Google Cloud (Bitnami)
In this tutorial I will show you how to configure free, auto-renewing SSL certificates for WordPress websites that are hosted on Google Cloud Platform using the Bitnami version of WordPress on Google Cloud Platform.
Having SSL Security on your website will improve your Google search ranking.
Luckily for you, this step-by-step tutorial is super easy to follow. All you have to do is follow along with the video as I install an SSL certificate for my domain eborchids.com.
Before getting started with this tutorial, you should have already installed WordPress on Google Cloud Platform, and set up a domain name for your WordPress website.
So let’s get started.
There are 9 steps in this tutorial:
- 1. Connect to WordPress via SSH
- 2. Install Git
- 3. Install CertBot Client
- 4. Generate Certificates
- 5. Setup Certificate Auto-Renewal
- 6. Configure the Certificates
- 7. Update Domain URLs
- 7. Restart your Apache Server
- 8. Test your Configuration
1. Connect to WordPress via SSH



2. Install Git

sudo -i
sudo apt-get install git-all
3. Install CertBot Client

cd /tmp
git clone https://github.com/certbot/certbot
After running each of these commands, you can stay in the same SSH window or exit and open a new one.
4. Generate Certificates

cd /tmp/certbot
./certbot-auto certonly --webroot -w /opt/bitnami/apps/wordpress/htdocs/ -d eborchids.com -d www.eborchids.com

5. Setup Certificate Auto-Renewal

cd /tmp/certbot/
./certbot-auto renew --dry-run

crontab -e
1

0 0 * * * cd && ./certbot-auto renew --quiet --no-self-upgrade
0 12 * * * cd && ./certbot-auto renew --quiet --no-self-upgrade
6. Configure the Certificates

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

SSLCertificateFile "/etc/letsencrypt/live/eborchids.com/cert.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/eborchids.com/privkey.pem"
SSLCertificateChainFile "/etc/letsencrypt/live/eborchids.com/chain.pem"

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
After adding this code, enter ctrl+o to save changes, followed by ctrl+x to exit back to our home screen.
7. Update Domain URLs
Changing your website URLs via Settings > General is disabled in the Bitnami version, so you’ll need to change your URLs by editing your wp-config.php folder.



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

Inside of your wp-config.php file, you will need to replace your SiteURL and HomeURL definitions as shown below.
REPLACE THIS:
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');
WITH THIS:
define('WP_HOME','https://yourdomain.com');
define('WP_SITEURL','https://yourdomain.com');
Remember to replace DOMAIN with either the www. or non-www. version of your domain name – whichever your prefer. For example:
define('WP_HOME', 'https://www.yourdomain.com');
define('WP_SITEURL', 'https://www.yourdomain.com');
After adding this code, enter CTRL+o to save changes, followed by CTRL+x to exit back to your home screen.
8. Restart your Apache Server

sudo /opt/bitnami/ctlscript.sh restart apache
SSL Certificate Setup for WordPress on Google Cloud (Bitnami)
In this tutorial I will show you how to configure free, auto-renewing SSL certificates for WordPress websites that are hosted on Google Cloud Platform using the Bitnami version of WordPress on Google Cloud Platform.
Having SSL Security on your website will improve your Google search ranking.
Luckily for you, this step-by-step tutorial is super easy to follow. All you have to do is follow along with the video as I install an SSL certificate for my domain eborchids.com.
Before getting started with this tutorial, you should have already installed WordPress on Google Cloud Platform, and set up a domain name for your WordPress website.
So let’s get started.
There are 9 steps in this tutorial:
- 1. Connect to WordPress via SSH
- 2. Install Git
- 3. Install CertBot Client
- 4. Generate Certificates
- 5. Setup Certificate Auto-Renewal
- 6. Configure the Certificates
- 7. Update Domain URLs
- 7. Restart your Apache Server
- 8. Test your Configuration
1. Connect to WordPress via SSH



2. Install Git

sudo -i
sudo apt-get install git-all
3. Install CertBot Client

cd /tmp
git clone https://github.com/certbot/certbot
After running each of these commands, you can stay in the same SSH window or exit and open a new one.
4. Generate Certificates

cd /tmp/certbot
./certbot-auto certonly --webroot -w /opt/bitnami/apps/wordpress/htdocs/ -d eborchids.com -d www.eborchids.com

5. Setup Certificate Auto-Renewal

cd /tmp/certbot/
./certbot-auto renew --dry-run

crontab -e
1

0 0 * * * cd && ./certbot-auto renew --quiet --no-self-upgrade
0 12 * * * cd && ./certbot-auto renew --quiet --no-self-upgrade
6. Configure the Certificates

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

SSLCertificateFile "/etc/letsencrypt/live/eborchids.com/cert.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/eborchids.com/privkey.pem"
SSLCertificateChainFile "/etc/letsencrypt/live/eborchids.com/chain.pem"

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
After adding this code, enter ctrl+o to save changes, followed by ctrl+x to exit back to our home screen.
7. Update Domain URLs
Changing your website URLs via Settings > General is disabled in the Bitnami version, so you’ll need to change your URLs by editing your wp-config.php folder.



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

REPLACE THIS:
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');
WITH THIS:
define('WP_HOME','https://yourdomain.com');
define('WP_SITEURL','https://yourdomain.com');
Remember to replace DOMAIN with either the www. or non-www. version of your domain name – whichever your prefer. For example:
define('WP_HOME', 'https://www.yourdomain.com');
define('WP_SITEURL', 'https://www.yourdomain.com');
After adding this code, enter CTRL+o to save changes, followed by CTRL+x to exit back to your home screen.
8. Restart your Apache Server

sudo /opt/bitnami/ctlscript.sh restart apache
9. Test your Configuration

Did it Work?
If your SSL certificates were configured properly, you will notice that your website is being loaded with a green padlock icon.
Because we configured auto-renewal for our certificates, we don’t ever need to renew them or setup new ones.
Pretty cool, huh?