How-to
    How To Add Google AdSense To Your Website
    How To Download Canvas as an image
    How To Embed Youtube Videos
    How To Host NodeJS Apps
    How To Host Static Websites On Amazon AWS EC2
    How To Host Static Websites On Amazon AWS S3
    How To Host Static Websites On GCP Cloud Storage
    How To Install Node.js
    How to Speed Up IntelliJ IDEA / Clion
    How to safely store API Keys

How To Host Static Websites On GCP Cloud Storage

Updated: 2022-03-17

Follow the install page to install gsutil: https://cloud.google.com/storage/docs/gsutil_install

Follow the tutorial to setup: https://cloud.google.com/storage/docs/hosting-static-website

To sync the local public folder to the cloud:

$ gsutil -m rsync -d -r public gs://www.yourdomain.com

gsutil options:

  • -m: perform parallel (multi-threaded/multi-processing) synchronization.

rsync options:

  • -d: "Delete extra files under dst_url not found under src_url."
  • -r: recursive.