How To Install Odoo 14 On Ubuntu 20.04 LTS



Before starting this tutorial, you will need:

An Ubuntu 20.04 Desktop or Server with a root, sudo-enabled user.

A good internet connection to download the packages via various internet repositories.

Step by step guide to install guide. Execute each step as “root” user.

Step 1 — Add Odoo user to the system

sudo adduser --system --quiet --shell=/bin/bash --home=/opt/odoo --gecos 'odoo' --group odoo

Step 2 — Make Configuration Directory and Log Directory

sudo mkdir /etc/odoo && mkdir /var/log/odoo/

Step 3 — Installing Necessary OS Related Packages

sudo apt-get update && apt-get upgrade -y && apt-get install postgresql postgresql-server-dev-12 build-essential python3-pillow python3-lxml python3-dev python3-pip python3-setuptools npm nodejs git gdebi libldap2-dev libsasl2-dev  libxml2-dev libxslt1-dev libjpeg-dev -y

Step 4- Restart Postgres Service

sudo service postgresql restart

Step 5 — Cloning Odoo 14 From Source Repository

git clone --depth=1 --branch=14.0 /opt/odoo/odoo

Step 6 — Change Ownership of Odoo Directory

sudo chown odoo:odoo /opt/odoo/ -R && sudo chown odoo:odoo /var/log/odoo/ -R 

Step 7 — Installing Python Packages Required by Odoo

cd /opt/odoo/odoo && sudo pip3 install -r requirements.txt

Step 8 — Installing Node Packages Required by Odoo

sudo npm install -g less less-plugin-clean-css rtlcss -y

Step 9 — Installing wkhtmltopdf

cd /tmp && wget && sudo gdebi -n wkhtmltox_0.12.5-1.bionic_amd64.deb && rm wkhtmltox_0.12.5-1.bionic_amd64.deb

Step 10 — Linking wkhtmltopdf as Command

sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin/ && sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin/

Step 11 — Creating PostgreSQL user for Odoo

sudo su - postgres -c "createuser -s odoo"

Step 12 — Starting Odoo and Creating Config File

sudo su - odoo -c "/opt/odoo/odoo/odoo-bin --addons-path=/opt/odoo/odoo/addons -s --stop-after-init"

Step 13 — Moving Config File To Config Directory

sudo mv /opt/odoo/.odoorc /etc/odoo/odoo.conf

Step 14 — Modifying Configuration Parameters

sudo sed -i "s,^\(logfile = \).*,\1"/var/log/odoo/odoo-server.log"," /etc/odoo/odoo.conf

sudo sed -i "s,^\(logrotate = \).*,\1"True"," /etc/odoo/odoo.conf

sudo sed -i "s,^\(proxy_mode = \).*,\1"True"," /etc/odoo/odoo.conf

Step 15 — Setting up Odoo Executable

sudo cp /opt/odoo/odoo/debian/init /etc/init.d/odoo && chmod +x /etc/init.d/odo

sudo ln -s /opt/odoo/odoo/odoo-bin /usr/bin/odoo

Step 16 — Setting Up Odoo To Start at OS StartUp

sudo update-rc.d -f odoo start 20 2 3 4 5 .

Step 17 — Starting Odoo

sudo service odoo restart