← All insightsCheat Sheet

Google Cloud cheat sheet: the complete command reference

CodeWizard Engineering · 29 December 2025 · 3 min read · Beginner

This is a complete, hands-on Google Cloud cheat sheet: install, configure, operate, automate and secure it - with copy-paste commands grouped by task. Bookmark it for day-to-day work, incidents and interviews alike.

Google Cloud offers compute (GCE, GKE, Cloud Run), storage (GCS), networking and managed data/AI services, with GKE as the reference Kubernetes experience and strong IAM.

Why you reach for it

  • GKE is a best-in-class managed Kubernetes
  • Strong data and AI/ML stack (BigQuery, Vertex AI)
  • Clean IAM model and per-project isolation

Installation

bash
curl https://sdk.cloud.google.com | bash
gcloud init
gcloud auth application-default login

Configuration reference

A GCS bucket with uniform access via Terraform.

hcl
resource "google_storage_bucket" "assets" {
  name                        = "acme-assets"
  location                    = "EU"
  uniform_bucket_level_access = true
  versioning { enabled = true }
}

Core commands you use daily

bash
gcloud projects list
gcloud container clusters get-credentials prod --region europe-west1
gcloud run deploy web --image gcr.io/acme/web --region europe-west1

Config & compute

bash
gcloud init
gcloud config set project acme-prod
gcloud compute instances list
gcloud container clusters get-credentials prod --region europe-west1
gcloud run deploy web --image gcr.io/acme/web --region europe-west1

IAM & storage

bash
gcloud projects get-iam-policy acme-prod
gcloud iam service-accounts list
gsutil ls
gsutil -m cp -r ./dist gs://acme-assets

Use it in CI/CD

Auth from GitHub Actions via Workload Identity Federation.

yaml
- uses: google-github-actions/auth@v2
  with:
    workload_identity_provider: projects/123/locations/global/workloadIdentityPools/gh/providers/gh
    service_account: ci@acme.iam.gserviceaccount.com

Best-practice checklist

  • Use Workload Identity Federation - no exported SA keys
  • Grant least-privilege predefined roles per service account
  • Enforce uniform bucket-level access and org policies

Common pitfalls to avoid

  • Service-account key files instead of Workload Identity Federation
  • Primitive roles (Owner/Editor) instead of predefined/custom roles
  • Public buckets from legacy ACLs

Security quick wins

  • Enable org policies, VPC Service Controls and audit logs
  • Scan IaC and avoid primitive roles

Works well with

  • Amazon Web Services - The largest public cloud - compute, storage, networking and managed services, best driven by IaC.
  • Microsoft Azure - The enterprise cloud with deep Entra ID, AKS and first-class DevOps tooling.
  • Kubernetes - Declarative orchestration for containers at scale - self-healing, rolling updates and service discovery.
A cheat sheet is muscle memory on paper - keep it close until the commands live in your fingers.

Want senior help putting Google Cloud to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult