Installing with apt-get (Debian and Ubuntu only)

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-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
    Note: Make sure you have apt-transport-https installed:
    sudo apt-get install apt-transport-https ca-certificates gnupg
  2. Import the Google Cloud public key:
    curl | sudo apt-key --keyring /usr/share/keyrings/ add -
  3. Update and install the 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-bigtable-emulator
    • google-cloud-sdk-cbt
    • google-cloud-sdk-cloud-build-local
    • google-cloud-sdk-datalab
    • google-cloud-sdk-datastore-emulator
    • google-cloud-sdk-firestore-emulator
    • google-cloud-sdk-pubsub-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

Downgrading Cloud SDK versions

If you'd like to revert to a specific version of Cloud SDK, where VERSION is of the form 123.0.0, run:

sudo apt-get update && sudo apt-get install google-cloud-sdk=123.0.0-0