Use Cloud Shell

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

Start a new session

Click Activate Cloud Shell at the top of the Google Cloud console.

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

Use the terminal

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

In addition to accessing the Google Cloud CLI 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.

Use 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 Code Editor Button Open Editor on the toolbar of the Cloud Shell window.

For more information, see Cloud Shell Editor interface overview.

Choose ephemeral mode

By default, Cloud Shell provisions 5 GB of free persistent disk storage on your temporarily allocated virtual machine. This is your $HOME directory. When you use the default Cloud Shell experience, the files in your home directory persist between sessions.

If you do not need persistent storage, use Cloud Shell in ephemeral mode. In ephemeral mode, you can get started with Cloud Shell faster because there is less set up and there is no disk attachment or archive. However, this means that all the files you create during your ephemeral mode session are deleted with the VM when the session ends.

To choose ephemeral mode, append ephemeral=true to the URL, or open the Cloud Shell More menu icon More menu, select Ephemeral mode, and click Save.

To set ephemeral mode as your Cloud Shell default, enable Always start Cloud Shell in ephemeral mode before you click Save.

Adjust the display window

To adjust the display window:

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

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

  3. To close the detached window and re-open the session in the console, click Activate Cloud Shell at the top of the 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.