Preview and deploy an App Engine application

This page outlines how to quickly deploy an App Engine app from a sample application, using Cloud Shell.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud Console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Cloud project. Learn how to confirm that billing is enabled for your project.

  4. In the Google Cloud Console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  5. Make sure that billing is enabled for your Cloud project. Learn how to confirm that billing is enabled for your project.

Deploying an application

  1. At the top of the Google Cloud Console window, click the Activate Shell Button Activate Cloud Shell:

    This launches Cloud Shell session in a frame at the bottom of the Cloud Console.

  2. 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

  3. Connect to the development server:

    Click Web Preview Button Web Preview and choose Preview on port 8080.

    Cloud Shell opens the preview URL on its proxy service in a new browser window.

  4. Open the code editor by clicking Code Editor Button from the Cloud Shell menu to edit your cloned app.

  5. Change the text in index.html:

    In the code editor, double-click the file to open it for edit and change the text in index.html from An anonymous person wrote: to A mysterious stranger said:

    You'll see your change detected in Cloud Shell's output. To see the new changes reflected in real time, refresh your previewed app.

  6. Stop the development server:

    After you've previewed the App Engine app, to stop the development server, press Ctrl+C in your Cloud Shell session.

  7. Initialize your App Engine app:

    Create an App Engine app tied to your project, if you haven't already, and choose its region:

    gcloud app create --project=[YOUR_PROJECT_NAME]
    
  8. Deploy the app to App Engine:

    gcloud app deploy ./index.yaml ./app.yaml
    
  9. Open your application in your web browser. The URL is https://<PROJECT_ID>.<REGION-ID>.r.appspot.com/.

    It could 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.

  10. To avoid unnecessary billing, disable your app:

    To disable the app you just deployed, go to App Engine in Cloud Console and select Settings > Application Settings > Disable Application.