Skip to content

How to install and init Google Cloud SDK in Linux (Debian / Ubuntu)?

In this post, we will learn how to install Google Cloud SDK in a Linux operating system especially Debian and Ubuntu distributions. Google CloudΒ SDKΒ is a set of tools, including gcloud, gsutil, and bq command-line tools, client libraries, and local emulators, to work withΒ Google Cloud and develop applications using Google Cloud.

The following steps explain how to install Google Cloud SDK in a Linux environment.

Download the archive

curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-294.0.0-linux-x86_64.tar.gz

You can get the latest link for the archive from this page.

Extract the archive

tar zxvf google-cloud-sdk-294.0.0-linux-x86_64.tar.gz gcloud_sdk

Run install script

cd gcloud_sdk
./install.sh

Output

/install.sh 
Welcome to the Google Cloud SDK!

To help improve the quality of this product, we collect anonymized usage data
and anonymized stacktraces when crashes are encountered; additional information
is available at <https://cloud.google.com/sdk/usage-statistics>. This data is
handled in accordance with our privacy policy
<https://policies.google.com/privacy>. You may choose to opt in this
collection now (by choosing 'Y' at the below prompt), or at any time in the
future by running the following command:

    gcloud config set disable_usage_reporting false

Do you want to help improve the Google Cloud SDK (y/N)?  N


Your current Cloud SDK version is: 293.0.0
The latest available version is: 293.0.0

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                 Components                                                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚     Status    β”‚                         Name                         β”‚            ID            β”‚   Size   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Not Installed β”‚ App Engine Go Extensions                             β”‚ app-engine-go            β”‚  4.9 MiB β”‚
β”‚ Not Installed β”‚ Appctl                                               β”‚ appctl                   β”‚ 21.0 MiB β”‚
β”‚ Not Installed β”‚ Cloud Bigtable Command Line Tool                     β”‚ cbt                      β”‚  7.7 MiB β”‚
β”‚ Not Installed β”‚ Cloud Bigtable Emulator                              β”‚ bigtable                 β”‚  6.6 MiB β”‚
β”‚ Not Installed β”‚ Cloud Datalab Command Line Tool                      β”‚ datalab                  β”‚  < 1 MiB β”‚
β”‚ Not Installed β”‚ Cloud Datastore Emulator                             β”‚ cloud-datastore-emulator β”‚ 18.4 MiB β”‚
β”‚ Not Installed β”‚ Cloud Firestore Emulator                             β”‚ cloud-firestore-emulator β”‚ 40.4 MiB β”‚
β”‚ Not Installed β”‚ Cloud Pub/Sub Emulator                               β”‚ pubsub-emulator          β”‚ 34.9 MiB β”‚
β”‚ Not Installed β”‚ Cloud SQL Proxy                                      β”‚ cloud_sql_proxy          β”‚  3.8 MiB β”‚
β”‚ Not Installed β”‚ Cloud Spanner Emulator                               β”‚ cloud-spanner-emulator   β”‚ 21.3 MiB β”‚
β”‚ Not Installed β”‚ Emulator Reverse Proxy                               β”‚ emulator-reverse-proxy   β”‚ 14.5 MiB β”‚
β”‚ Not Installed β”‚ Google Cloud Build Local Builder                     β”‚ cloud-build-local        β”‚  6.0 MiB β”‚
β”‚ Not Installed β”‚ Google Container Registry's Docker credential helper β”‚ docker-credential-gcr    β”‚  1.8 MiB β”‚
β”‚ Not Installed β”‚ Kind                                                 β”‚ kind                     β”‚  4.5 MiB β”‚
β”‚ Not Installed β”‚ Minikube                                             β”‚ minikube                 β”‚ 22.4 MiB β”‚
β”‚ Not Installed β”‚ Skaffold                                             β”‚ skaffold                 β”‚ 12.0 MiB β”‚
β”‚ Not Installed β”‚ anthos-auth                                          β”‚ anthos-auth              β”‚ 16.0 MiB β”‚
β”‚ Not Installed β”‚ gcloud Alpha Commands                                β”‚ alpha                    β”‚  < 1 MiB β”‚
β”‚ Not Installed β”‚ gcloud Beta Commands                                 β”‚ beta                     β”‚  < 1 MiB β”‚
β”‚ Not Installed β”‚ gcloud app Java Extensions                           β”‚ app-engine-java          β”‚ 62.4 MiB β”‚
β”‚ Not Installed β”‚ gcloud app PHP Extensions                            β”‚ app-engine-php           β”‚          β”‚
β”‚ Not Installed β”‚ gcloud app Python Extensions                         β”‚ app-engine-python        β”‚  6.1 MiB β”‚
β”‚ Not Installed β”‚ gcloud app Python Extensions (Extra Libraries)       β”‚ app-engine-python-extras β”‚ 27.1 MiB β”‚
β”‚ Not Installed β”‚ kpt                                                  β”‚ kpt                      β”‚ 20.3 MiB β”‚
β”‚ Not Installed β”‚ kubectl                                              β”‚ kubectl                  β”‚  < 1 MiB β”‚
β”‚ Installed     β”‚ BigQuery Command Line Tool                           β”‚ bq                       β”‚  < 1 MiB β”‚
β”‚ Installed     β”‚ Cloud SDK Core Libraries                             β”‚ core                     β”‚ 14.5 MiB β”‚
β”‚ Installed     β”‚ Cloud Storage Command Line Tool                      β”‚ gsutil                   β”‚  3.5 MiB β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
To install or remove components at your current SDK version [293.0.0], run:
  $ gcloud components install COMPONENT_ID
  $ gcloud components remove COMPONENT_ID

To update your SDK installation to the latest version [293.0.0], run:
  $ gcloud components update


Modify profile to update your $PATH and enable shell command 
completion?

Do you want to continue (Y/n)?  Y

The Google Cloud SDK installer will now prompt you to update an rc 
file to bring the Google Cloud CLIs into your environment.

Enter a path to an rc file to update, or leave blank to use 
[/home/anand/.bashrc]:  
Backing up [/home/anand/.bashrc] to [/home/anand/.bashrc.backup].
[/home/anand/.bashrc] has been updated.

==> Start a new shell for the changes to take effect.


For more information on how to get started, please visit:
  https://cloud.google.com/sdk/docs/quickstarts

Initialize Google Cloud

./bin/gcloud init

It will ask your login to your Google cloud via browser (oAuth).

Output

Welcome! This command will take you through the configuration of gcloud.

Your current configuration has been set to: [default]

You can skip diagnostics next time by using the following flag:
  gcloud init --skip-diagnostics

Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.                                                                                                                                                                         
Reachability Check passed.
Network diagnostic passed (1/1 checks passed).

You must log in to continue. Would you like to log in (Y/n)?  Y

Your browser has been opened to visit:

    https://accounts.google.com/o/oauth2/auth?code_challenge=Ff0EMiY6B1KOpywkAxg5AMjEPyFdMmztSrjWsG8&prompt=select_account&code_challenge_method=S256&access_type=offline&redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&response_type=code&client_id=32555940559.apps.googleusercontent.com&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth


Opening in existing browser session.
You are logged in as: [schandran@axidio.com].

Pick cloud project to use: 
 [1] agent-chat-swqsssf
 [2] zinconic-plant-277821
 [3] Create a new project
Please enter numeric choice or text value (must exactly match list 
item):  3

Enter a Project ID. Note that a Project ID CANNOT be changed later.
Project IDs must be 6-30 characters (lowercase ASCII, digits, or
hyphens) in length and start with a lowercase letter. myapp-anand
Waiting for [operations/cp.6041098487870253201] to finish...done.                                                                                                                                           
Your current project has been set to: [myapp-anand].

Not setting default zone/region (this feature makes it easier to use
[gcloud compute] by setting an appropriate default value for the
--zone and --region flag).
See https://cloud.google.com/compute/docs/gcloud-compute section on how to set
default compute region and zone manually. If you would like [gcloud init] to be
able to do this for you the next time you run it, make sure the
Compute Engine API is enabled for your project on the
https://console.developers.google.com/apis page.

Created a default .boto configuration file at [/home/anand/.boto]. See this file and
[https://cloud.google.com/storage/docs/gsutil/commands/config] for more
information about configuring Google Cloud Storage.
Your Google Cloud SDK is configured and ready to use!

* Commands that require authentication will use schandran@axidio.com by default
* Commands will reference project `myapp-anand` by default
Run `gcloud help config` to learn how to change individual settings

This gcloud configuration is called [default]. You can create additional configurations if you work with multiple accounts and/or projects.
Run `gcloud topic configurations` to learn more.

Some things to try next:

* Run `gcloud --help` to see the Cloud Platform services you can interact with. And run `gcloud help COMMAND` to get help on any gcloud command.
* Run `gcloud topic --help` to learn about advanced features of the SDK like arg files and output formatting

Done. You can access Google Cloud directly from your local system.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.