OpenShift is an Open Hybrid Cloud Application Platform / PaaS by Red Hat.It has a free plan as well as enterprise pricing options.

Here is a good post comparing Heroku and OpenShift

Deployment Steps

Install RHC

The first step is to create an account on OpenShift - it's free and easy.

The next step is to intstall RHC.RHC is the OpenShift client tool. The simplest way to install it is to do

sudo gem install rhc

If the above command doesn't work install Ruby first and then Ruby Gems

Deploy the template Web2py app

. Now we create a blank web2py app and get it running on OpenShift. For this we use the following repo.

You can follow the instructions given in the readme except change the Python version to 2.7 instead of 2.6

The basic steps are-

Create a python-2.7 application

    rhc app create -a YOUR_APP_NAME -t python-2.7

Add this upstream repo

    git remote add upstream -m master git://
    git pull -s recursive -X theirs upstream master

Note: If you want a specific release and not the latest snapshot, 
replace "master" with the branch name in the above lines (ie. 2.3.2).

Then push the repo upstream

    git push

That's it, you can now checkout your application at:

    # you'll be prompted for your namespace while creating your account, you needn't worry about it.

Once your app is up you'll need administrative access to continue.For the admin app to work you need to put your password hash in in wsgi/web2py/.

If you are using Ubuntu, you can find in your laptop, in "/home/YOUR_APP_NAME/wsgi/web2py/" a file called Parameters_*.py. there is a possibility that you can find more than one, with different numbers at the end. remove all of this file. then:

$ -p 8080 -a YOUR_PASSWORD


$web2py -p 8080 -a YOUR_PASSWORD

it will create a file called '' in directory /home/YOUR_APP_NAME/wsgi/web2py/ then do these:

$ln -s
$ln -s
$ln -s
$git add .
$git commit
$git push

Your parameters_*.py files will be sent to openshift. And then you can open https://YOUR_APP_NAME-$ via your web browser, and use your password you just created. if it is not working, try to enable your browser to accept cookies.

Package and deploy Eden

Now locally create package your local Eden setup via the administrative interface. Then create a new application on your OpenShift by uploading the package.

To be able to do this, first you need to install Sahana Eden in your laptop. If you are using Ubuntu, the easiest possibility is to install the windows version using virtual machine such as Oracle Virtual Box.

There is a file called '' somewhere in your windows system. Find this using the windows explorer search facility. Probably it is located in C:\Users\Public\SahanaEden. Then double click to run this file. Wait until it shows a small window, choose server IP= Local (, enter a Password and press the 'Start Server' button. Your Web browser will directly trying to connect to that ip address. Stop it, and Go to:

Your browser will show the web2py admin page. enter your password and press Login. Now, on the left side, you will see many button, one of them, under Eden dir is called "Pack all". Press this button, and wait until its done (will take some time). The result is a file called "", this is the package that needs to be uploaded into Openshift.

Use your browser, and go to: https://YOUR_APP_NAME-$, enter the administrative interface, enter your password, and press Login. Now, you are at the Openshift Web2py admin page. On the right side, you can see: "Upload and install packed application" section, fill in the Application name, and choose your "" file, and then press Install. It will take some time to finish the uploading process, if it is interrupted, just repeat the process.

When it is installed, you will see your Application name on the left side. Phew.

If using '' is only producing frustrating error message, use the 'Or Get from URL' option, and copy this

and then press Install.

The next step is to install postgresql. From Ubuntu, use the terminal, and type:

$rhc cartridge add postgresql-8.4 -a YOUR_APP_NAME

Once Eden is installed you will need OpenShift to install a lot of the required packages and libraries for it to work.For that edit the file in the following way-

Edit the install_requires line to


Note that these are only some of the libraries - please add them as needed. You can find the file in your own laptop. if you use Ubuntu, you can find it in /home/YOUR_APP_NAME.

$gedit  # find a line 'install_requires', and make the above changes. CTRL-S and close gedit window.
$git add .
$git commit   # make sure you see file '' is included in the list.
$git push

Now, Access your openshift web2py admin page through https://YOUR_APP_NAME-$ Enter your password, find a folder named 'models' and find a file named ' Edit and save the file. In order to edit this file, you will need basic information of your postgresql. In your terminal, type:

$rhc ssh
$env | grep OPENSHIFT

you will see lots of lines, containing your postgresql info. Use this to edit the

If you are lucky, you can access Sahan Eden from Openshifht now. If not, pray for help might help you.

Probably you will receive an error message saying something about "No such file or directory: 'applications/sahana/models/'". Before you start praying, try to access your application at openshift server, using

$rhc ssh

then go to your sahana eden directory, and find a directory named 'models'. Inside 'models' directory, type


then write:


followed by CTRL-O, ENTER, and CTRL-X So, you have created the file yourself. at least, this way works for me.

You can find your openshift Sahana eden web address from Web2py administrative page, folder 'your application name' (the one that you uploaded), move your mouse cursor above it, and you can see the web address. If it still doesn't work, you can start praying now.


To deploy updates simply package Eden locally and re-deploy it on OpenShift via the admin interface ( check the overwrite installed app option)


  1. Have the admin interface directly fetch Eden from a Git repo.
Last modified 6 years ago Last modified on 02/28/18 11:33:48
Note: See TracWiki for help on using the wiki.