How to Setup Google Cloud CLI/SDK – Beginner Guide

This tutorial will guide you through steps for setting up google cloud SDK on your workstation.

This tutorial will work only on MAC and Linux systems

Step 1: Select the download appropriate sdk package from https://cloud.google.com/sdk/

Step 2: Untar the sdk package.

Step 3: Install the sdk using the following command.

Step 3: Follow through the installation instruction and select the required options.

Configuring Google Cloud SDK

Follow the steps given below for configuring the google cloud sdk.

1. Initialize the sdk using the following commands. Y

2. Accept the google login option for logging in to your google cloud account.

3. From the browser login to your google cloud account and grant permissions to access google cloud resources.

4. At the command prompt, you will be prompted with options for initial configurations which are self explanatory.

Testing the CLI setup

Now lets run some basic gcloud cli commands to verify the installation.

1. List the credential account.

2. List the sdk configuration.

3. List all the local gcloud configurations and files

4. To list all the gcloud commands, use the following command.

Create an Instance Using CLI

To start with, we will create a instance using the CLI.

READ  Docker Machine Tutorial : Getting Started Guide

1. Get the list of images using the following command.

2. The following command will create a f1 micro Centos instance. You can refer this official documentation for more information on the flags.

Connecting Instance  via ssh

To connect the instance via ssh, just execute the following command. The gcloud command will automatically create the ssh key in your ~/.ssh folder if it doesn’t exist and connects to your instance.

For example,

Deleteting the Instance

You can delete the created instance using the follwing command.

For example,

Free DevOps Resources

Get DevOps news, tutorials and resources in your inbox. A perfect way If you want to get started with devops. Like you, we dont like spam.

Leave a Reply

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