A step-by-step guide to hosting a static website on Google Cloud Storage for better performance at a lower cost.
If you are hosting a static website (HTML/CSS/JS/Images), then you don’t need to worry about managing your site’s cPanel web hosting plan. Instead, you can use Google Cloud Storage (GCS), which will be cheaper, faster & easy to maintain.
A static site is suitable for personal, corporate, information pages, or anything where you don’t expect to generate a transaction or dynamic content. It doesn’t need any server-side processing or database connectivity.
Why Google Cloud Storage?
It performs better at a lower cost.
You can host 10 GB of sites at multi-regional for high availability for less than $1 per month.
You can choose to host your content on a multi-regional storage class, which means your data is available in two regions’ data centers for high availability.
Google offers high-performance cloud storage for fast loading content worldwide, with 99.95% availability SLA. There is no minimum limit for an object, and you pay for what you use.
The following instructions will help you to host the static website on Cloud Storage in less than 15 minutes.
Click on the setting icon again >>Edit website configuration
Enter the index & 404 pages (Most of the time index page would be index.html & 404.html)
Save the configuration
Uploading Static Website
It’s time to upload your site to cloud storage. I am using Slides by Designmodo for my static website.
Click on the newly created bucket.
Click “Upload folder/Upload files” and choose your website files to upload.
Ensure index.html is present in the bucket root
Based on file size, it may take some time.
Update CNAME Record
Finally, you got to point your domain to Google Cloud Storage using a CNAME record.
Login to your Domain Registrar control panel and update CNAME to c.storage.googleapis.com of your domain. It may take some time to get DNS propagated globally, and you may use the DNS lookup tool to verify the result.
Once domain CNAME is resolving to c.storage.googleapis.com, you can try accessing the URL to confirm working as expected.
So as you can see, my static website is up and running on Google Cloud storage.
By default, a site will be available http:// however, if you need to secure and make it accessible using https:// then I wrote this post to set up SSL on the GCS hosted site.
What’s an alternative to GCS to host static sites?
I hope the above gives you an idea of how easy to host a static website on Cloud Storage at a low cost.
As the founder of Geekflare, I’ve helped millions to excel in the digital realm. Passionate about technology, I’m on a mission to explore the world and amplify growth for professionals and businesses alike.