We earn commission when you buy through affiliate links.

This does not influence our reviews or recommendations.Learn more.

A step-by-step guide to hosting a static website onGoogleCloudStorage forbetter performance at a lower cost.

storare-cost-estimation

It doesnt need any server-side processing or database connectivity.

Why Google Cloud Storage?

It performs better at a lower cost.

How-to-create-Bucket-in-Google-Storage-step-1

Googleoffershigh-performancecloudstorage for fast loading content worldwide, with 99.95% availability SLA.

There isno minimum limitfor an object, and you pay for what you use.

The following instructions will help you to host the static website onCloudStorage inless than 15 minutes.

warning-domain-verification

Pre-requisite

This assumes you have a domain name registered and an account created withGoogle Cloud.

For this demonstration, I will use lab.geekflare.com.

So you have to ensure the domain name youve entered in the bucket name isverified.

gcs-website-configuration

Once a bucket is created, you should see them on the list.

Lets configure the index anderror page.

Uploading Static Website

Its time to upload your site tocloudstorage.

static-site-gcs

I am usingSlides by Designmodofor my static website.

Based on file size, it may take some time.

Update CNAME Record

Finally, you got to point your domain toGoogleCloudStorage using a CNAME record.

Login to your Domain Registrar control panel and update CNAME toc.storage.googleapis.comof your domain.

It may take some time to getDNSpropagated globally, and you may use theDNS lookuptool to verify the result.

Once domain CNAME is resolving toc.storage.googleapis.com, you might try accessing the URL to confirm working as expected.

So as you’re able to see, my static website is up and running onGoogleCloudstorage.

Whats an alternative to GCS to host static sites?

There are a few options.

you’re free to choose to option on thesestatic hosting platformsor useMinIOwhich is a self-hosted object storage solution.