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
tool and other utilities you need are always available when you need them.
Cloud Shell provides the following:
- A temporary Compute Engine virtual machine instance
- Command-line access to the instance from a web browser
- 5 GB of persistent disk storage
- Pre-installed Google Cloud SDK and other tools
- Language support for Java, Go, Python, Node.js, PHP and Ruby
- Web preview functionality
- Built-in authorization for access to Cloud Platform Console projects and resources
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.
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.
Cloud Shell has a built-in code editor based on Orion. You can use the code editor to browse file directories, view, and edit files. The code editor is available by default with every Cloud Shell instance.
You can access the code editor from the toolbar by clicking the file icon.
Persistent disk storage
Cloud Shell provisions 5 GB of free
persistent disk storage mounted as
$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
.vimrc, persist between sessions. Your
directory is private to you and cannot be accessed by other users.
The Cloud Shell virtual machine instance has the following pre-installed tools:
|Linux shell interpreters||
|Linux utilities||Standard Debian system utilities|
|Google SDKs and tools||
Google App Engine SDK
Google Cloud SDK including the
|Build and package tools||
|Source control tools||
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
The Cloud Shell virtual machine instance provides pre-installed language support for the following:
|Java||JRE/JDK 1.7 and 1.8|
|Node.js||v0.12.2, v4.7.0 and v6.9.2 (use
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
To change back to 1.7.0:
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
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
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 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.
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
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.
tmux in Cloud Shell, click the 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 .
Note: This is separate from gcloud usage statistics, which is enabled by default in the Cloud Shell.
Cloud Shell will immediately close after connection if there is a problem in
.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.