Google Cloud

How to Setup and Configure Google Cloud CLI/SDK

In this tutorial, we explain how to setup and configure Google Cloud CLI or SDK on Linux/MAC. Assuming you have already created VM Instance in GCP.

Step 1: Download SDK package from Google Cloud SDK

Step 2: Now, Untar the download Google Cloud SDK follow below command.

Step 3: Run the script to install SDK mention below command.

Step 4: As per the requirement select required to setup and configure Google Cloud CLI or SDK

Steps to Configure Google Cloud SDK

Follow mention simple steps to configure Google Cloud SDK

  1. First, you need to initialize the SDK with commands. Y
  1. Login to Google account and process
  1. Goto any of the web browser and login to your Google Cloud account and allow permission to access Cloud service
  2. You will get prompted on command prompt and proceed with the initial configuration

Now Check Google CLI

To test you can run some of the gcloud cli command

  1. Credential account
  1. Now list the SDK configuration
  1. Check the gcloud configuration info
  1. You can also check all the commands follow command
Let’s take an example for Instance creation

Steps to create Instance in Google Cloud using CLI

  1. Command to list images to launch Instance
  1. Now create f1 micro Centos Instance with the following command
Steps to connect instance via SSH

Follow mention command to connect the instance via ssh.

Above command will automatically create ssh key in your ~/.ssh directory and connect to your instance

For Example:

Steps to delete the Instance in Google Cloud

It is very easy to delete the instance using cli, make sure your entry correct instance name or you may delete some other instance.

For Example,

This is how to Setup and Configure Google Cloud CLI or SDK.

Related Articles

Leave a Reply

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


Adblock Detected

Please consider supporting us by disabling your ad blocker