Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • DevOps Lifecycle
  • DevOps Roadmap
  • Docker Tutorial
  • Kubernetes Tutorials
  • Amazon Web Services [AWS] Tutorial
  • AZURE Tutorials
  • GCP Tutorials
  • Docker Cheat sheet
  • Kubernetes cheat sheet
  • AWS interview questions
  • Docker Interview Questions
  • Ansible Interview Questions
  • Jenkins Interview Questions
Open In App
Next Article:
Create AWS S3 Bucket using CLI
Next article icon

How To Create GCP Bucket Using CLI ?

Last Updated : 26 Mar, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Users can store and manage their data in the cloud with Google Cloud Storage (GCS), the service is provided by the Google Cloud Platform (GCP). Having the big virtual hard drive to store files, documents, photos, movies, and other media is similar to that.

Within Google Cloud Storage, a bucket refers to a folder or container where you can group and store your data. The bucket can store a lot of data and has a special name. Using buckets, you may manage file access and storage. They also offer features like versioning, lifecycle management, and access control to help you manage your data efficiently.

Steps to Create GCP Bucket Using CLI

Step 1: Activate Cloud Shell by clicking Cloud Shell on the GCP console.

GCP Console

Authorize to cloud shell by clicking the authrozie as shown image below.

Authorize

Step 2: Verify the gcloud installed or not using the below command. If gcloud is not installed you can install the gcloud by following the link.

Gcloud

Step 3: Click on below command and authorize your project

gcloud auth login

Step 4: Aftre authorization click on below command and the bucket is created.

gsutil mb -p PROJECT_ID -c STORAGE_CLASS -l LOCATION gs://BUCKET_NAME

Enter your real values in the replacements:

  • PROJECT_ID: Your GCP project Id.
  • STORAGE_CLASS: The bucket's storage class (standard, nearline, coldline, etc.).
  • LOCATION: The location for the bucket (e.g., us-central1, europe-west1).
  • BUCKET_NAME: The name for your bucket.
Create Bucket

Google Cloud Platforms (GCP) provides gsutil, a command-line tool for dealing with the Google Cloud Storage (GCS). It enables you to use your terminal or command prompt to carry out a number of tasks, include upload, download, copy, and deleting the files in GCS buckets. You can efficiently handle your cloud storage resources with gsutil without utilize the GCP Console interface.

Step 5: Vrify the bucket is created. Click on Storage and click on buckets.

Click on Storage

Step 6: Below image refers the bucket is created on GCP

Verify the Bucket

Some common use cases for Google Cloud Storage (GCS) buckets

  • Keeping and delivering content for static websites.
  • Data archiving and backup.
  • Archiving video and image material created by users.
  • Analyzing large datasets with BigQuery or other data processing services.
  • Integrating with other GCP services like Cloud Functions, Cloud Run, or AI Platform.
  • Sharing files and collaborating across teams or organizations.
  • Storing media assets for apps or streaming services.
  • Storing logs and telemetry data for monitoring and analysis.
  • Implementing disaster recovery and business continuity strategies.
  • Utilizing object storage to create apps that are robust and scalable.

Conclusion

Buckets from Google Cloud Storage (GCS) offer a dependable and expandable cloud data management and storage solution. GCS enables customers to effectively manage their data and develop creative solutions on Google Cloud Platform with easy-to-follow instructions for creating buckets using the CLI and a wide range of use cases, from data analysis to website hosting. For developers, data scientists, and company owners alike, GCS provides the adaptability and dependability required to meet your cloud storage needs.

How do I create a public bucket in GCP?

To create a public bucket in GCP, first, create the bucket using the gsutil mb command, then set the bucket's default ACL to include the allUsers group with the READ permission.

What is gsutil command line tool?

The gsutil command-line tool is provided by Google Cloud Platform (GCP) to interact with Google Cloud Storage (GCS). It allows users to perform various operations such as uploading, downloading, copying, and managing objects and buckets in GCS from the terminal or command prompt.

What is a bucket in GCP?

A bucket in Google Cloud Platform (GCP) is a container for storing data objects in Google Cloud Storage (GCS). It provides a way to organize and manage data, offering features like versioning, access control, and lifecycle management.


Next Article
Create AWS S3 Bucket using CLI

S

saitejaved1caz
Improve
Article Tags :
  • Google Cloud Platform
  • DevOps
  • Dev Scripter
  • Dev Scripter 2024
  • gcp

Similar Reads

  • Create AWS S3 Bucket using CLI
    Amazon S3 is a Simple Storage Service in AWS that stores files of different types like Photos, Audio, and videos as objects providing more scalability and security. It allows users to store and retrieve any amount of data at any point in time from anywhere on the web. It facilitates features such as
    7 min read
  • How To Create Cloud Storage Buckets In GCP ?
    It is becoming very important to protect and secure our data since more threats and attacks can be seen nowadays. Cyberattacks and data breaches are very common, and it is very difficult to track them. Some cases of attacks also go unreported and undetected. Before facing such attacks and threats on
    7 min read
  • How to Create Storage Bucket in GCP Using Terraform?
    In Cloud Computing, it is very crucial to provide efficient storage solutions. Google Cloud Platform (GCP) offers an exemplary service through it's Storage Bucket. Storage Buckets are versatile containers for securely storing data objects while providing scalability, durability, and global accessibi
    6 min read
  • How to Create Subfolders in S3 Bucket using AWS CLI
    The AWS Simple Storage Service (S3) is a cloud service provided by Amazon Web Services (AWS) to store your data securely. There are different approaches to storing and retrieving data from AWS S3; one of them is using the AWS CLI provided by Amazon Web Services. In this article, we will provide you
    7 min read
  • How To Create a Google Cloud Storage Bucket?
    Pre-requisite: Google Cloud Platform Google Cloud Storage Bucket is a service that allows you to store and retrieve large amounts of unstructured data, such as videos, images, audio files, and backups. The data is stored in objects, which are simply files and their metadata. Each object is associate
    2 min read
  • How to Create AWS S3 Bucket Using Terraform?
    S3 stands for Simple Storage Service. S3 buckets are cloud storage services by Amazon Web Service. It is used to store objects, It consists of data in any format like documents, images, videos, and application code. These are highly scalable. Prerequisite: AWS AccountTerraform InstallationAWS CLISte
    3 min read
  • How To Create Alerts In GCP ?
    Monitoring through the Google Cloud Platform (GCP) enables resource monitoring in the cloud. You will be able to monitor their performance, discover problems early, and make sure everything goes according to plan. You can maintain control over your cloud services and the smooth operation of your app
    5 min read
  • How to Create Load Balancer in GCP using Terraform ?
    As traffic controls, load balancers on the Google Cloud Platform (GCP) distribute incoming requests among multiple instances of your application. Consider them as traffic engineers that direct customers to the busiest locations to deliver a dependable and responsive service, especially during period
    5 min read
  • How to create a container using Podman?
    The emergence of Podman as a powerful engine for containers without daemons has presented a very good alternative to Docker. Always having your Podman installation up to date means that you will have the latest features, bug fixes, and security enhancements. This guide will take you through the step
    3 min read
  • How To Create Autoscaling Group In AWS Using Terraform ?
    An auto-scaling group is a service that is provided in EC2 and is primarily used for an automatic increase or decrease in a number of EC2 instances based on the application's user traffic. For example, if your application is experiencing high traffic, the auto-scaling group can launch extra instance
    7 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences