Enable Dark Mode!
how-to-install-odoo-12-on-ubuntu-16-04.png
By: Niyas Raphy

How to Install Odoo 12 on Ubuntu 16.04

Technical Odoo 12

The much-awaited Odoo 12 got released at the onset of October 2018 without disappointing any of its end users. The new version is not only embedded with new usability features but also with brand-new modules. One of the significant features of Odoo 12 is the revamped accounting module which is facilitated with new components like the use of OCR and importation of vendor bills. These features make accounts management easier to use and configure.
Odoo 12 comes with a brand new Document Management module that facilitates seamless document sharing among the team and also a brand new feature of multi-website management benefiting E-commerce business at large. The functionalities of Odoo 12 are plenty and you can explore the benefits.
You can also have look at Configure Odoo 13 on Ubuntu 18

This blog discusses the procedure to be followed while installing Odoo 12 in Ubuntu 16.04

Step 1: Update the server

Make your system updated using these two commands
sudo apt-get update
sudo apt-get upgrade

Step 2: Secure Server
It is common for all versions and many of you may be aware of this. In case of any doubt, you can use the below-given info.
Run this command to make your server/system remotely accessible
sudo apt-get install openssh-server fail2ban

Step 3: Create a System User

Create a system user to run the Odoo service. The source code of Odoo will reside in the home directory of the user if you follow these steps
sudo adduser --system --home=/opt/odoo --group odoo

Step 4: Install and Configure PostgreSQL database server

Install PostgreSQL:
sudo apt-get install postgresql
sudo su - postgres

Create a PostgreSQL user for managing Odoo databases:
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo12

Exit from Postgres user to continue the installation:
exit

Step 5: Install dependencies for Odoo

Install pip 3:
sudo apt-get install -y python3-pip

After the successful installation of pip3, install dependencies using pip3:
sudo pip3 install Babel chardet decorator docutils ebaysdk feedparser gevent greenlet html2text Jinja2 libsass lxml Mako MarkupSafe mock num2words ofxparse passlib Pillow psutil psycopg2 pydot pyldap pyparsing PyPDF2 pyserial python-dateutil pytz pyusb PyYAML qrcode reportlab requests suds-jurko vatnumber vobject Werkzeug XlsxWriter xlwt xlrd

There are some web dependencies for Odoo like Node.js and less

Install these 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

wkhtmltopdf is required to generate PDF reports from Odoo. Install on your server.

The most compatible version of wkhtmltopdf is 0.12.1

Get it from here,
sudo wget http://download.gna.org/wkhtmltopdf/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
Or from here,
sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
These two commands will trigger the downloading of the package
If these both ains websites or Clone from Github repo
Here we are cloning from Git.
So, first, we have to install Git
sudo apt-get install git
Now, we should change our user as the system user we created for Odoo. Otherwise, we will end up with access right-related hurdles.
sudo su - odoo -s /bin/bash
Now we are ready to clone Odoo 12 (this is community only)
git clone https://www.github.com/odoo/odoo --depth 1 --branch 12.0 --single-branch
Exit from Odoo user to continue the installation:
exit

Step 6: Configure Odoo

At first, we are creating a log file location for Odoo. Odoo will create and maintain its log files there.
sudo mkdir /var/log/odoo
Give full access to this directory to the Odoo user
sudo chown odoo:root /var/log/odoo
After creating a log directory, we are going to create a configuration file for Odoo.
There is a configuration file that comes with the Odoo that we have just downloaded.
We are copying that file to a more appropriate location
sudo cp /opt/odoo/debian/odoo.conf /etc/odoo.conf
We have to make some changes in the configuration file, to edit the file; we are using a text editor called nano
sudo nano /etc/odoo.conf

Here is the example of the configuration file:
   [options]
   ; This is the password that allows database operations:
   ; admin_passwd = admin
   db_host = False
   db_port = False
   db_user = odoo
   db_password = False
   addons_path = /opt/odoo/addons
   logfile = /var/log/odoo/odoo.log

After the configuration file is ready, we have to give the ownership of the file to the Odoo user
sudo chown odoo: /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf

Step 7: Create a service to run Odoo

We have to create a system unit for Odoo so that it can start behaving like a service.
Create a new file odoo.service at /etc/systemd/system/ just like we created the file
sudo nano /etc/systemd/system/odoo.service
You can use this content for your file
   [Unit]
   Description=Odoo
   Documentation=http://www.odoo.com
   [Service]
   # Ubuntu/Debian convention:
   Type=simple
   User=odoo
   ExecStart=/opt/odoo/odoo-bin -c /etc/odoo.conf
   [Install]
   WantedBy=default.target

Since this is a service, we are giving full rights to this file to the root user.
sudo chmod 755 /etc/systemd/system/odoo.service
sudo chown root: /etc/systemd/system/odoo.service

Step 8: Test Odoo

sudo systemctl start odoo.service
You can check the log file of Odoo
sudo tail -f /var/log/odoo/odoo.log

Step 9: Automating Starting of Odoo

This will enable the Odoo service to start automatically at boot time
sudo systemctl enable odoo.service

Step 10: Access Odoo

Open a new browser window and enter HTTP://<your_domain_or_IP_address>:8069 in the address bar
If everything is working properly, you will redirect to Odoo's database creation page.



Odoo Blogs Odoo Development Tutorials Odoo 13 Book


If you need any assistance in odoo, we are online, please chat with us.



2
Comments

Bernardo

Good morning gentlemen I am testing Odoo using the steps posted by you and testing some of your modules. My question is: How can I make Odoo work with shampoo ?? I was able to install it on my web server and it is working very well but I would like to test it with xampp and some of your modules. I am using ubuntu 16.04

10/12/2019

-

12:45PM

ymk

odoo.service - Odoo Loaded: loaded (/etc/systemd/system/odoo.service; disabled; vendor preset: en Active: failed (Result: exit-code) since Sat 2019-02-09 21:21:12 +07; 1s ago Docs: http://www.odoo.com Process: 1984 ExecStart=/opt/odoo/odoo-bin -c /etc/odoo.conf (code=exited, sta Main PID: 1984 (code=exited, status=1/FAILURE) Feb 09 21:21:12 163-44-197-129 odoo-bin[1984]: from . import db, graph, load Feb 09 21:21:12 163-44-197-129 odoo-bin[1984]: File "/opt/odoo/odoo/modules/gr Feb 09 21:21:12 163-44-197-129 odoo-bin[1984]: import odoo.tools as tools Feb 09 21:21:12 163-44-197-129 odoo-bin[1984]: File "/opt/odoo/odoo/tools/__in Feb 09 21:21:12 163-44-197-129 odoo-bin[1984]: from .misc import * Feb 09 21:21:12 163-44-197-129 odoo-bin[1984]: File "/opt/odoo/odoo/tools/misc Feb 09 21:21:12 163-44-197-129 odoo-bin[1984]: import babel Feb 09 21:21:12 163-44-197-129 odoo-bin[1984]: ModuleNotFoundError: No module na Feb 09 21:21:12 163-44-197-129 systemd[1]: odoo.service: Main process exited, co Feb 09 21:21:12 163-44-197-129 systemd[1]: odoo.service: Failed with result 'exi authors@163-44-197-129:/opt/odoo$

09/02/2019

-

7:22AM



Leave a comment



whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message