google app engine

Install and run google app engine on linux

15 Oct , 2009  

For those innocent people who do not know Google App engine, it is a platform which lets you host your application on Google’s infrastructure. In short your code just touches the hardware which no one else, but Google’s engineers have seen. So it allows you to scale your application as you grow big.

Google app engine is pretty straight to use on almost every platform as its supports Linux, Mac OS, Windows. However some folks face issues getting it running on Linux or particularly on Ubuntu as this is the favorite distro of Linux users. Follow the steps below to install and run Google app engine on Linux.

Before we get started make sure Python is installed on your Linux box, if not yet please download and install Python from

Download and Install Google App Engine

You can download Google App Engine from download Python or Java version, depending on the language you are comfortable coding with. In this example we are going to download the Zip package for Python and going to save it on Ubuntu’s desktop.

download google app engine Install and run google app engine on linux

Now to extract the zipped file either use the context menu to extract files into a folder or you can use terminal to unzip the files using the command – unzip

After you finish unzipping, you will get a folder google_appengine which has all the necessary files to develop application. To complete the installation and to able to run Google App Engine, we must specify its path definition. You can specify the PATH definition in the terminal only using – export PATH=$PATH:/home/your_user_name/Desktop/google_appengine/

But path specified using export command is valid as long as you are inside the current terminal window. That means as soon as you close the window, the path specified becomes invalid. To specify the path in the system, you have to edit the /home/your_user_name/.profile and specify the path there.

Making Your First Application on Google App Engine

All set & done, now you have the shiny Google App Engine up & running its time to do the real job. Let us make an ‘Hello World’ application for Google App Engine, using you own Linux Box – excited ? To start using app engine, you have to register an application at

That requires your usual Google Account’s credentials and the environment is ready to be used instantly. Create a folder in which you will keep all your apps file. I am creating a folder named t-wave and have the application registered with the same name. Now create a file called app.yaml inside the t-wave folder and its content would be :google app engine Install and run google app engine on linux

application: t-wave
version: 1
runtime: python
api_version: 1

- url: /.*

Change the application to the one you registered at as mentioned above.

Now our next step is to create a file that will print ‘Hello World’ when we will start the server and request the file from browser. So Create a file and paste the following line.

print ‘Content-Type: text/plain’
print ”
print ‘Hello World!’

Save the file and now let’s test our application locally and then we will upload it to the Google’s servers. To start the server on localhost, open terminal window and type command: /home/your_user_name/Desktop/t-wave

This will start server and you can view your application at http://localhost:8080

If you see ‘Hello World’ then you are good to go and upload your application online. To upload application online which you have already registered as mentioned above, use the following command in the terminal window. update /home/your_user_name/Desktop/t-wave

The wizard is going to ask you for your Google Account credentials. After authenticating you can see your application up & running on the URL you chose while registering your application with

Hope you enjoyed this post.

Stay Digified !!
Sachin Khosla

, ,

8 Responses to “Install and run google app engine on linux”

  1. Sergey says:

    A little update for code, you must write it like that:

    print ‘Content-Type: text/plain’
    print ”
    print ‘Hello World!’

    Because after deploying you will not see anything at, if you write only “print ‘Hello World!’”

  2. Ohh yes, and how can i miss that.
    Thanks dude, have updated it now.

  3. Donnie says:

    I believe there should be a tab at the beginning of the “script:” line of the app.yaml file

  4. JJ says:

    Thanks … Great article.
    One thing I would like to point out is that you need python 2.5 to run Google Apps and only 2.5. I found this out the hard way after struggling for a few hours.

  5. Sagar says:

    Nice job man.Thanks !!

  6. Carlos Vasconcelos says:

    Do you have any solution for newer linux versions?

  7. Sachin Khosla says:

    Which version ?

  8. Prashant says:


    Python 2.6.5: /usr/bin/python
    Mon Aug 22 06:05:44 2011
    A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

    /home/user/google_appengine/google/appengine/tools/ in _HandleRequest(self=)
    4103 “API versions cannot be switched dynamically: %r != %r”,
    4104 config.api_version, API_VERSION)
    4105 sys.exit(1)
    4107 (exclude, service_match) = ReservedPathFilter(
    global sys = , sys.exit =
    : 1
    args = (1,)
    code = 1
    message =