How to setup a Virtual Machine in Google Cloud Platform?

How to setup a Virtual Machine in Google Cloud Platform?

Most of the developers are preferred to run their applications in one of the Linux machine. Because, Windows is suitable for developing an application. But if we go for running an application, Linux will be the good option. In this blog, we are going to see to setup a new Virtual Machine in Google Cloud Platform.

PREREQUISITES

  1. Google Cloud Platform Account – Billing Enabled
  2. Required Permission to setup a new Virtual Machine

create a new project

Login into the Google Cloud Console and create a new project. The Project name I have given “My-Blog-Project” and the project ID is “my-blog-project-247614”.

New GCP Project

compute engine

After create a new Project, select the project which we created on the top of the project selection drop down. Then, on the left side menu select Compute Engine –> VM Instances.

Compute Engine –> VM Instances

vm instances

After select the VM Instances sub menu, you will be navigated to the instances list screen. If you don’t have an instances before, then you can see the “Create” Instance button on the screen.

VM Instances – Create

create/setup an instance

After clicked the “Create” button, to create and setup a new instance in Google Cloud Platform, follow the below steps one by one.

instance name

Provide a name of the instance and it will be used later to identify our virtual machine instances. The name should unique across the GCP.

Instance name

region and zone

The region is a Geographical location where you are going to run your resources and the zone is an isolated location within your region.

Region and Zone

machine type

Select the Machine type in Machine Configuration section. Lots of Machine Types are available based on our needs. I have selected the standard machine type which contains 1 vCPU and 3.75 GB Memory.

Machine Type

firewall

Add the firewall rules to allow specific network traffic from the internet. Select the check boxes “Allow HTTP Traffic” and “Allow HTTPS Traffic“.

Firewall

boot disk

Every instance required a boot disk to load and run the operating system. The Google Cloud Platform supports many boots disks and we can choose based on our needs. I selected “New 10 GB standard persistent disk Debian GNU/Linux 9 (stretch)”

Boot disk

Then click “Create” button at the bottom of the page and Google Cloud Platform console starts to create a new Virtual Machine. It takes few minutes to create. After successful creation, you can see the new instance on the instances list page.

Instances list

Click SSH drop down on the Connect column to connect and access the VM. I have connected the VM in browser window itself.

Connect VM using SSH

A virtual machine console will open in new browser window and you can execute the LINUX commands on the window to access a new virtual machine.

Connect and Execute the Linux commands

How useful was this post?

Click on a star to rate it!

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

Advertisements

Post your comments