Cloud Shell comes with Cloud SDK pre-installed. This means you can run
commands without additional setup. You can run gcloud command-line tool
gcloud help straight away after
activating a Cloud Shell session.
Additionally, any time you manage resources using the interactive interface from
the Console, you can generate the equivalent
gcloud command and run it in
Cloud Shell. If you fill in the details of your required resource
during tasks like the creation of an instance group or a Kubernetes cluster,
the generated command will contain the correct flags and their values.
Before you begin
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
In the Google Cloud Console, on the project selector page, select or create a Google Cloud project.
Make sure that billing is enabled for your Cloud project. Learn how to confirm that billing is enabled for your project.
Example: Creating a Compute Engine instance with a generated gcloud command
- Go to the Compute Engine > VM instances page.
- Click Create.
- Fill in the required and optional fields to configure the new instance to suit your needs.
- Below the Create button, you'll find the option to generate the equivalent REST or gcloud command. Click command line to see the suggested gcloud command.
- Click Run in Cloud Shell.
- Press Enter to execute the command once you see it at the prompt.
- Going back to the VM instances page, you'll see the newly created and running VM instance.
- Delete the instance either from the command line or the VM instances page, if you no longer need it, to avoid incurring unnecessary charges.