This page shows how to install the Google Cloud SDK, initialize it, and run
gcloud commands from the command-line.
Before you beginCreate a Google Cloud Platform project, if you don't have one already.
The Cloud SDK RPM packages are supported for Red Hat Enterprise Linux 7, Red Hat
Enterprise Linux 8, CentOS 7, and Fedora Core (version 29 and newer). You can
install the package using the
dnf package manager:
# Update YUM with Cloud SDK repo information: sudo tee -a /etc/yum.repos.d/google-cloud-sdk.repo << EOM [google-cloud-sdk] name=Google Cloud SDK baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg EOM # The indentation for the 2nd line of gpgkey is important. # Install the Cloud SDK sudo yum install google-cloud-sdk
Initialize the SDK
gcloud init command to perform several common SDK setup tasks. These
include authorizing the SDK tools to access Google Cloud Platform using your
user account credentials and setting up the default SDK configuration.
To initialize the SDK:
Run the following at a command prompt:
Accept the option to log in using your Google user account:
To continue, you must log in. Would you like to log in (Y/n)? Y
In your browser, log in to your Google user account when prompted and click Allow to grant permission to access Google Cloud Platform resources.
At the command prompt, select a Cloud Platform project from the list of those where you have Owner, Editor or Viewer permissions:
Pick cloud project to use:  [my-project-1]  [my-project-2] ... Please enter your numeric choice:
If you only have one project,
gcloud initselects it for you.
If you have access to more than 200 projects, you will be prompted to enter a project id, create a new project, or list projects.
This account has a lot of projects! Listing them all can take a while.  Enter a project ID  Create a new project  List projects Please enter your numeric choice:
If you have the Google Compute Engine API enabled,
gcloud initallows you to choose a default Compute Engine zone:
Which compute zone would you like to use as project default?  [asia-east1-a]  [asia-east1-b] ...  Do not use default zone Please enter your numeric choice:
gcloud initconfirms that you have complete the setup steps successfully:
gcloud has now been configured! You can use [gcloud config] to change more gcloud settings. Your active configuration is: [default]
(Optional) If you'd like a more streamlined screen reader experience, the gcloud command-line tool comes with an
To enable this property, run:
gcloud config set accessibility/screen_reader true
For more details about the accessibility features that come with the gcloud command-line tool, refer to the Enabling accessibility features guide.
Run core gcloud commands
gcloud commands to view information about your SDK installation:
To list accounts whose credentials are stored on the local system:
gcloud auth list
gclouddisplays a list of credentialed accounts:
Credentialed Accounts ACTIVE ACCOUNT * email@example.com firstname.lastname@example.org
To list the properties in your active SDK configuration:
gcloud config list
gclouddisplays the list of properties:
[core] account = email@example.com disable_usage_reporting = False project = example-project
To view information about your Cloud SDK installation and the active SDK configuration:
gclouddisplays a summary of information about your Cloud SDK installation. This includes information about your system, the installed SDK components, the active user account and current project, and the properties in the active SDK configuration.
To view information about
gcloudcommands and other topics from the command line:
For example, to view the help for
gcloud compute instances create:
gcloud help compute instances create
gclouddisplays a help topic that contains a description of the command, a list of command flags and arguments, and examples of how to use it.
- Read the
gcloudtool guide for an overview of the
gcloudcommand-line tool, including a quick introduction to key concepts, command conventions, and helpful tips.
- Read the
gcloudreference guide for detailed pages on each
gcloudcommand, including descriptions, flags, and examples, that you can use to perform a variety of tasks on Google Cloud Platform.
- Refer to the gcloud command-line tool cheat sheet for a list of commonly used commands and key concepts.
- Install additional Cloud SDK YUM packages.