Install Odoo 11 On Ubuntu 16.04

Install Odoo 11 On Ubuntu 16.04

Follow the below steps to install Odoo 11 on Ubuntu 16.04 using github odoo source code:

 

Step 1: 

Update apt source-lists:

sudo apt-get update

Step 2: 

Create the Odoo user that will own and run the application.

sudo adduser --system --home=/opt/odoo --group odoo

Step 3: 

Install and configure the database server, PostgreSQL.

sudo apt-get install -y postgresql

Once the PostgreSQL installation is completed, we need to create a postgres user to communicate with Odoo.

sudo service postgresql start
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo

Enter password for new role: *****

Enter it again: *****

Now exit from the postgres

exit
sudo service postgresql restart

Step 4: 

Install the Python libraries & other needed libraries required for Odoo:

Odoo 11 uses python 3.x and python 3.5 is already installed on Ubuntu 16.04 by default. So in order to install all dependent libraries easily we`ll install pip3 in our server:

sudo apt-get install -y python3-pip

Once pip3 is installed on server,  now we can install other dependent libraries using pip3:

pip3 install Babel decorator docutils ebaysdk feedparser gevent greenlet html2text Jinja2 lxml Mako MarkupSafe mock num2words ofxparse passlib Pillow psutil psycogreen psycopg2 pydot pyparsing PyPDF2 pyserial python-dateutil python-openid pytz pyusb PyYAML qrcode reportlab requests six suds-jurko vatnumber vobject Werkzeug XlsxWriter xlwt xlrd

Next is to install Odoo Web Dependencies:

sudo apt-get install -y npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g less less-plugin-clean-css
sudo apt-get install -y node-less 

Step 5:

Install Odoo community version 11 which is available in GITHUB.

Below command to install GIT on your system. If it is already there, then you can ignore this.

sudo apt-get install -y git

Switch to the Odoo user:

sudo su - odoo -s /bin/bash

Clone branch 11.0 of Odoo from Github:

git clone https://www.github.com/odoo/odoo --depth 1 --branch 11.0 --single-branch .

Now exit from the odoo user account:

exit

Step 6:

Create configuration file to run as a service.

sudo vim /etc/odoo-server.conf

A sample configuration file is as like this:

[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = False
db_port = False
db_user = odoo
db_password = False
logfile = /var/log/odoo/odoo-server.log
addons_path = /opt/odoo/addons,/opt/odoo/odoo/addons

Now set the ownership and permission of the configuration file:

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

Now create a directory for storing logs of Odoo server and assigning proper ownership to the directory:

sudo mkdir /var/log/odoo
sudo chown odoo:root /var/log/odoo

Step 7:

Now setup the boot script. This script will be used to start-up & shut-down the Odoo server automatically.

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

You can copy and paste the script to this file.

Now change the ownership and permission of the file. The init script will be run by root user.

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

Step 8:

Test the server running as service

To start the Odoo sever:

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

To stop the Odoo server:

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

To view the log file of odoo server:

tailf /var/log/odoo/odoo-server.log

Now, if you want to add this service to be started on boot up, you can simply use:

update-rc.d odoo-server defaults

To run manually:

Switch to odoo user

sudo su – odoo -s /bin/bash

Run the server

/opt/odoo/odoo-bin

If everything is fine, then you can check Odoo server running on your browser with url:

http://localhost:8069

or

http://0.0.0.0:8069

If there is any error, you can see in the log.

Install wkhtmltopdf

If wkhtmltopdf is not installed in your system, You cannot print any pdf reports and it will show you the error ‘

Unable to find Wkhtmltopdf on this system‘. To overcome this error, install the right version of wkhtmltopdf as below.

sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin

Hope you have configured the odoo properly. All the best 🙂

One thought on “Install Odoo 11 On Ubuntu 16.04

  1. can`t copy and paste…
    when try to run odoo get this.
    odoo@odoo-11-prime-beta:/home/odoo_seminar$ /opt/odoo/odoo-bin
    Traceback (most recent call last):
    File “/opt/odoo/odoo-bin”, line 5, in
    import odoo
    File “/opt/odoo/odoo/__init__.py”, line 84, in
    from . import modules
    File “/opt/odoo/odoo/modules/__init__.py”, line 8, in
    from . import db, graph, loading, migration, module, registry
    File “/opt/odoo/odoo/modules/graph.py”, line 10, in
    import odoo.tools as tools
    File “/opt/odoo/odoo/tools/__init__.py”, line 7, in
    from . import pdf
    File “/opt/odoo/odoo/tools/pdf.py”, line 4, in
    from PyPDF2 import PdfFileWriter, PdfFileReader
    ImportError: No module named ‘PyPDF2’

Leave a Reply

Your email address will not be published. Required fields are marked *