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.
Additionally, the gcloud CLI reference documents all of the gcloud CLI’s functionality.
Install the latest Cloud SDK version (259.0.0)
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.
You can install the Cloud SDK from a Debian/Ubuntu package for all official Ubuntu releases that have not reached end of life, and Debian stable releases from Wheezy forward.
Note: If you are using an instance on Google Compute Engine, Cloud SDK is installed by default. You can still manually install Cloud SDK using the instructions below.
1.Add the Cloud SDK distribution URI as a package source:
echo “deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main” | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
Note: Make sure you have apt-transport-https installed:
apt-get install apt-transport-https ca-certificates
2. Import the Google Cloud public key:
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key –keyring /usr/share/keyrings/cloud.google.gpg add –
3. Update and install Google Cloud SDK
sudo apt-get update && sudo apt-get install google-cloud-sdk
Note: For additional apt-get
options, such as disabling prompts or dry runs, refer to the apt-get
man pages.
4. Optionally, install any of these additional components:
google-cloud-sdk-app-engine-python
google-cloud-sdk-app-engine-python-extras
google-cloud-sdk-app-engine-java
google-cloud-sdk-app-engine-go
google-cloud-sdk-datalab
google-cloud-sdk-datastore-emulator
google-cloud-sdk-pubsub-emulator
google-cloud-sdk-cbt
google-cloud-sdk-cloud-build-local
google-cloud-sdk-bigtable-emulator
kubectl
For example, the google-cloud-sdk-app-engine-java
component can be installed as follows:
sudo apt-get install google-cloud-sdk-app-engine-java
5. Run gcloud init
to get started:
gcloud init