100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

GCP Compute Engine Cheat Sheet

GCP Compute Engine Cheat Sheet

Commands for creating, connecting to, and managing virtual machine instances and disks on Google Compute Engine.

2 PagesBeginnerFeb 15, 2026

Instance Lifecycle

Create, list, and control VM instances.

bash
gcloud compute instances create my-vm \  --zone=us-central1-a \  --machine-type=e2-medium \  --image-family=debian-12 --image-project=debian-cloud \  --boot-disk-size=20GBgcloud compute instances listgcloud compute instances stop my-vm --zone=us-central1-agcloud compute instances start my-vm --zone=us-central1-agcloud compute instances delete my-vm --zone=us-central1-a

SSH & File Transfer

Connect to and copy files to/from an instance.

bash
gcloud compute ssh my-vm --zone=us-central1-agcloud compute scp ./localfile.txt my-vm:~/remote.txt --zone=us-central1-agcloud compute scp my-vm:~/remote.txt ./localfile.txt --zone=us-central1-a

Disks & Images

Manage persistent disks and custom images.

bash
gcloud compute disks create my-disk --size=100GB --zone=us-central1-agcloud compute instances attach-disk my-vm --disk=my-disk --zone=us-central1-agcloud compute images create my-image --source-disk=my-disk --source-disk-zone=us-central1-a

Machine Families

Key machine families to know.

  • E2- Cost-optimized, general purpose, shared-core options available
  • N2 / N2D- Balanced price/performance for general workloads
  • C2 / C3- Compute-optimized, high per-core performance
  • A2 / A3- GPU-accelerated instances for ML/AI workloads
  • Preemptible / Spot VM- Short-lived, discounted instances that can be reclaimed by GCP anytime

Key Concepts

Key key concepts to know.

  • Instance Template- Reusable VM configuration used to create instances or managed instance groups
  • Managed Instance Group (MIG)- Auto-scaling, self-healing group of identical VM instances
  • Persistent Disk- Durable network-attached block storage independent of instance lifecycle
  • Startup Script- Shell script run automatically on instance boot via metadata
Pro Tip

Use Spot VMs for fault-tolerant batch or stateless workloads — they cost up to 60-91% less than standard on-demand pricing, but design your workload to checkpoint progress since GCP can reclaim them with only 30 seconds notice.

Was this cheat sheet helpful?

Explore Topics

#GCPComputeEngine#GCPComputeEngineCheatSheet#CloudComputing#Beginner#InstanceLifecycle#SSHFileTransfer#DisksImages#MachineFamilies#CheatSheet#SkillVeris
Advertisement
Sri Hayavadhana Info-Tech

Professional Web Designing Services

  • Responsive Websites
  • E-commerce Solutions
  • SEO Friendly Design
  • Fast & Secure
  • Support & Maintenance
Get a Free Quote

Share this Cheat Sheet