Using Cloud Shell

This page describes how to start and set up a new Google 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

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.

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. You can open multiple shell connections to the same instance. Just run gcloud --help to view the gcloud command-line tool commands available to you.

In addition to accessing the Cloud SDK gcloud command-line tool and other utilities from the command line, you can use the cloudshell command to launch tutorials, open the code editor, and download files. Run cloudshell help for more information.

Scrolling the display

In addition to using your mouse while browser focus is on a session tab, you can also scroll using Ctrl-Shift-PageUp / Ctrl-Shift-PageDn (Windows and Linux) or Fn-Shift-Up / Fn-Shift-Down (on Mac OS X).

Copying and pasting text

To copy and paste text:

  • Select some text in the session display or another window using your mouse.

  • Press Ctrl + C (on Windows or Linux) or Cmd + C (on macOS) to copy the text.

  • Press Ctrl + V (on Windows or Linux) or Cmd + V (on macOS) to paste at your current cursor location.

Sending a key combination using the console

Click the Send Key Combination button Send Key Combination Button and select Ctrl + V to paste the contents of your clipboard at your current cursor location.

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. Click the Activate Cloud Shell Activate Shell Button button at the top of the Console window to close the detached window and re-open the session in the Console.

  4. Click the Settings button Settings Button and then Switch to Light Theme or Switch to Dark Theme to toggle between themes.

Opening multiple terminal sessions

Click the Add Cloud Shell Session Add Session Button button at the top of the Cloud Shell window to open additional sessions. Each session connects to the same virtual machine instance. When you open a new session, it appears in a new tab at the bottom of the Console.

Using the code editor

The built-in code editor provides the convenience of viewing and editing files in the same environment where projects are built and deployed.

Refer to the guide on using the code editor for more details.

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.