Creating a bucket in Google Cloud
A bucket will act as a container in the Google Cloud. A bucket holds files, folders and any other data objects in the cloud storage. To save our website files in the cloud, we need to create a bucket first. Go to your Google Cloud Console.
Start a New Project: (Refer to the Image Below)
In the Console, go to the project list on the top left and select the dropdown button. Now click on the New Project button. It is a better practice to have a separate project for each of our needs. Creating a separate project will make it easy to manage our website. We can easily delete the entire project if we want to delete our website.
Give any name to your project. For reference, I am naming my project as geekcalc website. After creating, switch to the project you created from the Project list in the top left. Now click on the Navigation menu (shown above) and go to Cloud Storage -> Buckets. Create a bucket by clicking on Create button on top left.
Name your bucket. Here, for reference, I am creating a bucket with a name called geekcalc. Click continue and select Location type as Multi Region. Click continue and choose storage type as Standard. Now click continue and uncheck Enforce public access prevention on this bucket as shown below.
Now leave everything as default and click on the Create button. This will create our bucket.
Static Website Hosting with Google Cloud Storage: Hosting a Web App
In this tutorial, we will host a static website in Google Cloud Storage(GCS). If you want to host your resume as a portfolio website or if you want to have a website for your small to medium company, then hosting a static website is the best solution. This is very useful if you don’t have much traffic to your website and you don’t want to pay much for web hosting.
In this article, we will host a basic calculator web app in Google Cloud.