The console and Cloud Shell

Google Cloud · Essentials · 6 min

It is the fastest way to start: no local install, the right credentials and the tools preinstalled.

The Google Cloud console (console.cloud.google.com) is the web UI. The project picker at the top decides which project you are looking at; most confusion for beginners comes from being in the wrong project. The navigation menu lists every product, and you can pin the ones you use. The search bar finds products, resources and docs.

Click the terminal icon to open Cloud Shell: a small Linux VM in your browser with gcloud, kubectl, terraform, docker, Python, Node.js and Git preinstalled, already authenticated as you. Key facts:

  • Your $HOME is a 5 GB persistent disk; everything outside it resets between sessions.
  • The selected project is exported as GOOGLE_CLOUD_PROJECT.
  • Cloud Shell Editor gives you a VS Code-style editor on the same machine.
  • Sessions end after inactivity, and the home disk is deleted if you do not use Cloud Shell for 120 days.

Use the console to explore and learn what exists, and Cloud Shell or the CLI to do things repeatably. Most console pages have an "Equivalent command" or "Equivalent code" option that shows the gcloud command or REST request, which is a good way to learn the CLI.

Example

# Inside Cloud Shell
echo $GOOGLE_CLOUD_PROJECT        # shop-dev-4821
gcloud config list
# [core]
# account = you@example.com
# project = shop-dev-4821

gcloud projects list --format="table(projectId,name)"
df -h $HOME | tail -1             # ~5G persistent home disk

Remember

  • Always check the project picker before changing anything
  • Cloud Shell comes authenticated with the common CLIs installed
  • Only $HOME persists in Cloud Shell

Watch out for

  • Installing tools system-wide in Cloud Shell and expecting them to survive the next session.

Check yourself

  1. You installed a tool with apt in Cloud Shell yesterday and it is gone today. Why?

Sign in to answer, see the explanations, and get this lesson back as a quick review later.

Official docs: cloud.google.com/shell/docs

Builds on

Nothing: this is a foundation.

Unlocks