How To Install Odoo V8 on Ubuntu Server

Odoo V8 is a major upgrade. With Odoo V8 OpenERP is moving into new territories, beyond ERP. Odoo V8 released an open source CMS, a disruptive eCommerce and a Business Intelligence.

ir_attachment_535106

In this blog I will show you how easily you can install Odoo V8.

Step 1: Setup your Ubuntu server

After the server started for the first time you need to update the package list of the server.

sudo apt-get update

Above command will downloads the package lists from the repositories and “updates” them to get information on the newest versions of packages and their dependencies.

Now you are ready to start odoo installation.

Step 2: PostgreSQL Server Installation and Configuration

Install PostgreSQL Server using following command.

sudo apt-get install postgresql

Setup a PostgreSQL user for Odoo. You may need to login as postgres user first.

odoo@swapnil-laptop:/$ sudo su postgres

password: XXXXXXXXXX

Now create PostgreSQL user Odoo using the following command:

postgres@swapnil-laptop:/$ createuser --createdb --username postgres --no-createrole
--pwprompt odoo
Enter password for new role: XXXXXXXXXX
Enter it again: XXXXXXXXXX
Shall the new role be a superuser? (y/n) y
CREATE ROLE

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
odoo : the new user's name

Step 3: Odoo Server Installation

Installing the required packages. Use following single commands to install all required python libraries.

 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 python-decorator python-psutil python-pyPdf

Download the latest odoo server source using the following command.

cd /opt/

sudo wget http://nightly.openerp.com/8.0/nightly/src/odoo_8.0-latest.tar.gz

sudo tar -xvzf odoo_8.0-latest.tar.gz

Rename the extracted folder

sudo mv openerp-8.0-1b53469 odoo

Setup odoo using following command

cd /opt/odoo

sudo python setup.py install

Step 4: Creating a configuration file for Odoo Server

Copy odoo-server.config file to /etc we need to change it’s ownership and permissions use your system user name in my case its odoo.

sudo nano /etc/odoo-server.conf

sudo chown odoo: /etc/odoo-server.conf

sudo chmod 640 /etc/odoo-server.conf

The above commands make the file owned and writable only by the odoo user and group and only readable by odoo and root.

To allow the Odoo server to run initially, you should only need to change one line in this file. Toward to the top of the file change the

db_host = localhost

db_port = 5432

db_user = odoo   // user created in postgres for odoo

db_password = odoo

One other line we might as well add to the configuration file now, is to tell Odoo where to write its log file. To complement my suggested location below add the following line to the odoo-server.conf file:

 logfile = /var/log/odoo/odoo-server.log

Once the configuration file is edited and saved, you can start the server manually just to check if it actually runs. You might get some errors because of some missing packages, just install the missing packages and move on.

Step 5: Installing the boot script

For the final step we need to install a script which will be used to start-up and shut down the server automatically and also run the application as the correct user.

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 odoo-server.

Copy content of  odoo-server to your odoo server boot script.

Do following changes in /etc/init.d/odoo-server file

DAEMON=/opt/odoo/openerp-server

USER= odoo

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

sudo chmod 755 /etc/init.d/odoo-server

sudo chown root: /etc/init.d/odoo-server

In the configuration file there’s an entry for the server’s log file. We need to create that directory first so that the server has somewhere to log to and also we must make it writeable by the odoo user:

 sudo mkdir /var/log/odoo

sudo chown odoo:root /var/log/odoo

 Step 6 : Testing the server

To start the Odoo server type:

sudo /etc/init.d/odoo-server start

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

sudo tail -f /var/log/odoo/odoo-server.log

If the log file looks OK, now point your web browser at the domain or IP address of your Odoo 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 Odoo startup and shutdown

If everything above seems to be working OK, the final step is make the script start and stop automatically with the Ubuntu Server. To do this type:

 sudo update-rc.d odoo-server defaults

You can now try rebooting you server if you like. Odoo should be running by the time you log back in.

For Amazon EC2 you need to allow 8069 port in your EC2 Security Group.

Hope you find this tutorial helpful. Feel free to ask questions! Don’t forget to like or to leave a comment if its really help you.

Advertisements

11 thoughts on “How To Install Odoo V8 on Ubuntu Server”

  1. I get an error:

    Installed /usr/local/lib/python2.7/dist-packages/odoo-8.0_20150209-py2.7.egg
    Processing dependencies for odoo==8.0-20150209
    Searching for python-ldap
    Reading http://download.gna.org/pychart/
    Reading https://pypi.python.org/simple/python-ldap/
    Best match: python-ldap 2.4.19
    Downloading https://pypi.python.org/packages/source/p/python-ldap/python-ldap-2.4.19.tar.gz#md5=b941bf31d09739492aa19ef679e94ae3
    Processing python-ldap-2.4.19.tar.gz
    Writing /tmp/easy_install-gaUcHe/python-ldap-2.4.19/setup.cfg
    Running python-ldap-2.4.19/setup.py -q bdist_egg –dist-dir /tmp/easy_install-gaUcHe/python-ldap-2.4.19/egg-dist-tmp-C9cpGK
    defines: HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
    extra_compile_args:
    extra_objects:
    include_dirs: /opt/openldap-RE24/include /usr/include/sasl /usr/include
    library_dirs: /opt/openldap-RE24/lib /usr/lib
    libs: ldap_r
    file Lib/ldap.py (for module ldap) not found
    file Lib/ldap/controls.py (for module ldap.controls) not found
    file Lib/ldap/extop.py (for module ldap.extop) not found
    file Lib/ldap/schema.py (for module ldap.schema) not found
    warning: no files found matching ‘Makefile’
    warning: no files found matching ‘Modules/LICENSE’
    file Lib/ldap.py (for module ldap) not found
    file Lib/ldap/controls.py (for module ldap.controls) not found
    file Lib/ldap/extop.py (for module ldap.extop) not found
    file Lib/ldap/schema.py (for module ldap.schema) not found
    file Lib/ldap.py (for module ldap) not found
    file Lib/ldap/controls.py (for module ldap.controls) not found
    file Lib/ldap/extop.py (for module ldap.extop) not found
    file Lib/ldap/schema.py (for module ldap.schema) not found
    In file included from Modules/LDAPObject.c:9:0:
    Modules/errors.h:8:18: fatal error: lber.h: No such file or directory
    #include “lber.h”
    ^
    compilation terminated.
    error: Setup script exited with error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

    Like

  2. hi i am getting error

    Modules/LDAPObject.c :18:18: fatal error: sasl.h : No Such file or directory
    #include

    compilation terminated.
    error: Setup script exited with error with : command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

    Like

  3. erro was

    Modules/LDAPObject.c :18:18: fatal error: sasl.h : No Such file or directory
    #include

    compilation terminated.
    error: Setup script exited with error with : command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

    i getting this error when i give command

    sudo python setup.py install

    also in step 3 i am getting error in install “python-pychart”
    get erro like E: enable to locate

    so i remove “python-pychart” from sudo apt-get install

    pls help

    Like

    1. For the error error: Setup script exited with error with : command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
      you can install below package and they try.
      sudo apt-get install gcc

      For error error in install “python-pychart” please use

      sudp apt-get update command or you can use
      pip install pychart

      You can also try my shell script to install odoo on clean ubuntu machine

      https://github.com/meswapnilwagh/odoo-install-scripts/tree/master/odoo-v8/ubuntu-server

      If there is any issue in script you can create a issue on github.

      Thanks,
      Swapnil A. Wagh

      Like

  4. i solved previous error with

    sudo apt-get install libsasl2-dev

    after that,
    i follow your all steps after in last steps when i try to start server

    sudo /etc/init.d/odoo-server start

    so nothing show in terminal

    after i try to open server http://IP_or_domain:8069

    but it shows
    “Unable to connect”

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s