How to install Google Cloud CLI on Windows?

Pre-requisites

Before installation, make sure that one of the following OS versions is installed:

  • Windows 8.1 or later
  • Windows Server 2012 or later

Installation steps

Perform the following steps to install the Google Cloud CLI:

Step 1: Download the Google Cloud CLI installer

To install the Google Cloud installer, click on this link or execute the following command in the PowerShell terminal:

(New-Object Net.WebClient).DownloadFile("https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe", "$env:Temp\GoogleCloudSDKInstaller.exe")
& $env:Temp\GoogleCloudSDKInstaller.exe

Step 2: Install the packages

To install the necessary packages, launch the downloaded installer and follow the prompts. The installer will install all required dependencies including Python 3.

Note: If you already have Python 3 installed, uncheck the “Install Bundled Python” checkbox. Check the “Turn on screen reader mode” checkbox if you use a screen reader.

Step 3: Initialize the CLI

Once the installation is finished, the following options are displayed on the screen:

  • Create Start Menu
  • Create a Desktop shortcut
  • Start the Google Cloud CLI shell
  • Configure the Google Cloud CLI

Select options 3 and 4, that is, start the Google Cloud CLI shell and configure the gcloud CLI and then click the “Finish” button. This opens a terminal window. Execute the following command:

gcloud init

Step 4: Install additional gcloud componenets (optional)

Window’s gcloud CLI installer does not include App Engine extensions. Additional components of gcloud can be installed using the following command:

gcloud components install [COMPONENT_ID]

For example, to install the “App Engine Go Extensions” component, use the following command:

gcloud components install app-engine-go

Similarly, update and remove keywords can be used instead of install to update and remove the gcloud components.

Troubleshoot

  • If unzipping the installer fails, try to run it as an administrator.
  • If the installation fails because the FIND command is not recognized, make sure the PATH environment variable is configured to include the find folder. This is usually C:WINDOWSsystem32;.
  • System reboot is required to reinstall the gcloud CLI if you uninstall it.

Free Resources