Google Cloud Platform (GCP) provides powerful cloud computing services that make it easy to run applications, store data, and scale resources. One of the first things most developers do after signing up for GCP is create a Virtual Machine (VM) using Compute Engine.
In this guide, we’ll walk you through creating your first Virtual Machine in Google Cloud Platform.
Step 1: Sign in to Google Cloud Console
Go to the Google Cloud Console and sign in with your Google account.
If you’re a new user, you’ll also get free credits to explore GCP services.
Step 2: Select or Create a Project
Every resource in GCP is tied to a project.
- In the top navigation bar, select an existing project or click “New Project” to create one.
- Give your project a name (e.g., my-first-vm).
Step 3: Enable Compute Engine API
Before creating a VM, enable the Compute Engine API:
- Go to the APIs & Services section.
- Search for Compute Engine API.
- Click Enable.
Step 4: Create a New VM Instance
- In the left-hand menu, go to Compute Engine → VM Instances.
- Click “Create Instance”.
- Fill in the details:
- Name: Choose a name (e.g.,
test-vm
). - Region & Zone: Select a location close to you.
- Machine Type: For testing, choose
e2-micro
(eligible for the free tier). - Boot Disk: Select the operating system (Ubuntu, Debian, Windows, etc.).
- Firewall: Check boxes if you want to allow HTTP/HTTPS traffic.
- Name: Choose a name (e.g.,
Step 5: Create and Access Your VM
- Click Create.
- After a few seconds, your VM will be ready.
- To connect via SSH, click the SSH button next to your instance in the VM Instances list.
You now have access to your server’s terminal! 🎉
Step 6: Install Software (Optional)
Once inside your VM, you can install software like a normal Linux server. For example:
sudo apt update && sudo apt upgrade -y
sudo apt install nginx -y
If you installed Nginx, open your browser and visit your VM’s external IP – you’ll see the default Nginx welcome page.
Step 7: Manage Your VM
- Stop/Start: You can stop and restart your VM anytime.
- Resize: Change CPU and memory as per your project needs.
- Delete: Don’t forget to delete unused VMs to avoid billing charges.
Final Thoughts
Creating a VM in Google Cloud Platform is quick and beginner-friendly. It’s a great way to learn server administration, deploy apps, or test cloud-based solutions.
👉 If you’re new to cloud computing, check out our guide on How to Setup a Git Server on Ubuntu 24.04 .
👉 For more details, explore Google’s official Compute Engine Documentation.