Google Cloud Launcher
Google Cloud Launcher

I’ve been wanting to have a blog for a while. I’d looked at a range of different hosting solutions but none of what I found really enchanted me. I was looking for something customizable, free, reliable, and powerful.

Last week I stumbled upon Google Cloud Platform‘s website and it seemed to check all the boxes. Just like AWS, Google provides an extensive list of cloud solutions through their Cloud Platform. I had the chance to try Cloud Launcher, Compute Engine and Cloud DNS – all for free!

Requirements

You need a good understanding of Cloud Infrastructures (implementation, deployment, migration), a basic understanding of application development and some experience using WordPress.

Setup

Cloud Launcher and Compute Engine allow you to deploy a VM instance on an external IP address. I chose the “WordPress 1-click install” solution and the platform gave me all the necessary credentials (WordPress login + mySQL password) minutes after I started the deployment.

Google Cloud Launcher
Google Cloud Launcher

By default the system gives you an ephemeral IP address for your project. Promoting it to a static IP might be wiser as you might want to keep it whether the instance is running or not. You can read more about it here.

Custom domain

The Cloud DNS service allows you to link a custom domain to your app. You’ll just have to give the four nameservers to your registrar and wait for the DNS to propagate across the internet. This process often takes between 24h to 48h.

Challenges

Although the initial setup was simple, I did face a number of challenges while customizing/configuring my blog.

#1 External IP -> Custom domain

Once your domain is linked to your host, make sure you add the following rewrite rule in your .htaccess (the first line being your IP and the second one your domain).

RewriteCond %{HTTP_HOST} ^0\.0\.0\.0
RewriteRule (.*) https://domain.com/$1 [R=301,L]

Once you’ve added the rewrite rule, make sure you change the site address URL in your WordPress settings pages. It should show your domain name.

#2 Root privileges on your instance

Connecting to your instance through SSH is relatively simple. You just have to create a new SSH key-pair and SSH from the browser, using Cloud Platform’s console. However Google doesn’t give you root privileges by default and this is a problem for files that require root permissions (like a robots.txt file can you believe it?). After a few days of research I managed to find a solution, read about it here.

Other useful resource: https://stackoverflow.com/questions/26835235/google-cloud-compute-vm-instances.

Takeaways

Overall, Google’s Cloud Platform is very easy to use and incredibly versatile. It allows you to deploy simple static websites, run LAMP servers, build applications and more, all from the same place.

  • The control panel is much more user-friendly than AWS’ cpanel.
  • You can customize your VM instances and tailor them to your needs.
  • Cloud Platform has all the services you need to build, deploy, host, monitor and debug your solutions.
  • A wide range of solutions is available through Cloud Launcher: APIs, CMSs, Databases solutions…
  • Google’s documentation is very exhaustive.

Next steps

  • Use Cloudflare’s Content Delivery Network to reduce my VM’s CPU usage and decrease latency (read this post).
  • Monitor my CPU and memory usage and adapt my Compute Engine machine type if needed.