Upload the Website

Make sure to name the main page of the website to index.html.

  1. Go to the Objects tab
  2. Click on Upload Files
  3. Select all your website files and upload them

At this point, your website should be accessible from https://storage.googleapis.com/<your bucket name>/index.html.

However, if you notice, the website won’t work if you try to remove the index.html from the address. But that is not the case in real life, right? You don’t go to w3wiki.org/index.html, you go to just w3wiki.org. So, let’s try and make our website even more professional. We will ask Google Cloud Storage to serve index.html by default when no path is specified in the URL.

  1. Click on Buckets from the sidebar
  2. Click on the three dots for your bucket
  3. Click on Edit Website Configuration
  4. Add index.html in both the input boxes
  5. Click on Save

Hosting a Static Website on Google Cloud Storage: Step-by-Step Tutorial

You have finally built the awesome portfolio website that all recruiters want. But now the question is, where to host it? Well, there are quite a few options for it, and object storage solutions like Google Cloud Storage and AWS S3 are some of the popular ones. You can host your static website in just a few steps using them.

Now what is object storage? It is simply one of the methods to store files which are called objects. It was created with cost-effectiveness in mind. Object Storage solutions are also generally called S3 compatible. So, Google Cloud Storage, AWS S3, Cloudflare R2, and Backblaze B2 are some of the S3-compatible storage solutions.

In this article, we will see how to deploy an awesome cat website on Google Cloud Storage. AsiaPlease note that you can only host static websites and not dynamic ones. But why? Simply because dynamic websites require a server.

Similar Reads

Step 1: Create a Storage Bucket

A bucket, like its name suggests, is simply a place where all the objects (files) are stored. Here is how to create a bucket on Google Cloud....

Step 2: Make The Objects Public

For everyone to be able to see your website, you have to make it public....

Step 3: Upload the Website

Make sure to name the main page of the website to index.html....

Step 4: Create a Load Balancer

Search for Load Balancing and click on it Click on Create Load Balancer Click on Start Configuration from Application Load Balancer Leave the options as default and click Continue Give the load balancer a name, like gfg-demo-lb Frontend configuration Give any name, like gfg-demo-frontend Click on IP address Click on Create IP address Give any name, like gfg-demo-ip Click Create Click on Done Backend configuration Click on the dropdown that says Backend services and buckets Click on Create a backend bucket Give the bucket any name, like gfg-backend-bucket Click on Browse and select the bucket that we had created earlier Uncheck Enable cloud CDN Click on Create Leave the other settings as default Click on the Create button at the bottom of the page...

(Optional) Step 5: Enable HTTPS

It is mandatory to have a domain name to enable HTTPS. For the sake of this article, I am going to point cat.ba3a.tech to the website and enable HTTPS on it. You can follow along with your own domain name, like example.com....

Conclusion

Building a stunning website is just the first step; deciding where to host it is equally crucial. Object storage solutions like Google Cloud Storage and AWS S3 offer seamless ways to host static websites. This article delved into deploying an awesome cat website on Google Cloud Storage, showcasing how easily it can be accomplished in a few steps....

Frequently Asked Questions on Hosting a Static Website on Google Cloud Storage: Step-by-Step Tutorial

1. What is Object Storage, and Why Use it for Hosting Websites?...