In this tutorial, I’m going to show you – How to launch a Static Website on Google Cloud Storage for FREE!
Ok, Now Let’s Get started!
Steps to Host a Static Website on Google Cloud Storage for FREE
Log in to your google cloud account
Point your Domain to Cloud
To do this, visit your Domain’s DNS settings section and click on the Add record and select CNAME.
Now in the Name section enter www and in the Points section enter c.storage.googleapis.com and then save the record.
Verify your Domain Ownership
Create Storage Bucket on GCP
Now you need to create a bucket and after that enter the “bucket name” (note: if you would like to point your domain name to storage then you got to give the bucket name as a domain name).
Next, you need to select the “storage class” (leave multi-regional for high-performance & availability).
Now select a location from the US, EU & Asia (choose the nearest to your audience) and then click on “Create.”
Once bucket creation is done successfully, you can see them on your list.
Configure Storage Bucket and Update Permission
Now in this permission property section, you need to type “allUsers” in the “Add members” field and select permission as “Storage Object Viewer. After that click to the Add, button to save the configuration.
Next, click on setting icon again >>Edit website configuration and then fill details on Main page & 404 (not found) page section (most of the case their value would be index.html & 404.html respectively).
Upload your website files
Open your newly created bucket section and then click “Upload folder/Upload files” and choose your website files to upload. Make sure index.html is present in bucket root.
Please note – Based on your file size, uploading may take some time.
You’re done! It may take some time to get DNS propagated globally, and you may use the DNS lookup tool to verify the results.
So, after sometime later, try to access your site by entering your site URL on the browser, and you will see your static website is live for the public.
Suggested Reading – How to set up a domain on a Google Cloud server
I hope this guide helps you to launch your static website on Google Cloud Storage. If you find this guide helpful, then please don’t forget to share it with your friends and family!
If you have any questions/queries or suggestion then feel free to let me know by commenting below.