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.
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:
At the top of the screen you will see a button that says “SIGN UP FOR FREE TRIAL”. Click on that.
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.
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.
Now you are at the main page of the console.
On the left-hand side you will see choices for the Dashboard and Activity.
Our Dashboard looks a bit bare right now because we don’t have anything going but that will change soon.
In the upper right-hand corner you see the name of your project, notifications, and your user icon.
Let’s go back to the sidebar and click on “Activity”.
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.
Enable the Compute Engine API
Let’s click on the “Hamburger Menu”
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”.
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.
We need to “Enable” the API so we can create our WordPress site. Click the “Enable” button.
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.
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.
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.
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”.
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!
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.
You will be brought to the information page for launching WordPress via the “Google Click to Deploy”.
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”.
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.
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”.
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.
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.
Login to the WordPress Site
Pretty basic stuff right now. Scroll down to the lower right-hand area and click on “Log in” under the “META” section.
Enter “admin” for the user name and the password that I had you note down earlier.
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.
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.
Click on the Hamburger Menu again and choose “Networking”. Now click on “External IP addresses”.
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.
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!
They will ask you to name it. Nothing complicated here.
Now your address is static and will not change unless you change it.
Click on the Hamburger Menu again and go back to the Dashboard.
Under the “Resources” section click on “Compute Engine”.
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.
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.