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.

Install the latest Cloud Tools version (141.0.0)

Linux
  1. Make sure that Python 2.7 is installed on your system.
  2. python -V
    
  3. Download one of the following:
  4. Platform Package Size SHA1 Checksum
    Linux (x86_64) google-cloud-sdk-141.0.0-linux-x86_64.tar.gz 9.3 MB c0d3bbe71f9d7ec0b0c466c2976081b397af1bec
    Linux (x86) google-cloud-sdk-141.0.0-linux-x86.tar.gz 9.3 MB 10a57798edb2874eca664ee9ac5a58cd3df72f3b

  5. Extract the file to any location on your file system.
  6. Optional. Run the install script to add SDK tools to your path, enable command-completion in your bash shell, and/or and enable usage reporting.
    ./google-cloud-sdk/install.sh
    
    Open a new terminal so that the changes take effect.
  7. Run gcloud init to initialize the SDK:
  8. ./google-cloud-sdk/bin/gcloud init
    
  9. Optional. Install additional components using the component manager.
Debian/Ubuntu

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. Create an environment variable for the correct distribution:
    export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
  2. Add the Cloud SDK distribution URI as a package source:
    echo "deb https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
  3. Import the Google Cloud public key:
    curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
  4. Update and install the Cloud SDK:
    sudo apt-get update && sudo apt-get install google-cloud-sdk
  5. Optionally install any of these additional components:
    • google-cloud-sdk-app-engine-python
    • google-cloud-sdk-app-engine-java
    • google-cloud-sdk-datastore-emulator
    • google-cloud-sdk-pubsub-emulator
    • 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
  6. Run gcloud init to get started:
    gcloud init
Red Hat/CentOS

Cloud SDK is available in package format for installation on Red Hat Enterprise Linux 7 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 seperately.

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

  1. 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
    

    Important: The second line of gpgkey must be indented as shown.

  2. Install the Cloud SDK:
    yum install google-cloud-sdk
  3. Optionally, install any of these additional components:
    • google-cloud-sdk-app-engine-python
    • google-cloud-sdk-app-engine-java
    • google-cloud-sdk-datastore-emulator
    • google-cloud-sdk-pubsub-emulator
    • kubectl

    For example, the google-cloud-sdk-app-engine-java component can be installed as follows:

    yum install google-cloud-sdk-app-engine-java
  4. Run gcloud init to get started:
    gcloud init
Mac OS X
  1. Make sure that Python 2.7 is installed on your system.
  2. python -V
    
  3. Download one of the following:
  4. Platform Package Size SHA1 Checksum
    Mac OS X (x86_64) google-cloud-sdk-141.0.0-darwin-x86_64.tar.gz 9.3 MB 1322927c7955191595ebe79b834b2c705e4d266b
    Mac OS X (x86) google-cloud-sdk-141.0.0-darwin-x86.tar.gz 9.3 MB 74b6d80a58b8c9c8273e847c8f96602b5c0f1ae6

  5. Extract the file to any location on your file system.
  6. Optional. Run the install script to add SDK tools to your path, enable command completion in your bash shell, and/or and enable usage reporting.
    ./google-cloud-sdk/install.sh
    
    Open a new terminal so that the changes take effect.
  7. Run gcloud init to initialize the SDK:
  8. ./google-cloud-sdk/bin/gcloud init
    
  9. Optional. Install additional components using the component manager.
Windows
  1. Download the Cloud SDK installer. The installer is signed by Google Inc.

  2. Launch the installer and follow the prompts. If Python 2.7 is not installed on your system, make sure the option to install Bundled Python is checked.

  3. After installation has completed, accept the following options:

    • Start Cloud SDK Shell
    • Run gcloud init

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

  5. 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.

Note: On Google Compute Engine instances running Windows Server, Internet Explorer is set for Enhanced Security Configuration. This setting prevents you from running the installer above. Disable Enhanced Security Configuration first, restart Internet Explorer and then run the installer. For instructions on disabling Enhanced Security on your Windows Server Instance, open Windows Help and Support and search for "IE ESC".

Install the latest Google Cloud Client Libraries

You can download Cloud Client Libraries for supported languages.

Send feedback about...