Install Odoo/OpenERP 7.0 on Ubuntu 12.04 w/ Apache2 + mod_wsgi

Odoo (former OpenERP) is a collection of web based open source business apps. With Odoo you can create your own website, online shop, blog. It includes CRM, Project management tools, billing, accounting and more. You can get a free Odoo account at

In this guide we will setup  Odoo/OpenERP 7.0 on Ubuntu using Apache2 and mod_wsgi. This is a second article in Odoo Installation series. In previous guide we installed Odoo without Apache and mod_wsgi – using OpenERP server daemon.

  We can install Odoo/OpenERP on your VPS or dedicated server just for $30!
Order Odoo/OpenERP installation service or Order VPS with Odoo/OpenERP pre-installed.

Step 1: Setup your Ubuntu 12.04 server.

Update server packages.
apt-get update


Step 2: PostgreSQL Server Installation and Configuration.

Install PostgreSQL Server.
apt-get install postgresql

 Setup a PostgreSQL user for OpenERP.
sudo su postgres
createuser --createdb --username postgres --no-createrole --pwprompt openerp
Enter password for new role:
Enter it again:
Shall the newrole beasuperuser?(y/n)y

Option explanations:

–createdb : the new user will be able to create new databases
–username postgres : createuser will use the postgres user (superuser)
–no-createrole : the new user will not be able to create new users
–pwprompt : createuser will ask you the new user’s password
openerp : the new user’s name

Step 3: OpenERP Server Installation.

Installing the required packages.
sudo apt-get install python-lxml python-mako python-dateutil python-psycopg2 python-pychart python-pydot python-tz python-reportlab python-yaml python-vobject python python-dev build-essential python-setuptools python-pip python-babel python-mock python-docutils python-Jinja2 python3-jinja2 libldap2-dev libsasl2-dev apache2 libapache2-mod-wsgi python-werkzeug python-unittest2 python-openid

Download the latest openERP server source.
cd /home/
sudo wget
sudo tar xvzf openerp-7.0-latest.tar.gz

Rename the extracted folder.
mv openerp-7.0-XXXXXXXX-XXXXXX openerp

Step 4: Enable mod_wsgi modules.

sudo a2enmod wsgi

Step 5: Create a OpenERP configuration file.

For this type of deployment we will create a new configuration file. Create an file in openerp root folder with following content.

nano /home/openerp/


Step 6: Create Site Configuration file in Apache.

Create a new virtual host configuration file in apache with following content.
nano /etc/apache2/site-available/openerp-wsgi

<VirtualHost *:80>
ServerAlias * Use this if you want dbfillter on subdomain
WSGIDaemonProcess oe user=openerp group=openerp processes=2python-path=/home/openerp/display-name=apache-openerp
WSGIProcessGroup oe
CustomLog/var/log/openerp/openerp-access.log combined
Order allow,deny
Allow from all

Notes: WSGIScriptAlias / /home/openerp/ – path to file “ (See Step 5).
    user=openerp group=openerp – user for home directory OpenERP (See Step 5).
    python-path=/home/openerp/ and <Directory /home/openerp> – home directory OpenERP (See Step 3).

 Create folder for log files.
mkdir /var/log/openerp
chown openerp:root /var/log/openerp
/etc/init.d/apache2 restart

The URL your Odoo installation will look something like this:


 Enjoy using your self-hosted Odoo/OpenERP installation!