In this tutorial, I will show you step by step to setup Google Cloud Storage for free.
Related Post: Google Cloud Storage with Node.js: File Upload example
Google Cloud Storage overview
Google Cloud Storage is file storage web service for storing and accessing data on Google Cloud Platform infrastructure.
It is an Infrastructure as a Service (IaaS), comparable to Amazon S3.
It has both performance and scalability of Google’s cloud with sharing capabilities and advanced security.
Google Cloud Storage stores objects into buckets. All requests are authorized using Identity and Access Management (IAM) policies or access control lists (ACLs) associated with a user or service account.
Here are some more salient features:
- Interoperability with other cloud storage tools and libraries that work with services such as Amazon S3 and Eucalyptus Systems.
- Consistency: strong read-after-write consistency for all upload operations.
- Access Control: access control lists (ACLs) to manage object and bucket access. An ACL consists of one or more entries, each granting a specific permission to a scope. Permissions define what someone can do with an object or bucket (for example, READ or WRITE). Scopes define who the permission applies to.
- Resumable Uploads: allows users to resume upload operations after a communication failure has interrupted the flow of data.
First we need to open browser with url: https://cloud.google.com/gcp/, login Google account and click on Get started for free.
Then we accept the Terms and click on Continue button.
Browser will direct you to step 2.
Setup Payment method for Google Cloud Storage
Let’s choose Individual for Account type and fill in the blanks in Payment method section.
Click on START MY FREE TRIAL.
Don’t be afraid because Google won’t charge you after trial time.
This is the welcome message:
Create a new Cloud Storage Project
Look at the navigation bar on the top of page, you can see My First Project that is automatically created by Google Cloud Storage.
Click on it, then NEW PROJECT.
Type the Project name, then click on CREATE button.
Now we’re gonna click on existing Project: My First Project again, then choose the project that we has just created above:
Create Google Cloud Storage Bucket
On Navigation Menu, choose Cloud Storage.
Browser will turn into Project details page, let’s click on CREATE BUCKET.
Follow step by step to configure the bucket before it is created:
– Name the bucket:
– Choose where to store the bucket:
– Choose storage class:
– Choose access Control:
For more details about each kind, please visit:
In this tutorial, we choose Fine-grained because we want to dynamically change Permission to a given object in the bucket.
– Choose encryption type:
Let’s click on CREATE button to finish the setup.
The process is done and turn into Bucket Details page.
Now you can work with the bucket.
How to get GCP credentials JSON
Open https://console.cloud.google.com/home/dashboard, select your project (BezKoder Project for example).
Then open left menu > IAM & Admin > Service Accounts.
Click on CREATE SERVICE ACCOUNT.
Next, type your Service account name and modify Service account ID.
Click on CREATE button.
This step is optional, you can set specific actions on the resources of the Project with Role and Condition.
And grant users access to this service account (optional).
After all, click on DONE button.
The service account is created successfully, but without key.
Click on the email above to open Service account details.
Choose the KEYS tab and ADD KEY button to Create new key.
A popup will appear, choose the Key type as JSON and click on CREATE.
The file will be stored in your computer with success message.