How to host static site by Google Cloud Storage

By: Tomoya Amachi
Posted: Feb 23, 2018

Some of our front-end projects are hosted by Google Cloud Storage, and cached by Cloudflare. Today I will introduce how to host with GCS and Cloudflare.


1. Verify your domain

I like verifying by Domain Name provider because no need to host servers and really easy.

  1. Go Webmaster Central
  2. Click "ADD A PROPERTY"
  3. Choose "Alternative methods"
  4. Choose "Domain name provider"
  5. Type: TXT, Name : @, Content: google-site in Cloudflare
  6. Click "VERIFY"

This DNS record must not be deleted if you want to keep the verification.

2. Create Storage Bucket

  1. Create Bucket : gsutil mb gs://, if you host
  2. Upload files : gsutil rsync -R /path/to/dir gs://
  3. chmod your files : gsutil acl -r ch -u AllUsers:R gs://*
  4. Set index/error pages : gsutil web set -m index.html -e 404.html gs://

3. Add CNAME Record

  1. Create a CNAME record that points to
An image from Notion


It's very easy to host static files.