- HX Club
- November 16, 2021
How to Setup Google Cloud CLI (gcloud cli) on Ubuntu
The gcloud CLI manages authentication, local configuration, developer workflow, interactions with Google Cloud APIs. With the gcloud command-line tool,.it’s easy to perform many common cloud tasks, like creating a Compute Engine VM instance, and deploying an App Engine application, either from the command line or in scripts and other automations.
- Add the Cloud SDK distribution using the following command:-
echo “deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main” | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
- Import the Google Cloud public key:
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key –keyring /usr/share/keyrings/cloud.google.gpg add –
- Update and install the Cloud SDK:
sudo apt-get update && sudo apt-get install google-cloud-sdk
- Press Y & Enter.
- Install any of these additional components:
sudo apt-get install google-cloud-sdk-app-engine-java google-cloud-sdk-app-engine-python google-cloud-sdk-pubsub-emulator google-cloud-sdk-bigtable-emulator google-cloud-sdk-datastore-emulator kubectl
- Run gcloud init to get started:
gcloud init
- Then click on link & provide your mail-id & password.
- Click on Allow.
- Copy the verification code.
- Paste the code on Terminal.
- Enter a number & Select your project or Create a new project.
- Select Region & Zone.
- Google Cloud SDK is now configured and ready to use!