How to Host a Website for free on Google Cloud Storage

0 832

Hosting a Static website on Google Cloud Storage is very easy. If you are planning to launch a simple static website with just only HTML, CSS, JavaScript and Images, then you don’t need a web server for that. You can upload your website files into Google Cloud Storage and your site will be live in a few minutes.

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

Visit cloud.google.com and then just login to your Google Cloud account. Once you sign in to your GCP account, then you can see your Google Cloud Dashboard like the following screenshot.Getting Started Page - Google Cloud Dashboard

Point your Domain to Cloud

To point your domain to Cloud Storage, you need to create a CNAME record pointing yourdomainname.com to c.storage.googleapis.com.

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

Visit Google Search Console to verify that you are the owner of the domain. Click on Add Property option to connect your new domain and then you can see many options are available for domain verification like HTML Metadata, Google Analytics, etc. The easiest one is DNS verification through a TXT record. So finish your ownership verification using any method you like and then proceed to the next step.

Create Storage Bucket on GCP

Visit your cloud console dashboard area and then from the navigation menu bar, click on the “Storage” link.

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

Select your bucket from the list and then click on edit bucket permission. It will open permissions properties.

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

Once you did finish the previous configuration, you can proceed to the website file upload process.

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 ReadingHow 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.

Subscribe to our newsletter
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More