Using Cloud Shell

This page describes how to start and set up a new Cloud Shell session.

Starting a new session

Click the Activate Cloud Shell button at the top of the Google Cloud Console.

Starting a Cloud Shell session and running gcloud help

A Cloud Shell session opens inside a new frame at the bottom of the Cloud Console and displays a command-line prompt. It can take a few seconds for the session to be initialized.

Using the terminal

Cloud Shell provides command-line access to the virtual machine instance in a terminal window that opens in the Google Cloud Console.

In addition to accessing the gcloud command-line tool and other utilities from the command line, you can use the cloudshell command to launch tutorials, open the Cloud Shell Editor, and download files.

Refer to the guide on using the Cloud Shell Terminal for more details.

Using the Cloud Shell Editor

The built-in code editor provides the convenience of viewing and editing files in the same environment where projects are built and deployed. Launch the Cloud Shell Editor by clicking the pencil icon Code Editor Button on the toolbar of the Cloud Shell window.

Refer to the guide on using the Cloud Shell Editor for more details.

Choosing Ephemeral mode

Cloud Shell, by default, provisions 5 GB of free persistent disk storage mounted on your temporarily allocated virtual machine instance as your $HOME directory. All the files you store in your home directory persists between sessions when you use the default Cloud Shell experience.

If you do not need persistent storage, you can choose to use Cloud Shell in Ephemeral mode. In Ephemeral mode, you can get started with Cloud Shell faster as there is less to set up behind the scenes since there is no disk archival or attachment. This however means that all the files you create during your Ephemeral mode session are lost at session end.

To choose Ephemeral mode, select Ephemeral mode from the Cloud Shell three-dotted More menu More menu icon. You also have the choice of setting Ephemeral mode as your default Cloud Shell experience by toggling on the Always start Cloud Shell in Ephemeral mode option.

Adjusting the display window

To adjust the display window:

  1. Click the Hide Hide Shell Button and Restore Restore Shell Button buttons to hide and restore the session display.

  2. Click the Open Session in New Window Detach Shell Button button to detach the session as a new window.

  3. To close the detached window and re-open the session in the Cloud Console, click Activate Shell Button Activate Cloud Shell at the top of the Cloud Console window.

  4. To toggle between themes, click Settings Button Settings and then click Switch to Light Theme or Switch to Dark Theme.

What's next

Now that you're familiar with configuring Cloud Shell, you can start to use the pre-installed tools and commands from the command line. You can also install additional tools in your home directory in persistent disk storage as needed.