admin

Free Or Paid SSL Certificate Setup for  WordPress on Google Cloud

Want to Install SSL Certificate for a WordPress website on Google Cloud ?

Don”t worry, I am here to help you.

In this Guide you will learn about four types of SSL certificate configuration for your WordPress site on Google Cloud.

Scenario 1.

You don’t have any SSL certificate, and want a Free auto renewal letsencrypt SSL certificate.

Scenario 2.

You don’t have any SSL certificate, and want a 90 days Free Comodo SSL certificate.

Scenario 3.

You want to buy  an SSL certificate, and install it on your Google Cloud.

Scenario 4.

You already  have an SSL certificate for your domain, and want to install it on your new Google Cloud WordPress.

If you are using Bitnami WordPress on Google Cloud, you can view this SSL certificate tutorial.

Basic SSL FAQs

  1. What is SSL?
  2. Why you need SSL?
  3. Free vs Paid SSL.

Join Us

Facebook

Twitter

YouTube

Want Exclusive Tutorials?

Tutorial Steps

To Complete this tutorial, you should already have,

  1. Installed  WordPress on Google Cloud .
  2. Configured a Domain name.
  3. Reserved a Static IP.

You can follow that tutorial here to complete those steps.

Scenario 1#.

Free auto renewal letsencrypt SSL Certificate Setup for WordPress on Google Cloud:

Let’s Encrypt SSL certificates that are just as secure as current paid certificates. But if your site processing credit cards or transmitting sensitive information (such as an e-commerce site), or has a user login section, you should only use a paid Sectigo certificate. This will ensure your users that the connection is valid and secure.

There are couple of steps in this tutorial.

  1. Install certbot
  2. Generate Lets Encrypt certificate.
  3. Configure your apache server.
  4. Configure your WordPress
  5. Set up Auto Renewal. (optional)
  6. Setup Redirects. ( Optional )
  7. Troubleshooting.   

1.# Install certbot

Open your Google Cloud console and click on the hamburger logo.

After that hover on Compute Engine  and Click on VM Instances.

Click on SSH to open the terminal. You also can use Putty terminal. I already wrote a tutorial on putty. Click Here to visit it.

Now copy and paste it on your SSH terminal. It will install certbot on you Google Cloud linux server.

sudo apt-get install -y certbot python-certbot-apache -t stretch-backports

Here you  I am installing certbot on my Google Cloud WordPress Server.

2.# Generate Lets Encrypt certificate.

After installing Certbot, You need to generate Let’s Encrypt Certificate.

Copy this command and paste it on your terminal.

sudo certbot certonly --webroot -w /var/www/html/ -d your-domain-name -d www.your-domain-name 

Here I generate SSL certificate for my siteyaar.tk domain. In the bottom section of the image you can find the file directories where the SSL certificate files are stored. 

3 .# Configure your apache server.

In this section you will learn about how to setup apache server conf file.

You have to enable Mod_ssl and also give permissions to view your website through 443 port.

To edit default-ssl.conf go to your google cloud terminal, and paste the command below.

sudo nano /etc/apache2/sites-available/default-ssl.conf

Paste the following lines of code in order to give permission to your web files through  HTTPS port 443.

<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

After that , scroll down by pressing down arrow of your keyboard and Place a # sign before “SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem”
“SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key”  those two files.

Here I Place a # sign before those two lines.

After that Place those lines to enable your let’s encrypt Certificate.

SSLCertificateFile "/etc/letsencrypt/live/your-domain-name/cert.pem"
SSLCertificateKeyFile "/etc/letsencrypt/live/your-domain-name/privkey.pem"
SSLCertificateChainFile "/etc/letsencrypt/live/your-domain-name/chain.pem"

To save the default-ssl.conf file press ctrl+o then ctrl+x or ctrl+x >> y >> enter.

To take effect  of your certificate changes , you need to update and restart your Apache server by executing all three of the commands listed below.

sudo a2enmod ssl
sudo a2ensite default-ssl
sudo service apache2 restart

Now open your website on your browser. Https://your-domain-name.

If any thing goes wrong just place a comment. I will help you. 

4.# Configure your WordPress.

Now login to  your WordPress and change the http to https. Then click save.

Here I changed my http://siteyaar.tk  to https://siteyaar.tk.

Congratulation you successfully install Let’s encrypt SSL certificate.

If you want to setup redirects eg. suppose anyone  visit http version of your site they will automatically redirect to https. To learn more click here.

5.# Set up Auto Renewal.

Those steps are optional. If  you to setup auto renewal function then follow the steps.

To setup your crontab file, execute the following command:

sudo crontab -e

Choose 1 to edit your crontab file with nano editor.

Then the place the following lines below:

* 3 * * 6 certbot renew && /etc/init.d/apache2 restart

The first section of the code” * 3 * * 6 ” tell your server to check for certificate renewals once per week at 3 am , and to automatically renew the certificates if they are about to expire. After adding the script, save the crontab file by pressing CTRL + X, then Y, then Enter.

Scenario 2#.

Free Comodo SSL Certificate Setup for WordPress on Google Cloud:

If want to install 90 DAYS Free Comodo Sectigo SSL certificate, then you have to follow the steps below to active and install your SSL certificate.

This tutorial is also valid for paid Comodo SSL / Namecheap SSL Certificate etc. installation.

To setup this type of SSL certificate you have to create  csr and key file using openssl.

Open your Google cloud console account on your browser. Go to Compute Engine >> VM Instances.

Click on the SSH to open cell terminal. You also can use Putty.

Follow the blog post to setup Putty on Your Google Cloud.

Execute this command:

cd /etc/apache2/sites-available

Here I want to create key and csr file in this directory /etc/apache2/sites-available. You can also use or create different directory.

To generate CSR and Key file , execute this Command below:

sudo openssl req -new -newkey rsa:2048 -nodes -keyout siteyaat_tk.key -out siteyaar_tk.csr

Change siteyaar_tk to your domain name.

Now you have to enter some informations to generate key and csr files.

Here an example for  siteyaar.tk

Country Name (2 letter code) [AU]:IN
State or Province Name (full name) [Some-State]:WB
Locality Name (eg, city) []:KOLKATA
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []: BLANK
Common Name (e.g. server FQDN or YOUR name) []:siteyaar.tk OR www.siteyaar.tk 
Email Address []:[email protected]
 
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:BLANK
An optional company name []:BLANK

Choose Common Name carefully. If your site name is eg. siteyaar.com then type siteyaar.com. If your site name is www.siteyaar.com then place www.siteyaar.com.

Open nano editor and copy the lines of you csr file.Here the command:
sudo nano /etc/apache2/sites-available/siteyaar_tk.csr
Now visit https://ssl.comodo.com/free-ssl-certificate and create an account.  

Paste the CSR code into the box and Select Apache-ModSSL.

If you already setup your email address then go for the email method.

Here I showed you an alternative method for Domain Control Validation.

Select the Http CSR Hash.

For domain Control Validation you have to create a text file with the name of  MD5 value. 

Click on Show Alternative DCV information , Then click HTTP CSR Hash. Copy the text.

Now create .well-known/pki-validation directorics by executing this command:

sudo mkdir -p /var/www/html/.well-known/pki-validation

After this create a txt file using the name of MD5 value.

sudo nano /var/www/html/.well-known/pki-validation/your-MD5-value.txt

Paste the code and save it by pressing CTRL +X  Then Y Then ENTER.

Here I Complete DCV  For siteyaar.tk. You will receive the SSL Certificate on your register email address.

As you can see Here I receive the SSL certificate.  

Download it and unzip it.

On you SSH terminal, Click on Upload file. After that Upload the two files.

As you can see the uploaded files are stored in home/myserver-name.

Now move the files to /etc/apache2/sites-available directory.

Execute this Command:

sudo mv /home/your-server-name/your-domain.crt /etc/apache2/sites-available
sudo mv /home/your-server-name/your-domain.ca-bundle /etc/apache2/sites-available

Apache does not have the permission to use those SSL files you have give permission by executing the command below.

sudo chmod a+x /etc/apache2/sites-available/siteyaar_tk.key /etc/apache2/sites-available/siteyaar_tk.crt /etc/apache2/sites-available/siteyaar_tk.ca-bundle

By default Google click to deploy wordpress does not come with pre-configure Https.

To access you web file through https on port 443, You have to edit the default-ssl.conf

To edit default-ssl.conf go to your google cloud terminal, and paste the command below.

sudo nano /etc/apache2/sites-available/default-ssl.conf

Paste the following lines of code in order to give permission to your web files through  HTTPS port 443.

Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

After that , scroll down by pressing down arrow of your keyboard and Place a # sign before “SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem”
“SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key”  those two files.

Here I Place a # sign before those two lines.

After that Place those lines to enable your COMODO SeCtigo SSL Certificate.

SSLCertificateFile "/etc/apache2/sites-available/your-domain-name.crt"
SSLCertificateKeyFile "/etc/apache2/sites-available/your-domain-name.key"
SSLCertificateChainFile "/etc/apache2/sites-available/your-domain-name.ca-bundle"

To take effect  of your certificate changes , you need to update and restart your Apache server by executing all three of the commands listed below.

sudo a2enmod ssl
sudo a2ensite default-ssl
sudo service apache2 restart

Scenario 3#.

Paid Premium SSL Certificate Setup for WordPress on Google Cloud:

It is the same steps you followed in the previous guide.

If you need help just drop a comment.

Scenario 4#.

Move and Setup SSL Certificate for WordPress on Google Cloud:

If you already had an SSL certificate Which is installed in another server. Then this guide will help you.

To install your old SSL certificate on Google Cloud WordPress , you have to move your Old KEY , CRT , CA-BUNDLE files to Google Cloud.

Drop A comment if you need help.

Here I downloaded KEY, CRT, CA-BUNDLE file from my previous server.

Go to you ssh terminal click on the setting icon on the right top corner. Then click on upload. Upload you three files which you downloaded from your old server.

Your uploaded files will be store in /home/your-account=name.

Now move those three files to a different directory.I move my files to /etc/apache2/sites-available.Here the Command:
sudo mv /home/your-server-name/your-domain.crt /etc/apache2/sites-available
sudo mv /home/your-server-name/your-domain.ca-bundle /etc/apache2/sites-available
sudo mv /home/your-server-name/your-domain.key /etc/apache2/sites-available
You can create new folder by using mkdir command.

This step is very crucial. Your google cloud wordpress (apache) server does not have the permission to access those files.

Execute this command.

 

sudo chmod a+x /etc/apache2/sites-available/siteyaar_tk.key /etc/apache2/sites-available/siteyaar_tk.crt /etc/apache2/sites-available/siteyaar_tk.ca-bundle

Change siteyaar_tk to your SSL certificate files name.

Now click here . And follow the instruction from scenario 2.

Redirect Configuration for WordPress on Google Cloud:

This step is optional. If you want permanent 301 redirect only then follow it.

What is Redirect ?

Suppos, your website name is www.example.com but some one open example.com, Redirect configuration will automatically redirect that user to www.example.com.

To configure redirect you have to place some code in 000-default.conf and default-ssl.conf.

Important: If you want to use cloudflare cdn then first visit the troubleshooting section.

Http to Https Redirect:

Every user will automatically redirect to Https version of you site.

eg. http://example.com to https://example.com.

Edit 000-default.conf  using nano.

sudo nano /etc/apache2/sites-available/000-default.conf

Then paste those lines below:

RewriteEngine On
#Enable HTTP to HTTPS redirection
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
RewriteCond %{REQUEST_URI} !^/\.well-known
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

Http Non-www to Https www Redirect:

Every user will automatically redirect non-www to Https www version of you site.

eg. http://example.com to https://www.example.com.

Edit 000-default.conf  using nano.

sudo nano /etc/apache2/sites-available/000-default.conf

Then paste those lines below:

RewriteEngine On
#Enable HTTP to HTTPS redirection
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
RewriteCond %{REQUEST_URI} !^/\.well-known
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
#Enable non-www to www redirection
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
RewriteCond %{REQUEST_URI} !^/\.well-known
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=permanent,L]

Edit default-ssl.conf  using nano.

sudo nano /etc/apache2/sites-available/default-ssl.conf.conf

Then paste those lines below:

RewriteEngine On
#Enable non-www to www redirection
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
RewriteCond %{REQUEST_URI} !^/\.well-known
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=permanent,L]

Http Www to Https non-www Redirect:

Every user will automatically redirect www to Https non-www version of you site.

eg. http://www.example.com to https://example.com.

Edit 000-default.conf  using nano.

sudo nano /etc/apache2/sites-available/000-default.conf

Then paste those lines below:

RewriteEngine On
#Enable HTTP to HTTPS redirection
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
RewriteCond %{REQUEST_URI} !^/\.well-known
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
#Enable www to non-www redirection
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
RewriteCond %{REQUEST_URI} !^/\.well-known
RewriteRule ^(.*)$ http://%1$1 [R=permanent,L]

Edit default-ssl.conf  using nano.

sudo nano /etc/apache2/sites-available/default-ssl.conf.conf

Then paste those lines below:

RewriteEngine On
#Enable www to non-www redirection
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
RewriteCond %{REQUEST_URI} !^/\.well-known
RewriteRule ^(.*)$ https://%1$1 [R=permanent,L]
An Example:

Just like this image you need to edit both 000-default.conf  & default-ssl.conf files.

TroubleShooting:

Cloudflare Problem:

If you use  http to https redirect while using cloudflare,this will create some problems.

You may not able to access your website.

To solve this problem you have to disable http to https redirect. Though you can use  non-www to www  and www to non-www  redirect.

Don’t use this codes or disable this codes by place a # sing.

# BEGIN: Enable HTTP to HTTPS redirection
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
RewriteCond %{REQUEST_URI} !^/\.well-known
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

Too many Redirects:

After following this long tutorial, you open your website and saw “Too many redirects”.

I am sure you will be mad at me. Don’t worry I am here! LOL.

Why Too many Redirects ?

If you setup two different redirects on same website (url) eg. one pointing http to https and another https to http or one pointing http to https www and another https www to http , this will create a loop.

You browser going from http to https  then https to http >> http to https ….. infinity . When this happens you will see “too many redirects” error screen.

How to solve?

For http to https redirect  change the WordPress Address URL and Site Address Url to https://.

For http non-www to https www redirect  change the WordPress Address URL and Site Address Url to https://www.

For http www to https non www redirect  change the WordPress Address URL and Site Address Url to https://.

Now it is you time!

I tried my best to provide you a complete tutorial on SSL for you Google Cloud WordPress. I hope you liked it.

If you need help just drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page.

Thanks,

If you like our content, please consider buying us a coffee. Thank you for your support!

WordPress Multisite on Google Cloud A to Z Installation Guide

Want to install  WordPress Multisite on Google Cloud Platform ? This blog is all about on that topic.

I am going show you step by step installation of “Google Click deploy” WordPress multisite on Google Cloud.

Their is another option of WordPress multisite installation on google cloud, It is “How to install Bitnami WordPress Multisite on Google Cloud”.

Though Click to deploy is Manage by Google But Bitnami WordPress Multisite is better, because it come with pre-configure security settings.

Join Us

Facebook

Twitter

YouTube

What is WordPress Multisite

WordPress Multisite allow you  run multiple websites like site.com blog.site.com , new.com etc from a single WordPress. It is the same software that powers WordPress.com.

WordPress Multisite have the power of sharing Plugin, themes acores all the website, available by server admin.

You can create numerous websites using unique domain names.

What is cost of WordPress Multisite on google cloud.

It is the same as hosting a normal WordPress on Google Cloud. I already wrote a blog about it. Here the blog “WordPress on Google Cloud: The Definitive Guide“.

In short, If you using always free F1-micro VM instances then the cost will be around $3-4.

Without always free program, For f1-micro the cost will be around $7-9.

For G1-small the cost is around $16-19.

For S1-stander the cost is around $24-32.

**All the prices I mention above are examples or demos. It can vary widely upon you uses.

Is WordPress Multisite right for You?

A WordPress multisite will  manage all your websites through a single user interface. Those Website Can have subdomain or Full domain.

You can Create user with limited authority power.

Like user Bob can access only site.com.

User John can access only new.com.

Pros,

  1. Manage and control multiple web sites through a single dashboard.
  2. Manage the subsites and grant controls to other users from a single interface.
  3. Updates to all plugins and themes can be pushed at once.

Cons,

  1.  The biggest con is WordPress Multisite doesn’t support all plugins. About 80 -90% plugins  work on multisite.
  2. All the subsites are depend on main site. That why if If the main site goes offline, all connected subsites will also become inaccessible.

Install WordPress Multisite on Google Cloud

Here I am going to show how deploy and Configure  WordPress Multisite on google cloud platform.

Step 1# Deploy WordPress Multisite:

On your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen.

Click on the Marketplace Button.

Now type  WordPress Multisite and click on enter.

Select the first one from the search result. “WordPress Multisite” Google click to Deploy.

After that Click on ” LAUNCH ON COMPUTE ENGINE”.

Step 2# Configure WordPress Multisite:

Give a Deployment name. After select  zone.

Zone is the location  of your server.

For example, the us-central1 region denotes a region in the Central United States that has zones us-central1-a, us-central1-b, us-central1-c, and us-central1-f.

Now select machine type as per your requirement.

Here is a price chart :

Type your email address. It will be your WordPress Multisite user name.

Select SSD persistent disk or Stander persistent disk.

SSD Persistent Disk: It is SSD type disk. Recommended

Standard Persistent Disk: HDD type disk. It is slower than ssd.

Enable both HTTP and HTTPS traffic.

After that,Click on Deploy. It will take some time.

WordPress MultiSite Login

You can visit your WordPress Multisite by clicking on “Site URL”.

As of now you WordPress Multisite does not have a proper domain name.

IP address you are seeing it is your server ip.

Now click on “ADMIN URL” and login to your wordpress multisite using temporary passwords.

Assign a Static IP Address on Google Cloud Platform

You have to assign a static Ip to your virtual instances (vm), or it might change after some time.

The majority of technical problems experienced by Google Cloud Platform users occur because the user failed to reserve a static IP address for their website.

Hover on VPC network, then Click on External IP addresses.

Click on Static.

Give a name.Then click on RESERVE.

WordPress Multisite: Configure your domains and subdomains.

There are three type of  domain setup Scenarios.

1st Scenario: You want multiple websites/blogs at subdomains of your primary domain example if your primary domain is 99stockbrokers.com then subdomain websites are blog.99stockbrokers.com, Cool.99stockbrokers.com, google.99stockbrokers.com.

2nd Scenario: You want multiple websites/blogs at different domains example you primary domain at example.com and another domain at mysite.com.

3rd Scenario is Combination of both first and second scenarios. 

 Let get started.

The frist thing you need to do is to point Your domains and subdomains to Google Cloud. 

HERE the steps.

1. Point Your Domains subdomains to Google Cloud .

As of now you you can access your wordpress multisite only through IP address.lets Change it.

Your present situation. Only can access you site through Ip.

After this guide. You can access your site through  Your Domain name.

What You need to do?

You have to  add or update “A” record to your domain register website or Cloudflare or Setup a dns provider like google cloud Dns.

The first step is to copy your google VM instances IP address.

Go to Vm instances and copy your External ip address.

Modify “A” record on domain register website:

here I am showing you two example for godaddy and namecheap.

If your domain register is other than those two then you have search it on google. Also You can ask me on comment section.

Godaddy.

Go to DNS Management.

For Scenario 1#.

To create a  subdomain eg. blog.99stockbrokers.com, You have type your subdomain name on the host section and your server IP to “Points to” section.

Or, You also can  type “*” on the host section.

*  means any thing before .99stockbrokers.com will resolve through you server IP.

For Scenario 2#.

For Scenario 2 Configuration , just point to domain to your server IP. 

@ means you domain name, eg. 99stockbrokers.com .

Go to dns management. Click on edit A record and past the server IP.

After yout edit . It should be look like this. The “value” should be your server IP.

If your domain registrar is namecheap then follow the steps bellow.

Go to manage section of your namecheap”s settings. 

After this go to Advance DNS  section and modify or add a “A” address.

If you already setup cloudflare for your domain, then follow the steps.

Goto Dns section and update or add “A” record.Paste your server IP.

Remember 

Some time, Change in A record can take some time. About 1-6 hours.

2. Setup your WordPress Multisite

I hope you already pointed you all domains and subdomains to your server ip.

Now login to your WordPress and go to Tools >> Network Setup.

Click on Install.

Here is the tough part, You need to modify your wp-config.php and .htaccess file through SSH terminal.

Go to VM instances on google cloud platform.

Click on SSH. And paste the command below.
sudo nano /var/www/html/wp-config.php

Paste the code line after “define (WP_allow_MULTISITE’, true);

Here the code line:

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'Your server IP"');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

To save the file, press ctrl+x >> Y >> enter.

Paste the command on SSH terminal.

sudo nano /var/www/html/.htaccess

Paste the Code below after “# BEGIN WordPress
” .

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

To save the file, press ctrl+x >> Y >> enter.

Reload  and Login to Your WordPress. After that goto My site >> Network Admin >> Sites >> Add new.

For Scenario 1#.

Site Address Url: Give an appropriate folder name for your subdomain and add a Site Title .Then click on Add Site.

Eg. this is  my setup for subdomain blog.99stockrocket.com.

Now go to My site >> Network Admin >> Sites >> All sites.

Click on edit.

Change the Site Address to http://your-subdomain-name . Click on “Save  Changes.

As you can see I change my site address to my subdomain.

Now You can access your website through your subdomain.

For Scenario 2#.

Site Address Url: Give an appropriate folder name for your domain and add a Site Title .Then click on Add Site.

Eg. this is  my setup for domain stockrocket.com.

Now go to My site >> Network Admin >> Sites >> All sites.

Click on edit.

Change the Site Address to  your domain name.

Here I change my site address to my domain name stockrocket.in.

After this step You can access your website through your domain name.

For Scenario 3#.

Follow the 1st and 2nd scenarios.

Configure SSL certificate on WordPress Multisite:

Google recently announced that having an SSL certificate can boost your google page ranking.Therefore you should install SSL cert for your WordPress Multisite.

As you can see the installation of WordPress multisite on google cloud is quite a hectic task.If I create another step you might get mad at me,(lol).

That’s why I wrote a new blog on this topic.

In that blog, You can learn about two type of SSL configuretion process.

  1. FREE ,Auto renewal letsencrypt SSL Certificate installation process.
  2. Different SSL certificates for different domains ,installation process.

IF you purchased SSL certificate the second step might help you.

Configure FTP or Sftp on Google Cloud using Filezilla:

If you want access to your web files, Then you have to set up SFTP client such as  Filezilla, Winscp, Cyberduck etc.

Google does have a lame file transfer system but does not have GUI base  file manager application on their cloud platform. Therefore, you will need those applications which I mention before.

I already wrote a blog about FTP and SFTP on Google Cloud, You can check it out.

Now it is you time!

It is you time to install WordPress Multisite on Google Cloud. 

If you need help just drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page.

Thanks,

If you like our content, please consider buying us a coffee. Thank you for your support!

WordPress on Google Cloud: The Definitive Guide

Want to Host WordPress on Google Cloud Platform ?

You are in right place.

Here I am going to show step by step how to install wordpress on google cloud.

Wait  Not Only that I am also  going to give you a definitive answer on WordPress Cost on Google Cloud Platform.

In fact I am hosting my wordpress on google cloud. So why not you ?

Basic FAQs

1. What is the Google Cloud Platform?

“Google Cloud Platform (GCP), is a suite of cloud computing services that runs on the same infrastructure that Google uses internally for its end-user products, such as Google Search and YouTube.” Wikipedia.org

With the help of google cloud  you can build  anything in the modern web era. They have 90 different services under google cloud platform.

You don’t need all of them to host a simple wordpress website  on google cloud.

The services you need to host a wordpress site: Compute Engine , Persistent Disk ,Network Service Tiers, Google CDN (optional), Google Dns (optional).

2. Google Cloud Platform Free Tier.

As of now Google is providing you two types of free services.

12 month free trial :$300 free credit to get started with any GCP product. Click here to learn more.

Yes you  hear it right , Google is give you free $300 credit for 1 year(newuser).Basically You can host your wordpress on google cloud for free for a year

Always Free:

Google Cloud’s Always Free program provides limited access to many common GCP resources free of charge. Resources are provided at intervals, usually monthly. Always Free resources are not credits; they don’t accumulate or roll over from one interval to the next.

Unlike the free trial, Always Free isn’t a special program. It’s a regular part of your GCP account. Click here to learn more.

3. Cost of hosting a wordpress Website on google.

The Cost of hosting a Simple WordPress website is depend on 3 GCP resources,  Compute Engine , Persistent Disk ,Network Service Tiers . But if want external db servers,load balancers, google cdn ,google dns, etc then it varies more. 

For a simple wordpress website cost varies between $3.5-$25 per month.You can host wordpress free of cost for 1 year with google cloud free tier.

Here is the price  table of 3 main GCP resources.

3.1. Compute Engine.

Basically compute engine is a virtual machine with a v-cpu and RAM (memory).

It define how much cpu core and ram you need for your wordpress website.

Google is providing you a free f1-micro compute engine in usa  with always free program.

3.2. Persistent Disk : SSD/HDD

Persistent Disks are the storage disk where you will install your WordPress and store your web files.

Google has two types of storage disks.

Standard provisioned space: It is a HDD (Hard Disk Drive) disk.

SSD provisioned space:SSD (Solid State Drive).

You should use SSD whenever possible as it is significantly faster than HDD; that being said, it is also significantly more expensive.

3.3. Network Service Tiers.

The Network service Tiers cost is depend on your website outgoing data.Whenever some one  visit your site they download some data from your Gcp server.

 So Basically you paying  for your monthly visitors.

3.4. Google Dns. (optional)

3.5. Google CDN.(optional)

Here is some typical estimate for hosting WordPress on Google Cloud.

Example 1:For small traffic sites.

If you just beginning or you already has few smaller websites this example is perfect for you . Google always free f1-micro (usa)compute engine your Google Cloud Website Hosting Price will be around $3.45-4.00 . If you want your server other  location (not in  USA)  then you have to pay around $8-$9 per month.

Now you can not install Click to deploy WordPress on f1-micro server.

If you want f1-micro then go for Bitnami WordPress on Google Cloud.

As you can see if you use always free fi-micro server then you paying just $3-4 dollar.

Here is the price for normal f1-micro server.The price will be around $7-8 dollar.

Example 2:For medium traffic sites.

Google g1-small compute engine with 1.75 ram and 0.5 % of vcpu is enough for a medium traffic website.For this type of setup you  will be around $17-$19.

For G1-small server with 15 gb SSD and 16gb egress data ,price will be around $17.85 dollar.

Example 3:For High traffic sites.

If you have a high traffic website websites this specification is perfect for you. 

Specification: 1 virtual core /3.7gb ram /30 gb ssd storage / around  16-20 gb egress(outgoing).Your google cloud website hosting price will be around $31.24.

This a typical example of a high traffic website. Price will be around $29-32 dollar.

4. Google Cloud vs other hosting providers.

Google Cloud Platform is nothing like other manage hosting providers ex- siteground, namecheap, a2hosting, bluehost etc.

If you are familiar with cpanel By default google cloud does not provide you a cpanel.

The Main difference is you have to use command-line-interface on google cloud. But others  manage hosting providers use graphical interface such as cPanel.

5. WordPress Hosting Options

Google have main three type of wordpress installation.

WordPress Single Instance using GCP Marketplace: 

This guide is base on this type of instances.

According to Google

With one click, deploy a single instance of WordPress to Compute Engine. This is the best option for WordPress installations expecting low to medium traffic, and can be scaled by changing the instance type. Visit the page .

WordPress on Kubernetes Engine:

Normally this option is best for hosting provide such as kinsta ,wp-engine and enterprise level websites.

According to Google

Deploy a scalable version of WordPress across multiple container instances. This option is for WordPress installations expecting heavy traffic, where auto-scaling and performance are worth the increased overhead of setting up and deploying.Visit the page

WordPress on App Engine:

This option is similar to Kubernetes Engine.

According to google

And is recommended only for WordPress installations expecting variable traffic with high peak levels. and is recommended only for WordPress installations expecting variable traffic with high peak levels.Visit the page

How to Host WordPress on Google Cloud ?

To host wordpress on google you have to install it on google cloud VM instances. 

As I told you before you can host wordpress in multiple ways on google cloud platform.

In this tutorial I am going to show you Google Single Instance  “Click to deploy” wordpress installation.

Google click to deploy is Managed by Google.

But for your knowledge, you can install wordpress with different methods  and configure settings on google cloud.

Here is a list of  Google WordPress hosting on single vm instances with different configuration:

  1. Google Click to deploy WordPress multisite.
  2. Multiple  wordpress on single stack.
  3. Bitnami wordpress installation.
  4. Bitnami wordpress multisite.
  5. Bitnami multiple wordpress on single stack. 

1. Install WordPress on Google Cloud.

On your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen.

Click on the Marketplace Button.

Type wordpress on the search bar.

As you can see Google cloud has many type of wordpress-es . Don’t click on the wrong one. Click on the link(button) which has those words – “WordPress” ,” Google Click To Deploy ” , ” Virtual machines” . 

 

Click on the “LAUNCH ON COMPUTE ENGINE” link. 

2. Configure WordPress Installation.

After that chose you near by zone or where you want to deploy your server.

Now chose your compute engine as per your budget or need.It is unfortunate that now google does not give a option for f1-micro server for “Click to deploy WordPress installation” . If you want f1-micro server then go for Bitnami WordPress installation.

Now chose you Boot Disk Type.  Stander Persistent Disk  is  Mechanical type hard disk  thus it is much slower than SSD Persistent Disk. Go for SSD Persistent Disk.

Make sure to check the boxes to allow HTTP and HTTPS traffic.

Click Deploy  To install your server. It will take some time (5-10 m).

3. WordPress Site Login on Google Cloud.

If you click on your site address  you can visit your wordpress site.To login click on “Admin Url” . Your WordPress user name and pass is mention as wordpress admin user and wordpress admin password.

4. phpMyAdmin login.

Click on the link to visit your phpMyAdmin web interface.

5. How to Change myPhpAdmin Password on google cloud ?

To change your phpMyAdmin password –

      1. Click on SSH.
      2. Copy and Paste the command on your terminal.Then click enter.
    mysqladmin -u root -p password
    1. Enter your temporary password.
    2. Enter your new password.

5. How to Assign a Static IP Address on Google Cloud Platform.

You have to assign a static  Ip to your virtual instances (vm), or it might change after some time.

The majority of technical problems experienced by Google Cloud Platform users occur because the user failed to reserve a static IP address for their website.

Hover on VPC network, then Click on External IP addresses.

Click on Static.

Give a name.Then click on RESERVE.

Setup Your Domain on Google Cloud.

In this step your configuring you domain name to work with you wordpress.As of now you wordpress is only accessible through an IP address.

Lets change it to a domain name example- yoursite.com or  www.yoursite.com

The main step here is to assign a “A” or “Cname” to your google cloud ip address.

Okay , there are couple of ways to do that.

You can do that by adding or modifying “A” address on your domain register website.

OR,

If your using cloudflare or other hosting providers. You need to edit dns record.

Or use Google DNS. I already wrote a blog about it. You go that tutorial. It will add some additional cost.

First, Go to Vm instances and copy your external IP.

Modify “A” record on domain register website:

here I am showing you two example for godaddy and namecheap.

If your domain register is other than those two then you have search it on google. Also You can ask me on comment section.

Godaddy.

Go to dns management.

Paste the server ip you copied.

For namecheap

Go to advance Dns section.

Paste the server IP. You can delete the second “A” address.

For Cloudflare,

If you already setup Cloudflare,then you have to change some dns settings.

Go to dns section.

Edit and paste the server ip there.

By the way  slow dns can hurt your seo ranking .So you should chose a fast dns provider like cloudflare,google dns.I already wrote a blog about dns go and visit it.

If you want to use Google cloud dns go to this blog.

NOW, LOGIN TO  you WordPress.

Then go to setting > general.

Troubleshoot

 Some time, Change in A record can take some time. About 1-6 hours.

This step will connect your domain to your wordpress.

NOW, LOGIN TO  you WordPress.

Then go to setting > general.

Change your “WordPress Address” and “Site Address” to your domain name. Then click on save.

After that you can access your wordpress through you doman.

Here you can see that I can access my 99stockrocket.com after changing site and wordpress address.

This is 2019 So you have setup ssl certificate to your wordpress site.Without ssl google chrome give you a “Not secure” tag.

So ,there are two ways to configure ssl certificate to your wordpress website.

If you want free, auto-renewing LetsEncrypt SSL certificates for your WordPress go to this tutorial.

or, If you already had or purchased an SSL certificate then go to this tutorial.

Migrate WordPress to Google Cloud

If you have an existing WordPress website that you want to migrate to your new WordPress on Google Cloud installation, then this tutorial is for you.

In this  tutorial, you will use the All-in-One WP Migration plugin to migrate your WordPress website to Google Cloud Platform.

Google Cloud Ftp or Sftp setup with Filezilla / Winscp / Cyberduck

If you want access to your WordPress files, the only option is to connect using SFTP  client such as  Filezilla, Winscp, Cyberduck, etc.

I already wrote a blog about this. So go there to learn more about FTP and SFTP on google cloud.

This is my WordPress website ‘s filezilla setup. As you can see I downloaded some .conf file from my WordPress.

Now it's your turn.

I hope this blog worth your time. I tried my best to provide  you a complete answer on WordPress hosting on Google Cloud.

If  you face any problem feel free to drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page and subscribe to my YouTube channel.

Thanks,

Post Summary

  1. About Google Cloud WordPress hosting.
  2. WordPress Hosting Cost.
  3. Step by step WordPress installation guide.
  4. Different methods of wordpress installation.

Join Us

Facebook

Twitter

YouTube

Want Exclusive Tutorials?

If you like our content, please consider buying us a coffee. Thank you for your support!