Muhamed YasirApril 28, 2018
Odoo is an amazing Open ERP platform. It's version Odoo 11 is an astounding Open Source ERP business software version based on the Python programming language. Installation of Odoo 11 on Ubuntu 16.04 is not a herculean task. You just need to follow the below steps to install Odoo 11 on Ubuntu 16.04 using github Odoo source code:
Update apt source-lists:
sudo apt-get update
Create the Odoo user that will own and then run the application.
sudo adduser --system --home=/opt/odoo --group odoo
Install and then 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
Install the Python libraries and also other needed libraries required for Odoo:
Odoo 11 uses python 3.x and also 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
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
Then 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
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
You can copy and paste the script to this file.
sudo vim /etc/init.d/odoo-server
Now change the ownership and permission of the file. The init script will be run by the root user.
sudo chmod 755 /etc/init.d/odoo-server
sudo chown root: /etc/init.d/odoo-server
Test the server running as service
To start the Odoo sever:
sudo /etc/init.d/odoo-server start
For stopping 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 begin on boot up, you can simply use:
update-rc.d odoo-server defaults
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.
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