Use Cloud Shell with the gcloud CLI | Google Cloud Documentation
Skip to main content Console English Deutsch Español Español – América Latina Français Indonesia Italiano Português Português – Brasil עברית 中文 – 简体 中文 – 繁體 日本語 한국어 Sign in Cloud Shell Start free Home Documentation Application development Cloud Shell Stay organized with collections Save and categorize content based on your preferences. Use Cloud Shell with the gcloud CLI If you have the gcloud CLI installed , you can interact with Cloud Shell from your terminal and use it as a sandbox and a portable development environment.
This provides the convenience of working with Cloud Shell resources, whether to quickly test an operation or use an IDE of your choice to edit a file saved on your Cloud Shell instance from your local desktop. Use gcloud cloud-shell The current gcloud cloud-shell command group offering provides the following functionality: Establishing an interactive SSH session with Cloud Shell using gcloud cloud-shell ssh . Copy files between your local and Cloud Shell machine via scp .
Mount your Cloud Shell directory to your local file system via sshfs . For more detail, see the reference documentation for gcloud cloud-shell . Example workflow To illustrate the workings of gcloud cloud-shell , here is an example of how you can use these commands in practice: Start a SSH session: gcloud cloud-shell ssh Copy a file, data.txt , from Cloud Shell to your local machine: gcloud cloud-shell scp cloudshell:~/data.txt localhost:~data.txt If you're using Mac or Linux, you can mount your Cloud Shell home directory onto your local file system after installing sshfs .
This allows you to edit the files in your Cloud Shell home directory using your choice of local tools. All the data in your remotely mounted file system is stored on a Persistent Disk and stored across sessions. gcloud cloud-shell get-mount-command ~/my-cloud-shell Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License .
For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates. Last updated 2026-11-10 UTC.