3 March 2012

How to Host a Website on Google Application Engine for Free



I think Google App Engine is one the best services that Google offers till now.  You may don’t know that you can also host your own personal or business website on GAE. What the Google gives you after hosting your website is 1 GB free storage space and 1 GB bandwidth for every day. You can even host websites based on flash templates or any other kind (I have tested myself and they work perfectly). I just hosted a simple sample page on GAE for this tutorial that you can check it from the link below: 


In this post I will introduce you how to create a website using Google step by step. Follow these steps:

Step 1
As you know before we can create any application on GAE, we need to download and install tow small applications Google App Engine SDK and Python. Their installation is very easy just like any other ordinary software. Download and install these two applications from the links below:


Google App Engine v1.6.2 (21.4MB)



or download from the official website:



Python v2.7.2 (14.8MB)



or download from the official website:


Step 2
Go to Google App Engine and sign in to your account (you must have a Gmail account). If it is your first time that you create an application on Google, it will verify your account by sending an SMS to your mobile phone. Follow the instruction and go to your account.



Step 3
In Create an Application window, under Application Identifier, choose a name (sub domain) for your application. You should know what ever name you create here; it will be your website URL address. For example:

Htt://your-website-name.appspot.com

Click on Check Availability button to see if the name that you have chosen is available. After selecting a proper name, give a Title for it and hit the Create Application button. I made a new application for this tutorial on Google with name website-example.



Note: If you want, you can also use your own customized domain name for your website.

Step 4
Open Google App Engine (the app that you installed on your system) and from the Menu>File select Create New Application.


I have already made an application with the necessary files to host my website that you can download from the link below:


My Website Zip File (10.8MB)



The only thing you need to do is to open and app.yaml file with Notepad and change the application id to your own application id (the name or sub domain name you made on Google), then instead of Create New Application, select Add Existing Application.


Step 5
In the Add New Application window, write your application name and choose a parent directory for creating it on your system and hit the Create button. The directory can be anywhere on your hard disk. As you can see in the image below I set the parent directory on my desktop.


Step 6
Open My Computer and go to your application directory. Copy all your website files like html documents, images, icons, etc. in the same directory. Find the app.yaml file and open it with Windows Notepad. Now replace its content with the code below and save the window.


The line – url: /(.*\(gif|png|jpg|ico|js|css|xml|swf)) will upload all your website files with extensions .gif, .png, .jpg, .ico, .js, .css, .xml and .swf on Google App Engine. And the next line will upload your website html file. 


You can add a new code line (default_expiration) to the code above to determine how long your website files will remain in the user’s browser cache. As you can see in the code below I set it for 7 days.


Step 7
Open main.py file with Windows Notepad and replace its contents with the code below and save and exit.


If you use my application file, I have made all necessary changes. The only thing you need to do is to change the app id to your own id in app.yaml file.

Step 8
Go to your Gmail account settings and in front of the Authorising applications & sites, select Edit



Verify your password and in the next window, under the Enter a name to help you remember what application this is for, type the name of your Google application (sub domain) and click on Generate password. Google will generate a password for your application. 


Step 9
Go back to the GAE Launcher window, select you app and click on Deploy button. 


It will ask for your email address (Gmail) and your application specific password. Enter your email address and your new generated application password and OK the window. 


Step 10
Wait for few minutes till your application deployed. 


Open your Internet web browser and in the address bar type

Http://your-website-name.appspot.com

For example


Then press the Enter key, now you can see your website on the Internet.