Create and Configure VM Instance on Google Cloud Platform for Web App Deployment

Google Cloud Platform Virtual Machine

Deploying a web application on a Google Cloud Platform (GCP) Virtual Machine (VM) instance is a powerful way to host your web app with scalable infrastructure. In this guide, we’ll walk through the steps to get your GCP VM instance up and running.

Prerequisites:

  • Google Cloud Platform Account: Ensure you have a GCP account. If not, you can sign up and receive $300 in free credits.

Step-by-Step Guide

1. Create a Google Cloud Project

1) Go to the Google Cloud Console.

Google Cloud Platform (GCP) welcome page

2) Click on the project drop-down menu at the top and select “New Project”.

Google Cloud Platform (GCP) project dropdown
Google Cloud Platform (GCP) New project

3) Enter a project name and click “Create”.

Google Cloud Platform (GCP) create new project.

4) Select your project

Google Cloud Platform (GCP) new project created notification.

2. Create VM instance

1) Select “Compute Engine” from quick access or from the side bar.

Google Cloud Platform (GCP) quick access section Compute Engine
Google Cloud Platform (GCP) Side bar Compute Engine VM instance

2) You will be asked to Enable “Compute Engine API”, Enable it.

Google Cloud Platform (GCP) Enable Compute Engine API

3) After enabling the API, You will be taken to Compute instance page. Click Crate Instance at top of the page.

Google Cloud Platform (GCP) Create VM instance

4) Now put the name, select region and zone, select machine configuration, select VM provisioning model.

Google Cloud Platform (GCP) Create VM instances settings

5) Change boot disk and select Ubuntu OS with latest LTS version instead of Debian and change disk size to 20GB.

Google Cloud Platform (GCP) Create VM instance boot disk settings

6) Under firewall section allow HTTP and HTTPS traffic.

Google Cloud Platform (GCP) Create VM instance FireWall settings

7) After all the settings done click “Create”.

3. SSH into VM instance and update it

Now you can SSH into VM instance using the SSH button.

Google Cloud Platform (GCP) VM instance status


use this command to update.

sudo apt update
Google Cloud Platform (GCP) VM instance SSH update ubuntu

Learn More About Ubuntu here

You got yourself a running VM instance on GCP.

You can close the SSH by using command exit.

Conclusion

Deploying an application on a Google Cloud Platform VM instance provides you with full control over your environment and scalability options. By following these steps, you’ll have a robust setup ready to handle your web traffic.

Feel free to customize the setup according to your specific needs and preferences!

Check Our Other Blogs