Deploy an App Engine app by using Cloud Shell
This page outlines how to quickly deploy an App Engine app from a sample application using Cloud Shell.
Before you begin
- 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.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
Deploy an application
At the top of the Google Cloud console window, click
Activate Cloud Shell:
This launches Cloud Shell session in a frame at the bottom of the Google Cloud console.
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
To connect to the development server, click
Web Preview and then choose Preview on port 8080.
Cloud Shell opens the preview URL on its proxy service in a new browser window.
To open the code editor, click
from the Cloud Shell menu to edit your cloned app.
Change the text in
index.html
:In the code editor, double-click
index.html
to open the file for edit and then change the text inindex.html
from An anonymous person wrote: to A mysterious stranger said:You'll see your change in Cloud Shell's output. To see the changes, refresh your previewed app.
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.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]
Deploy the app to App Engine:
gcloud app deploy ./index.yaml ./app.yaml
Open your application in your web browser. The URL is
https://<PROJECT_ID>.<REGION-ID>.r.appspot.com/
.Deployment could take a few minutes to complete. If the application is not fully deployed, an error message is displayed in the web browser. Refresh the browser to see the deployed application.
To avoid unnecessary billing, disable your app:
To disable the app you just deployed, go to App Engine in Google Cloud console and select Settings > Application Settings > Disable Application.