Features

Google Cloud Shell is an interactive shell environment for Google Cloud Platform. It makes it easy for you to manage your projects and resources without having to install the Google Cloud SDK and other tools on your system. With Cloud Shell, the Cloud SDK gcloud command-line tool and other utilities you need are always available when you need them.

Cloud Shell session

Cloud Shell provides the following:

Virtual machine instance

When you start Cloud Shell, it provisions an f1-micro Google Compute Engine virtual machine running a Debian-based Linux operating system. Cloud Shell instances are provisioned on a per-user, per-session basis. The instance persists while your Cloud Shell session is active and terminates after an hour of inactivity.

Command-line access

Cloud Shell provides command-line access to the virtual machine instance in a terminal window that opens in the Google Cloud Platform Console. You can open multiple shell connections to the same instance. The instance persists between sessions.

Code editor

The beta version of Cloud Shell code editor is now available for use. The built-in code editor is based on Orion. You can use the code editor to browse file directories as well as view and edit files, with continued access to the Cloud Shell. The code editor is available by default with every Cloud Shell instance.

You can access the code editor from the toolbar by clicking the pencil icon.

Cloud Shell and Editor session

Persistent disk storage

Cloud Shell provisions 5 GB of free persistent disk storage mounted as your $HOME directory on the virtual machine instance. This storage is on a per-user basis and is available across projects. Unlike the instance itself, this storage does not time out on inactivity. All files you store in your home directory, including installed software, scripts and user configuration files like .bashrc and .vimrc, persist between sessions. Your $HOME directory is private to you and cannot be accessed by other users.

Available tools

The Cloud Shell virtual machine instance has the following pre-installed tools:

Type Tool
Linux shell interpreters bash
sh
Linux utilities Standard Debian system utilities
Google SDKs and tools Google App Engine SDK
Google Cloud SDK including the gcloud command-line tool
gsutil for Cloud Storage
Text editors Emacs
Vim
Nano
Build and package tools Gradle
Make
Maven
npm
nvm
pip
Source control tools Git
Mercurial
Additional tools Docker
iPython
MySQL client
gRPC compiler

You can install additional software packages on the virtual machine instance but the installation will not persist after the instance terminates unless you install the software in your $HOME directory.

Language support

The Cloud Shell virtual machine instance provides pre-installed language support for the following:

Language Version
Java JRE/JDK 1.7 and 1.8
Go 1.8
Python 2.7
Node.js v0.12.2, v4.7.0 and v6.9.2 (use nvm to switch versions)
Ruby 2.2.3
PHP 5.6.14
.NET 1.0.0-preview2

The default version of the Java environment is 1.7. To change the current Cloud Shell session to use version 1.8 of the JRE and JDK, enter the following at the Cloud Shell command prompt:

sudo update-java-alternatives -s java-1.8.0-openjdk-amd64 && export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre

To change back to 1.7.0:

sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 && export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre

You can ignore any error messages about not being able to change the versions of some binaries. The version change will persist until the Cloud Shell virtual machine instance is terminated. If you want to permanently switch to Java 1.7, add the first command above to your .bashrc file.

Web preview

Cloud Shell provides web preview functionality that allows you to run web applications on the virtual machine instance and preview them from the Cloud Platform Console. The web applications must listen for HTTP requests on ports within the permitted range 8080 to 8084. These ports are only available to the secure Cloud Shell proxy service, which restricts access over HTTPS to your user account only.

To connect to a web application running on an instance, click the Web Preview button Web Preview Button above the Cloud Shell terminal window in the Cloud Platform Console. Then, select the port number from the displayed menu. This opens a preview URL on the Cloud Shell proxy service in a new browser window.

Authorization

Cloud Shell provides built-in authorization for access to projects and resources hosted on Google Cloud Platform. You don't need to perform additional authorization steps to access platform resource using the Cloud SDK gcloud command-line tool.

tmux support

Cloud Shell uses tmux by default, which allows it to improve persistence across browser tab sessions. For example, if you refresh the Cloud Platform Console in a tab or connect to your Cloud Shell from a different machine, the session state will not be lost.

Cloud Shell supports the default tmux key bindings. For example, if you press Ctrl+b and then %, tmux splits the current session window into left and right panes, which can be useful for debugging.

To disable tmux in Cloud Shell, click the Settings button Settings Button, select Tmux Settings and de-select the Enable Tmux Integration option.

Terminal usage statistics

Cloud Shell collects anonymized usage statistics on commands that are run inside the Cloud Shell terminal. We only collect usage statistics on commands that come pre-installed in the Cloud Shell. We do not collect any metrics on personally identifiable information, such as arguments passed to these commands. These metrics cannot be tied back to your account. To disable collection, select Terminal Usage Statistics in the Settings menu Settings Button.

Note: This is separate from gcloud usage statistics, which is enabled by default in the Cloud Shell.

Safe Mode

Cloud Shell will immediately close after connection if there is a problem in your .bashrc or .tmux.conf files. To resolve this, open Cloud Shell in safe mode by appending cloudshellsafemode=true to the URL. This will restart your Cloud Shell and log you in as root, allowing you to fix any issues in the files.

What's next

Send feedback about...

Cloud Shell