Pragmatic – Leading provider of open source business applications OpenERP, Ruby on Rails, Node.js, Talend, jaspersoft  – Pragmatic
Beyonce Adams

Install Odoo 16 on Ubuntu 20.04 LTS Server In 17 Easy Steps

ERP is fast-becoming an integral component of business management in most countries. One of the most widely used ERPs on the market, Odoo has the largest global installation base. The software is used by more than 7 million users worldwide, from startups to large enterprises. One of the best parts of Odoo is that it is free, open-source ERP software written in Python and Javascript.

Quickly then, let’s get down to business and understand the 16 easy steps to install Odoo in the Ubuntu 20.04 LTS server.

Step 1: First, We Install Ubuntu Essentials

As a first step, we will update our existing packages and enable a few Odoo dependency repositories.

sudo apt install software-properties-common -y
sudo add-apt-repository universe
# libpng12-0 dependency for wkhtmltopdf
sudo add-apt-repository ppa:linuxuprising/libpng12 -y
sudo add-apt-repository "deb xenial main"
sudo apt update
sudo apt upgrade -y

Step 2: Next We Install Postgresql Server

Odoo stores data in a PostgreSQL database. Postgresql 12 comes by default with Ubuntu 22.04, so we can install it using the following command. Odoo 16 is also compatible with Postgresql versions 13, 14, 15.

sudo apt install postgresql postgresql-server-dev-all -y
#Creating the ODOO PostgreSQL User
sudo su - postgres -c "createuser -s odoo16"

Step 3: Now Install Python Dependencies

#Installing Python 3 + pip3
sudo apt install git python3 python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libjpeg-dev gdebi xfonts-base xfonts-75dpi -y
sudo apt install libpng12-0 -y
#Installing nodeJS NPM and rtlcss for LTR support
sudo apt install nodejs npm -y
sudo npm install -g rtlcss
sudo npm install -g less
sudo npm install -g less-plugin-clean-css

Step 4: Install wkhtmltopdf

wkhtmltopdf converts html content into pdf format. Using the wkhtmltopdf package, Odoo generates the reports in html format and then converts them to pdf.

sudo wget
sudo apt install ./wkhtmltox_0.12.5-1.focal_amd64.deb

Step 5: Then Create ODOO System User

sudo adduser --system --quiet --shell=/bin/bash --home=/opt/odoo --gecos 'ODOO' --group odoo
# The user should also be added to the sudo'ers group.
sudo adduser odoo sudo

Planning to upgrade to Odoo 16? 
While the globally anticipated Odoo 16 version ushers in distinctive features for different modules, it is important to interpret its practical advantages for your business. Talk to our Odoo Experts now to know all about its productive application for your business. Click here now if your company is planning to upgrade to Odoo 16.

Step 6: Let’s Create the Log Directory

The logs of our Odoo instance will be stored in this directory.

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

Step 7: Cloning Odoo to Server 

It’s now time to get Odoo’s source code so that we can run it on our server.

sudo git clone --depth 1 --branch 16.0 /opt/odoo/odoo16/server-addons

Step 8: Setup Python Virtual Environment

To install the Python packages needed for Odoo, we will use a Python virtual environment. In order to do that, let’s create and activate a python virtual environment.

sudo pip3 install virtualenv
cd /opt/odoo/odoo16
virtualenv odoo-venv or python3 -m venv odoo-venv
source odoo-venv/bin/activate

Step 9: Install Python Packages/Requirements

pip3 install -r /opt/odoo/odoo16/server-addons/requirements.txt
pip3 install psycopg2-binary pdfminer.six num2words ofxparse dbfread ebaysdk firebase_admin pyOpenSSL

Step 10: Setting Permissions On Home Folder

sudo chown -R odoo:odoo /opt/odoo/*

Step 11: Create Custom Module Directory

sudo su odoo -c "mkdir /opt/odoo/odoo16/odoo-custom-addons"

Step 12: Create Server Config File

Odoo will use the config file to determine the database, port number, logfile location, etc., during runtime.

sudo touch /etc/odoo16.conf
sudo nano /etc/odoo16.conf
; Database operations password:
admin_passwd = PASSWORD
db_host = localhost
db_user = odoo16
db_password = False
http_port = 8069
logfile = /var/log/odoo/odoo16-server.log
data_dir = /opt/odoo/odoo16/.local/share/Odoo
addons_path = /opt/odoo/odoo16/server-addons/addons,/opt/odoo/odoo16/odoo-custom-addons

Step 13: Set permission for config file

sudo chown odoo:odoo /etc/odoo16.conf
sudo chmod 640 /etc/odoo16.conf

Step 14: Create service file

This service file will ensure that our Odoo system is up and running after every server restart.

sudo nano /etc/systemd/system/odoo16.service

Requires=postgresql.service postgresql.service
ExecStart=/opt/odoo/odoo16/odoo-venv/bin/python3 /opt/odoo/odoo16/server-addons/odoo-bin -c /etc/odoo16.conf

Step 15: Set permission for service file

sudo chmod 755 /etc/systemd/system/odoo16.service
sudo chown root: /etc/systemd/system/odoo16.service


Step 16: Service Commands

sudo systemctl start odoo16.service
sudo systemctl status odoo16.service
sudo systemctl restart odoo16.service

sudo systemctl daemon-reload

Step 17: Enable the Odoo service on system startup

sudo systemctl enable odoo16.service

Following these steps with the precise instructions provided should be good to help you set up Odoo in the Ubuntu 20.04 LTS server. For any queries, do reach out to us via the comments/reply section below. We always look forward to interacting with Odoo users to simplify any complexities pertaining to Odoo ERP.

Pragmatic Techsoft has many years of experience providing Odoo ERP software for a diverse range of industries. We have helped our clients with customized Odoo ERP systems to achieve their specific business goals right from the earlier versions of Odoo. Our software solutions have propelled the business capabilities of numerous organizations across 50+ countries for over a decade. With a vast range of custom modules to accommodate different business functions, you can optimize operations to their fullest potential. You can automate routine tasks and focus more on the things that need your immediate attention.

If you are planning to upgrade to Odoo 16 from any previous versions of Odoo, click here now to Talk to our Odoo experts.


Leave a Reply

Subscribe to Blog via Email.

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Recent Comments

Related Posts