This blog post describes how to run Google App Engine (GAE for short) on Ubuntu.
This is a 2-part blog post.
- Setting up Google App Engine SDK (this article)
- Running Google App Engine
An aside related article, How to Add Google App Engine project to Google Developers Console.
Part 1 Summary
- Python Version
- Installing Google App Engine
Google App Engine is a PaaS (Platform as a Service) provided by Google.
Currently, GAE supports 4 programming languages.
I will be using Python as programming language of choice for this blog post.
In following this blog post, I assume:
- you have a working Google account
- you know how to start a terminal session and enter commands into it.
- you know how to use a browser to download files
- you know how to extract files from archives
Note: It may be obvious, but any time you see my name “zhixian” in any of screen shots or commands, you can safely assume that its should be referring to your username in your context.
3. Python Version
By default, Python is installed on Ubuntu.
The version of Python that I am using for this blog post is 2.7.6.
To check which version of Python you are running, typed the following command in a terminal session:
4. Installing Google App Engine
- Getting Google App Engine SDK (Software Development Kit)
- Extracting files from Google App Engine SDK
- (Optional) Move extracted files out of Downloads folder
- (Optional) Add location of extracted files to PATH environment variable
4.1 Getting Google App Engine SDK (Software Development Kit)
You can download the Google App Engine SDK at https://cloud.google.com/appengine/downloads
- Enter the url https://cloud.google.com/appengine/downloads in your browser navigation bar.
- On the download page, click on the button “Google App Engine SDK for Python” to display the available download options
- Pick the link “google_appengine_1.9.15.zip” under package column for “Linux/Other Platforms” row to download the zip file.
4.2 Extracting files from Google App Engine SDK
After you have download the zip file, you should see the zip file in your download folder.
Right-click on the zip file to display it’s context menu.
From the context menu, select “Extract Here”.
After you extracted the files, you should see:
I will refer to the location of google_appengine folder as GAE home directory for the rest of this blog post.
4.3 (Optional) Move extracted files out of Downloads folder
This step is optional and is entirely opinionated. It may not be appropriate for enterprise deployment.
The files that we extracted are in the default “Download” folder.
This folder may get cluttered over time.
My preference is to create a “Apps” directory and move the extracted files into this folder.
So, my final setup is something like the below:
4.4 (Optional) Add location of extracted files to PATH environment variable
This step is intended to provide convenience. It is not essential.
The location of the extracted files is dependent on whether you performed the previous step.
If you performed the previous step and moved the folder to an Apps folder, the location should be:
If you did not do the step, the location should be:
As such, type the following:
Before you enter the following command, to examine the contents of your current PATH environment variable:
After you enter the export PATH command, you should see a result like the below:
Note: Performing this command only affects the PATH environment variable for this session.
This means that every time you start a new terminal session, you have to do the same thing.
You may want to consider putting this in your .bashrc file.
I’m kind of lazy to explain what is the .bashrc file. So I’m just going to paste the screenshots of the steps for editing the .bashrc file with annotations:
At the command-line type the following command to edit the file:
Note: pico is an alias for nano, a text-editor.
After you have opened the file for editing, scroll to the end of the file using the down arrow or page down key:
At the end of the file, enter the export PATH command.
Then press the <CTRL>-X key combination on your keyboard to exit the editor.
Because we did not save changes when we exit the editor, there will be a prompt asking if you want to save changes.
Press the Y key on your keyboard to save changes.
After you enter Y, there will be another prompt for the file to save the changes.
Press the Enter key on your keyboard to accept the default (the name of the file you are editing).
After you hit the Enter key, you should be back at the command-line.
To test the changes are effective, start another terminal session.
At the command-line, enter dev_a followed by the Tab key on your keyboard:
The terminal session should automatically auto-complete your input into dev_appserver.py.
I will continue on how you get your first application running on Google App Engine in my next blog-post.