Älvsby bensinmuseum Sweden

Google Cloud Storage for your WordPress Media files

I wrote an article recently on how to set up your WordPress site on the Google App Engine. In this article, I like to give you more information on how to set up your image storage for your App Engine WordPress website using the Google Cloud Platform (GCP) Storage and how to configure the WordPress plugin Google Cloud Storage plugin for app engine.

If you set up your WordPress site on GCP Compute Engine, using the Cloud Launcher to launch your WordPress site, you media files are stored in the same place (same server) as the rest of the WordPress files. You could use the Google Cloud Storage to store your files externally, as the price to store externally is in most cases cheaper.

If you choose to go with the Google App Engine your media files have to be stored externally, Google Cloud Storage is a great choice to choose.

Pricing

Cloud Storage pricing is based on the following components:

As part of the Google Cloud Platform Free Tier, Cloud Storage provides resources that are free to use up to specific limits. These usage limits are available both during and after the free trial period. If you are no longer in the free trial period, usage beyond these Always Free limits is charged according to the price sheet.

Cloud Storage Always Free quotas apply to usage in us-west1, us-central1, and us-east1 regions. Usage is aggregated across these 3 regions.

You can calculate your Google Cloud storage, with the Google Cloud Platform Pricing Calculator.

Why use Google Cloud Storage?

  • It’s cheaper than storing files on Google Cloud Engine instance.
  • If you have many servers, each running the same instance of your blog/app. You can simply store all the files in 1 place and refer to them from anywhere (any server). There’s no need to sync between the servers if you store it locally.

How to select

For the WordPress setup depending on if you using the Google App Engine or the Google Compute Engine, you will need to use a plugin.

  1. With the Google App Engine setup, I used the plugin Google Cloud Storage Plugin
  2. For Google Compute Engine, then you can also use the Cloud Storage FUSE, that would require some server work.

The rest of this article is about how to set up Google Cloud Storage Plugin.

Create a Google Cloud Bucket

To create a cloud bucket, a bucket is like a folder where you files are stored. Login to GCP, select the Storage from the left menu bar.

  • Select Create Bucket
  • Select the storage class that you want to use. See pricing for the cost of the storage class.
  • Select the regional location for your bucket.
  • Then select create and your bucket is created.

Remember the name of the bucket, as you will use it to configure your WordPress plugin.

Now your bucket has been created, you would need to set the bucket permission.

For your images to be displayed on your WordPress site, you would need to add the ALl Users view permission to your bucket.

WordPress Setup

To configure for the Google Cloud Storage Plugin is straightforward, add the storage bucket name that you used to create a storage bucket. Click save and that’s it – you can now use Google Cloud Storage to store your WordPress Media Files

Conclusion

With this article, I wanted to give you the information on how to use the Google Cloud Storage with your WordPress site, if you have chosen Google App Engine or Google Compute Engine – you now have an external storage option for your WordPress site.

As always, I’m interested in your comments, you can fill them in below.


Posted

in

,

by

Comments

2 responses to “Google Cloud Storage for your WordPress Media files”

  1. Cor Avatar

    What happens to the images already in your media folder? Is it uploaded to your cloud? Is there any image optimisation?

    1. Torbjorn Zetterlund Avatar
      Torbjorn Zetterlund

      There are tools that you can use to migrate your local files to Cloud Storage if you thinking about migrating to the Google Cloud. You can start with migrating your images first, there is a good plugin wp stateless that you can use.

Leave a Reply

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