This page shows you how to perform basic operations in Google Cloud Shell.
Before you begin
In the Cloud Platform Console, go to the Manage resources page and create a new project.
Start Cloud Shell
Click the Activate Google Cloud Shell button at the top of the console window.
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 shell session to be initialized.
Your Cloud Shell session is ready to use.
Use the command line
You can now use the pre-installed
gcloud command-line tool.
When you start Cloud Shell, the active project in Console is propagated to
gcloud configuration inside Cloud Shell. If you'd like to switch between
configurations, find out more here.
gcloud version command to try the
gcloud command-line tool from
within the Cloud Shell session:
This will display a list of installed Cloud SDK components and their versions:
Use your home directory
Try out your home directory:
Change your current working directory:
.bashrcconfiguration file using
The editor opens and displays the contents of the file.
ESCkey and then
q!to exit the editor.
The contents of your Cloud Shell home directory persist across projects between all Cloud Shell sessions, even after the virtual machine terminates and is restarted.
Preview and deploy an App Engine application
Use web preview to preview an App Engine app before you deploy it:
- Clone a sample app and run it locally in the Cloud Shell session using the App Engine development server.
git clone https://github.com/GoogleCloudPlatform/appengine-guestbook-python \ && cd appengine-guestbook-python \ && dev_appserver.py ./app.yaml
Click the Web Preview button and then select the port number from the displayed menu.
Cloud Shell opens the preview URL on its proxy service in a new browser window.
When you are done previewing the App Engine app, type Ctrl + C to stop the development server.
Deploy the app to App Engine:
gcloud app deploy ./index.yaml ./app.yaml
Open the application in your web browser. The URL is
It may take a few minutes for deployment to complete. If the application is not fully deployed, you will see an error message in the web browser. Refresh the browser to see the deployed application.
To avoid incurring charges to your Google Cloud Platform account for the resources used in this quickstart:
Go to the Projects page in the console:
Click the trash can icon next to the project you created for this Quickstart.
This shuts down the project and schedules it for deletion.