Tutorial – Self-Host WordPress on Google Cloud

Standard

Tutorial Introduction

The purpose of this tutorial is show how to self-host a WordPress blog on Google Cloud. Wikipedia provides the following definition of Cloud Computing:

Cloud computing, also on-demand computing, is a kind of Internet-based computing that provides shared processing resources and data to computers and other devices on demand. It is a model for enabling ubiquitous, on-demand access to a shared pool of configurable computing resources. Cloud computing and storage solutions provide users and enterprises with various capabilities to store and process their data in third-party data centers. It relies on sharing of resources to achieve coherence and economies of scale, similar to a utility (like the electricity grid) over a network. At the foundation of cloud computing is the broader concept of converged infrastructure and shared services.

The cool thing about the cloud is that companies like Google can take the left over processing resources that they have and monetize it. Since this is a left-over commodity the cost is far less than what it would cost to host the server in a data center on it’s own. I do want to note that you may be able to get better pricing to host your blog through companies like Host Gator and GoDaddy. You will not, however, get the granular control of your WordPress site like you do with hosting in the cloud. You also get the chance to learn how to use a slew of emerging technologies that will give you a better understanding of how your blog works. There are other opportunities with using the cloud like doing a multi-site blog that you can lease out to other bloggers. As you grow to understand the technology better you will create more opportunities for yourself on a platform that scales very well. Enough explaining let’s get to the good stuff.

The one thing that sets Google Cloud apart from all other cloud providers is that they give you a 60-day or $300 free trial. Basically you can do anything you want on Google Cloud for 60-days or until you use up $300 worth of services. Trust me, the $300 will last longer than the 60 days. All you need is a Gmail account. First things first, go to http://cloud.google.com.

 

Sign-Up

 

tutorial-how-to-self-host-wordpress-google-cloud1

 

If you are already logged into your gmail account you will see your icon in the upper right-hand corner. Regardless, click on the “My Console” button. This should take you to the following page:

 

tutorial-how-to-self-host-wordpress-google-cloud2

 

At the top of the screen you will see a button that says “SIGN UP FOR FREE TRIAL”. Click on that.

 

tutorial-how-to-self-host-wordpress-google-cloud3

 

You do need a credit card for the free trial. If you don’t want to be charged after the trial simply delete your projects and everything that could cost you is gone. No need to cancel the trial.

 

tutorial-how-to-self-host-wordpress-google-cloud4

 

 

The Dashboard

Once the form is filled out you will get a greeting giving you the option to “TOUR THE CONSOLE”. Take the tour. I’m not going to cover the tour in this tutorial but it is good information.

 

tutorial-how-to-self-host-wordpress-google-cloud6

 

Now you are at the main page of the console.

 

tutorial-how-to-self-host-wordpress-google-cloudss5

 

On the left-hand side you will see choices for the Dashboard and Activity.

 

tutorial-how-to-self-host-wordpress-google-cloudss6

 

Our Dashboard looks a bit bare right now because we don’t have anything going but that will change soon.

 

tutorial-how-to-self-host-wordpress-google-cloudss7

 

In the upper right-hand corner you see the name of your project, notifications, and your user icon.

 

tutorial-how-to-self-host-wordpress-google-cloudss8

 

Let’s go back to the sidebar and click on “Activity”.

 

tutorial-how-to-self-host-wordpress-google-cloudss6

 

The “Activity” area shows us everything that we have been doing. Pretty useful when multiple people are using the same project and for loners like ourselves to remember everything we have done.

 

tutorial-how-to-self-host-wordpress-google-cloudss9

 

Enable the Compute Engine API

Let’s click on the “Hamburger Menu”

 

ss50

 

Don’t worry about all of the big words and services you have never heard of. All we are worried about right now is clicking on “API Manager”.

 

tutorial-how-to-self-host-wordpress-google-cloudss10

 

Google has TONS of APIs to pick from. We are only interested in the “Compute Engine API” which is the first one listed on my screen.

 

tutorial-how-to-self-host-wordpress-google-cloudss11

 

We need to “Enable” the API so we can create our WordPress site. Click the “Enable” button.

 

tutorial-how-to-self-host-wordpress-google-cloudss12

 

This might take a minute or two so get a cup of coffee and relax. Once it is done you will see that the API is enabled but you can’t use it until you create credentials. Click on the “Go to Credentials” button.

 

tutorial-how-to-self-host-wordpress-google-cloudss13

 

The API that we are using is the Google Compute Engine and you will see that it asks us if we are indeed using the Google Compute Engine. Click on the “Yes” radio button and then click on the “What credentials do I need?” button.

 

tutorial-how-to-self-host-wordpress-google-cloudss14

 

Come to find out we don’t need to create new credentials because we can use the Application Default Credentials. Cool! Click on the “Done” button.

 

tutorial-how-to-self-host-wordpress-google-cloudss15

 

Cloud Launcher

We need to go back to the upper left-hand corner of the screen and click on the Hamburger Menu again. Now we want to click on “Cloud Launcher”.

 

ss51

 

This is the reason why it is so easy to setup a WordPress blog on Google Cloud. Automation. Using the Cloud Launcher you pick whatever application you want to launch and it takes care of all of the hard stuff like creating folders, permissions, etc, etc, brain bleed!

 

ss16

 

In the search box type “wordpress” and you should see three choices. Bitnami does some really cool stuff and if you want to host a multi-site WordPress blog you will want to choose Bitnami for that. We are going to stick with the Google Click to Deploy version. Click on that.

 

ss17

 

You will be brought to the information page for launching WordPress via the “Google Click to Deploy”.

 

ss18

 

Notice in the lower section it even estimates the cost for you based on the default installation parameters. Don’t worry about that. We are going to tweak that a little bit because our blog isn’t going to need too much under the hood to start. Remember, Google Cloud is scalable. If we need more resources we can add them later. Click on the button that says “Launch on Compute Engine”.

 

ss19

 

Now we can customize the install as we please. If you want more computing power you add it here. You can also add disk space to the default as well as change the name of the installation.

 

ss20

 

I made two changes to keep costs down and that was to switch to the f1-micro “Machine Type” and I changed the “Disk Type” to SSD for speed and changed the “Disk Size in GB” to 50. Once this is done click on the button that says “Deploy”.

 

ss21

 

It takes a minute or two to deploy the instance so if you need a refill on coffee now is a good time to get it.

 

ss22

 

Once it has completed you will get an overview of the site, including IP address and passwords. Take note of the password because you are going to need it to login to your site. Click on the “Visit WordPress site” button.

 

ss24

 

Login to the WordPress Site

 

ss25

 

Pretty basic stuff right now. Scroll down to the lower right-hand area and click on “Log in” under the “META” section.

 

ss26

 

Enter “admin” for the user name and the password that I had you note down earlier.

 

ss27

 

ss28

 

You are in! You are now officially hosting your WordPress site on Google Cloud. You can now add plugins, change the theme, whatever you want.

 

ss29

 

Convert Ephemeral Address to Static Address

We do need to make one minor change. Go back to your Dashboard which is at http://console.cloud.google.com.

 

ss52

 

Click on the Hamburger Menu again and choose “Networking”. Now click on “External IP addresses”.

 

ss32

 

The IP address you went to for your site is what is called an Ephemeral IP address. Basically, it could be changed and completely mess up where your site is pointing to. We need to change that.

 

ss33

 

We are going to change the Ephemeral address to a Static address. The cool thing is that Google doesn’t charge you for the Static address as long as it is in use. Sweet!

 

ss34

 

They will ask you to name it. Nothing complicated here.

 

ss35

 

Now your address is static and will not change unless you change it.

 

ss36

 

Instance Properties

 

Click on the Hamburger Menu again and go back to the Dashboard.

 

ss37

 

Under the “Resources” section click on “Compute Engine”.

 

ss38

 

This is the properties page for your instance. You can see how much resources it is using as well as edit things about the instance.

 

ss39

 

Final Thoughts

Self-hosting your WordPress site is a must for anyone serious about getting their content heard. It also gives you much more latitude in how the site is built, maintained, and upgraded. Google Cloud makes it very easy to do this with their Cloud Launcher. Thanks for stopping by the Thought Sumo blog and make sure you SUBSCRIBE so you know about future tutorials.

 

 

 

 

2 thoughts on “Tutorial – Self-Host WordPress on Google Cloud

    • admin

      Hi Jeff,

      I’m glad the tutorial was useful for you. SSL is a great choice and not particularly hard to do. The first thing you need to do is get a cert for the site. If you are not selling anything you can get a free cert from Let’s Encrypt or StartSSL. I believe StartSSL also has commercial certs as well. From there follow this tutorial for getting SSL setup on your server http://www.hongkiat.com/blog/ssl-certs-guide/

      Thanks again!
      Chris

Leave a Reply

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