Skip to content

GCP cli configuration on linux

GCP cli configuration on linux
Share

Reading Time: 2 minutes

In this tutorial “GCP cli configuration on linux”. We will show you how to download, Install, and configure GCP CLI on a Linux host. Once you configure you would be able t use gcloud cli and commands.

What is GCP

Google Cloud Platform, offered by Google, is a suite of cloud computing services that provides a series of modular cloud services including computing, data storage, data analytics, and machine learning, alongside a set of management tools.

How to Download Google CLI

Login to your Linux Machine or Server then use curl command as mentioned below. It will download GCP CLI installer package.

In this case, we are downloading in the home directory of the user we logged in, In your case you can log in as non root user, If you want to create non root linux user , Please go through the steps mentioned here.

GCP cli configuration on linux

$ cd ~

$ curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-450.0.0-linux-x86_64.tar.gz

$ tar -xf google-cloud-cli-450.0.0-linux-x86_64.tar.gz

cd /home/tetertechie1/google-cloud-sdk

Follow the Below and Type “Y”

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

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

GCP cli configuration on linux

$ ./google-cloud-sdk/bin/gcloud init

You will get the URL on your terminal, Copy the URL open it in the browser, and log into the Google Cloud console, You will get the Authorization code copy the same code and Enter in the Terminal as shown below.

Enter authorization code:

Do you want to configure a default Compute Region and Zone? (Y/n)? Y

gcloud auth login –no-launch-browser

Validate GCP CLI

$ cd /home/tetertechie1/google-cloud-sdk/bin

$ ./gcloud compute instances list

Create gcloud alias

vi .bash_profile

Add Below and save file.

alias glcoud=’/home/tetertechie1/google-cloud-sdk/bin/gcloud

Add gcloud absolute path that you have in your host, DO NOT delete this path.

source .bash_profile

Conclusion:

We hope you are able to use GCP GCI after going through GCP cli configuration on linux tutorial and this “GCP cli configuration on linux” tutorial helped you/.


Share

Leave a Reply

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

?>