Google Cloud SDK documentation

Google Cloud SDK is a set of tools that you can use to manage resources and
applications hosted on Google Cloud Platform. These include the
gcloud, gsutil,
and bq command line tools. The gcloud
command-line tool is downloaded along with the Cloud SDK; a comprehensive guide
to the gcloud CLI can be found in gcloud command-line tool overview.

Install the latest Cloud SDK version (295.0.0)

Note: Cloud SDK uses Python 2 by default, but will soon move to Python 3 (run gcloud topic startup for exclusions and more information on configuring your Python interpreter to use a different version). Consider upgrading to Python 3 to avoid disruption in the future.

Extract the contents of the file to any location on your file system. If
you would like to replace an existing installation, remove the existing
google-cloud-sdk directory and extract the archive to the same
location.

Optional. Use the install script to add Cloud SDK tools to your path. You'll
also be able to opt-in to command-completion for your shell and
usage statistics collection. Run the
script using this command:

Cloud SDK is available in package format for installation on Debian and Ubuntu systems. This
package contains the gcloud, gcloud alpha, gcloud beta,
gsutil, and bq commands only. It does not include kubectl
or the App Engine extensions required to deploy an application using gcloud commands.
If you want these components, you must install them separately as described
later in this section.

Troubleshooting Tip: If you are unable to get latest updates due to an expired
key, obtain the latest
apt-get.gpg key file.
Troubleshooting Tip: If your distribution's apt-key command does not support the
--keyring argument run this command instead,

Cloud SDK is available in package format for installation on Red Hat Enterprise Linux 7, Red Hat
Enterprise Linux 8, and CentOS 7 systems. This package contains the gcloud,
gcloud alpha, gcloud beta, gsutil, and bq
commands only. It does not include kubectl or the App Engine extensions required to
deploy an application using gcloud commands, which can be
installed separately.

Note: If you are using an instance on Google Compute Engine, Cloud SDK is
installed by default.

Cloud SDK requires Python. Supported versions are 3.5 to 3.7,
and 2.7.9 or higher. Modern versions of macOS include the appropriate
version of Python required for the Cloud SDK.

python -V

Note: Cloud SDK uses Python 2 by default, but will soon move to Python 3 (run gcloud topic startup for exclusions and more information on configuring your Python interpreter to use a different version). Consider upgrading to Python 3 to avoid disruption in the future.

Extract the contents of the file to any location on your file system. If
you would like to replace an existing installation, remove the existing
google-cloud-sdk directory and extract the archive to the same
location.

Optional. Use the install script to add Cloud SDK tools to your path. You'll
also be able to opt-in to command-completion for your shell and
usage statistics collection. Run the
script using this command:

The installer will install all necessary dependencies, including the needed Python version.
While Cloud SDK currently uses Python 2 by default, you can use an existing Python installation
if necessary by unchecking the option to 'Install Bundled Python'.
.

Note: Cloud SDK uses Python 2 by default, but will soon move to Python 3
(run gcloud
topic startup for exclusions and more information on configuring your
Python interpreter to use a different version). Consider upgrading to Python 3
to avoid disruption in the future.

After installation has completed, accept the following options:

Start Cloud SDK Shell

Run gcloud init

The installer starts a terminal window and runs the
gcloud init command.

The default installation does not include the App Engine extensions required to deploy an
application using gcloud commands. These components can be installed using the
Cloud SDK component manager.