Setup Google Cloud Command Line interface


Overview

The purpose of this page is to walk through the process of installing and configuring the Google Cloud Command line interface.

This guide is not meant to be exhaustive but rather a quick start.


Prerequisites

  • A Google Cloud account
  • Access to a supported command line environment such as Windows, Linux or Apple OSX.
  • Python 2.7.9 or later.
    Use python -V to determine the current version of python installed on your system.

What’s covered in this guide


Installing The Google Cloud Command Line interface

The Google Cloud command line interface can be installed in a variety of environments, including MacOS, Linux and Windows.

Important Note

Important

The Google Cloud CLI install process is governed by Google and may change at any moment. This page is meant as a guide. Please consult the Google Cloud CLI documentation for exact details of the command line interface and similar topics.

  1. Open a browser to Google cloud CLI overview page.
  2. In the Install the latest Cloud SDK section section select an appropriate environment.
  3. Execute the download and install Google Cloud CLI as appropriate for for your environment:
    For example on Mac OSX:

     

    cd ~/Downloads
    tar -xvf google-cloud-sdk-MMM.mm.v....tar.gv
    ./google-cloud-sdk/install.sh

    On Windows 10 using powershell as administrator (note all on a single line, split for ease of review):
    (New-Object Net.WebClient).DownloadFile(
    "https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe", 
    "$env:Temp\GoogleCloudSDKInstaller.exe")
    followed by :
    & $env:Temp\GoogleCloudSDKInstaller.exe

Initializing the Google Cloud environment

You must initialize the Google Cloud CLI

  • After installing the Google Cloud environment, initialize using a command similar to:
    on Mac OSX:
    ./google-cloud-sdk/bin/gcloud init

    On Windows:
    gcloud init
    Info

    Note

    Under Windows the gcloud init command is typically run to complete required initialization.
    If required open a Google Cloud command window, using the desktop icon, and execute the gcloud init command.

Top