Using Web Preview

This page describes how to use the web preview feature in Cloud Shell. This feature allows you to run web applications on the Cloud Shell virtual machine instance and preview them from the Google Cloud Console.

The Web Preview button Web Preview Button can be found on the top right of the Cloud Shell taskbar.

Starting the web application

You can run any web application that listens to HTTP requests on the Cloud Shell virtual machine, including the App Engine development server. The web application must listen for HTTP requests on ports within the permitted range 2000 to 65000. These ports are only available to the secure Cloud Shell proxy service, which restricts access over HTTPS to your user account only.

SimpleHTTPServer example

To start a simple Python HTTP server from the Cloud Shell command prompt:

cd `mktemp -d` \
    && echo '<html><body>Hello World</body></html>' >./index.html \
    && python -m SimpleHTTPServer 8080

App Engine development server example

To clone a sample App Engine application and run it on the App Engine development server:

git clone \
    && cd appengine-guestbook-python \
    && ./app.yaml

The development server runs on port 8080 by default.

Previewing the application

Click the Web Preview button 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.