How to Deploy a Web App Using Google App Engine

01
of 08

Activate Your Google Account for App Engine

The Google App Engine signup page
Image © Google

App Engine needs to be specifically activated and associated with your existing Google account. Go to https://developers.google.com/appengine/ to do this. Click on the sign up button on the bottom right. The signup may require additional confirmation steps for your Google account to join the Google developers program.

02
of 08

Create an Application Space Through the Admin Console

How to create a new application in Google App Engine
Image © Google

Once signed in to App Engine, navigate to the admin console on the left sidebar. Click on the 'Create Application' button at the bottom of the console. Give your application a unique name as this is the location that Google will assign your app within its appspot domain.

03
of 08

Choose Your Language and Download the Appropriate Developer Tools

Download the correct App Engine developer tools
Image © Google

These are located at https://developers.google.com/appengine/downloads. App Engine supports 3 languages: Java, Python, and Go. Make sure your development machine is set up for your language before installing App Engine. The remainder of this tutorial will use the Python version, but most of the filenames are roughly equivalent.

04
of 08

Create a New Application Locally Using the Dev Tools

Create a New Application Locally Using the App Engine Launcher
Image © Google

After opening the App Engine launcher you just downloaded, choose "File" > "New Application". Make sure you name the application the same name you assigned in step 2. This will ensure the application gets deployed to the appropriate place. The Google App Engine launcher will create a skeleton directory and file structure for your application and populate it with some simple default values.

05
of 08

Verify that the app.yaml File is Configured Correctly

Verify that the app.yaml file is configured correctly
Image © Google

The app.yaml file contains the global properties for your web app, including handler routing. Check the "Application:" attribute at the top of the file, and ensure that the value matches the application name you assigned in step 2. If it doesn't, you can change it in app.yaml.

06
of 08

Add Request Handler Logic to the main.py File

Modifying the main.py file in Google App Engine
Image © Google

The main.py (or equivalent main file for other languages) file contains all of the application logic. By default, the file will return "Hello world!" but if you want to add any specific return, look under the get(self) handler function. The self.response.out.write call handles responses to all inbound requests, and you can put html directly into that return value instead of "Hello world!" if you wish.

07
of 08

Check that Your App Deploys Locally

Verify that your App Engine application deploys locally -- note the URL: localhost
Screenshot taken by Robin Sandhu

In the Google App Engine launcher, highlight your application and then select "Control" > "Run", or click the run button in the main console. Once the status of the app turns green to show that it's running, click on the Browse button. A browser window should appear with the response from your web app. Make sure everything is running correctly.

08
of 08

Deploy Your Web App to the Cloud

Deploy your web app to the cloud
Image © Google

Once you're satisfied that everything is running correctly, click on the deploy button. You will have to provide the account details of your Google App Engine account. The logs will show the status of the deployment, you should see a success status followed by the launcher pinging your web app multiple times for verification. If everything was successful you should be able to go to the appspot URL you assigned earlier, and see your deployed web app in action. Congratulations, you've just deployed an application to the web!