How to Install Odoo/OpenERP 7.0 on Ubuntu 12.04

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
 # apt-get upgrade

 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: XXXXXXXXXX
 Enter it again: XXXXXXXXXX
 Shall the new role be a superuser? (y/n) y

 # exit

 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

Download  the latest OpenERP 7 code.

 # cd /home/
 # sudo wget http://nightly.openerp.com/7.0/nightly/src/openerp-7.0-latest.tar.gz
 # sudo tar xvzf openerp-7.0-latest.tar.gz

Rename the extracted folder.

 # mv openerp-7.0-XXXXXXXX-XXXXXX openerp

Setup openerp

 # cd /home/openerp/
 # sudo python setup.py install

 

Step 4: Creating a configuration file for OpenERP Server. 

Copy openerp-server.conf file to /etc folder, change folder ownership and permissions.

 # useradd -d /home/openerp -s /bin/bash openerp
 # cp /home/openerp/install/openerp-server.conf /etc
 # chown openerp: -R /home/openerp
 # chown openerp: /etc/openerp-server.conf
 # chmod 640 /etc/openerp-server.conf

Edit openerp-server.conf

 # nano /etc/openerp-server.conf
[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = 127.0.0.1
db_port = 5432
db_user = openerp
db_password = XXXXXXXXXX
logfile = /var/log/openerp/openerp-server.log

 Notes: db_user = openerp and db_password = XXXXXXXXXX – user created in postgres for openerp (Step 2).

 Step 5: Installing the boot script.

Similar to the configuration file, you need to either copy it or paste the contents of this script to a file in /etc/init.d/ and call it openerp-server.

 # nano /etc/init.d/openerp-server
#!/bin/sh

### BEGIN INIT INFO
# Provides:             openerp-server
# Required-Start:       $remote_fs $syslog
# Required-Stop:        $remote_fs $syslog
# Should-Start:         $network
# Should-Stop:          $network
# Default-Start:        2 3 4 5
# Default-Stop:         0 1 6
# Short-Description:    Enterprise Resource Management software
# Description:          Open ERP is a complete ERP and CRM software.
### END INIT INFO

PATH=/bin:/sbin:/usr/bin
DAEMON=/home/openerp/openerp-server
NAME=openerp-server
DESC=openerp-server

# Specify the user name (Default: openerp).
USER=openerp

# Specify an alternate config file (Default: /etc/openerp-server.conf).
CONFIGFILE="/etc/openerp-server.conf"

# pidfile
PIDFILE=/var/run/$NAME.pid

# Additional options that are passed to the Daemon.
DAEMON_OPTS="-c $CONFIGFILE"
[ -x $DAEMON ] || exit 0
[ -f $CONFIGFILE ] || exit 0
checkpid() {
    [ -f $PIDFILE ] || return 1
    pid=`cat $PIDFILE`
    [ -d /proc/$pid ] && return 0
    return 1
}
case "${1}" in
        start)
                echo -n "Starting ${DESC}: "
                start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
                        --chuid ${USER} --background --make-pidfile \
                        --exec ${DAEMON} -- ${DAEMON_OPTS}
                echo "${NAME}."
                ;;
        stop)
                echo -n "Stopping ${DESC}: "
                start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
                        --oknodo
                echo "${NAME}."
                ;;
        restart|force-reload)
                echo -n "Restarting ${DESC}: "

                start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \
                        --oknodo
                      sleep 1
                start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
                        --chuid ${USER} --background --make-pidfile \
                        --exec ${DAEMON} -- ${DAEMON_OPTS}
                echo "${NAME}."
                ;;
        *)
                N=/etc/init.d/${NAME}
                echo "Usage: ${NAME} {start|stop|restart|force-reload}" >&2
                exit 1
                ;;
esac
exit 0

Notes: DAEMON=/home/openerp/openerp-server – path to folder openerp-server

 Once it is in the right place you will need to make it executable and owned by root:

 # chmod 755 /etc/init.d/openerp-server
 # chown root: /etc/init.d/openerp-server
 # mkdir /var/log/openerp
 # chown openerp:root /var/log/openerp

 

 Step 6 : Testing the server.

To start the OpenERP server type:

 # /etc/init.d/openerp-server start

You should now be able to view the logfile and see that the server has started.

 # tail -f /var/log/openerp/openerp-server.log

If the log file looks OK point your web browser at the domain or IP address of your OpenERP server (or localhost if you are on the same machine) and use port 8069. The URL will look something like this:

http://IP_or_domain:8069

 Step 7: Automating OpenERP startup and shutdown.

If everything above seems to be working OK, the final step is setting the script to start automatically after server reboot. Type:

 # sudo update-rc.d openerp-server defaults

You should be done with Odoo / OpenERP installation at this point. Enjoy using your own, dedicated Odoo installation!

 

Menu