e2-micro VM tutorial – Google Cloud Platform

 How to Create a Virtual Machine (VM) on Google Cloud (Beginner-Friendly Guide)


Here's a complete, easy-to-follow tutorial for creating a **Virtual Machine (VM)** on Google Cloud using Compute Engine, with a focus on selecting the **e2-micro** machine type — a low-cost (free-tier eligible) option perfect for testing, small projects, or learning.

### What is a Google Cloud VM?
Google Cloud's Compute Engine lets you create virtual machines that run in Google's data centers. You choose the operating system (e.g., Ubuntu), resources (CPU, memory), storage, and more. The **e2-micro** is a shared-core machine with **2 vCPUs** (burstable) and **1 GB memory**. It's great for beginners and often qualifies for the **Always Free tier** (one e2-micro instance per month in specific US regions, up to 30 GB standard persistent disk, with limits on outbound data).

**Important notes before starting:**
- You need a Google account. New users get $300 in free credits (90-day trial).
- For the free tier, create the VM in **us-west1**, **us-central1**, or **us-east1** regions, use a **standard persistent disk** (up to 30 GB), and avoid features that add costs.
- Billing must be enabled, but staying within limits means no charges — always monitor usage in the console.
- The Google Cloud Console interface may have minor updates, but the core steps remain the same.

### Step-by-Step Guide

**Step 1: Set Up Your Google Cloud Account and Project**  
Go to the [Google Cloud Console](https://console.cloud.google.com/).  
Sign in with your Google account (or create one).  
If prompted, accept the terms and set up billing (add a payment method — you won't be charged if you stay in free limits).  
Create a new **project** (or select an existing one):  
- Click the project dropdown at the top.  
- Click **New Project** → Give it a name (e.g., "My-First-VM") → Create.  

Once in the project, search for "Compute Engine" in the top search bar or go via the left menu: **Compute Engine** > **VM instances**.  
(The first time, you may need to click **Enable**.)

**Step 2: Start Creating the VM Instance**  
In **VM instances**, click the **Create Instance** button (usually blue, at the top).

**Step 3: Configure Basic Instance Details**  
- **Name**: Give your VM a unique, lowercase name with hyphens (e.g., `my-first-vm`).  
- **Region**: Choose **us-west1** (Oregon), **us-central1** (Iowa), or **us-east1** (South Carolina) for free tier eligibility.  
- **Zone**: Leave as default or pick any available zone in the region (e.g., `us-west1-a`).

**Step 4: Select the Machine Type (e2-micro)**  
Under **Machine configuration**, click **Machine type** (or the edit icon).  
- **Series**: Choose **E2**.  
- **Machine type**: Select **e2-micro** (shared core, 2 vCPUs burstable, 1 GB memory).  
You'll see an estimated monthly cost on the right (it should be low or $0 if free tier applies).

**Step 5: Configure the Boot Disk (OS and Storage)**  
Under **Boot disk**, click **Change**.  
- **Operating system**: Choose **Ubuntu** → Select **Ubuntu 24.04 LTS** (recommended for beginners).  
- **Boot disk type**: Select **Standard persistent disk** (required for free tier).  
- **Size**: Set to **10–30 GB** (30 GB max for free tier).  
Click **Select**.

**Step 6: Networking and Firewall Settings**  
- **Network interfaces**: Leave as default.  
- **Firewall**:  
  - Check **Allow HTTP traffic** if you plan to run a web server (opens port 80).  
  - Check **Allow HTTPS traffic** for secure web (port 443).  
- Ensure it has an **Ephemeral** external IP for connection.

Leave advanced options (Security, Metadata, Management) as default for a simple setup.

**Step 7: Review and Create**  
Review the **Estimated cost** on the right side.  
Click **Create**.  
The VM will provision in 1–2 minutes. You'll see it in the list with a green status when running.

**Step 8: Connect to Your VM (via SSH)**  
In the VM instances list, click the **SSH** button under the Connect column (opens a browser-based terminal).  
Once connected, update packages:  
`sudo apt update && sudo apt upgrade -y`

**Step 9: Basic Management**  
- **Stop/Start**: Use the buttons in the console (stop when not using to save resources).  
- **Delete**: Select the VM and click **Delete** when finished (this removes everything).  
- Monitor costs in the **Billing** section and set up alerts.

### Free Tier Tips
- Only **one e2-micro** per month is free (up to ~730 hours).  
- Stick to the three US regions and **standard persistent disk**.  
- Outbound data is limited (~1 GB/month in free tier).  
- You can stop the VM anytime when not in use.

### Next Steps
Install software inside the VM (e.g., `sudo apt install nginx -y` for a web server).  
Experiment with Docker, Node.js, or other tools.  
For more advanced setups, explore Google Cloud documentation or free labs.

This process usually takes 5–10 minutes. Enjoy your first Google Cloud VM!

Post a Comment

Copyright © Daily insights . Designed by OddThemes