How to install Odoo 16 on Ubuntu

Step-by-Step guide for installation of Odoo 16 on Ubuntu
How to install odoo 16 in Ubuntu


You need first update and upgrate the packages for ubuntu:

$ sudo apt-get update

$ sudo apt-get upgrade


Python: Odoo is written in Python, so you need to have Python installed on your system. Odoo 16 supports Python 3.x versions, check if it is installed in ubuntu.

Install Dependencies: Various Python libraries and development tools are required for Odoo to run smoothly, Some of the common ones include:

python3-pip: The Python package installer is needed to install Python dependencies.

$ sudo apt-get install python3-pip

libxml2-dev, libxslt-dev, libldap2-dev, libsasl2-dev, libssl-dev: These development libraries are required for certain Python packages used by Odoo.

$ sudo apt-get install libxml2-dev libxslt-dev libldap2-dev libsasl2-dev libssl-dev


build-essential: This package includes essential tools like gcc and make, which are necessary for compiling certain Python packages.

$ sudo apt-get install build-essential


Node.js and Less: Odoo's web client requires Node.js and Less for asset management and compilation. Install Node.js and Less to ensure that the web client functions properly, if you want to use it.

You can install Node.js using a package manager like apt on Ubuntu:

$ sudo apt install nodejs


You can install Less using npm, which comes bundled with Node.js:

$  sudo npm install -g less


PostgreSQL: Odoo uses PostgreSQL as its database backend, Ensure that you have PostgreSQL installed on your system.

Install PostgreSQL and its dependencies:

$  sudo apt install postgresql postgresql-contrib


PostgreSQL will be automatically started after installation, check the status of the PostgreSQL service by running:

$ systemctl status postgresql


Create a PostgreSQL User:

Creates a PostgreSQL user named odoo with superuser privileges.

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


Create a System User for Odoo:

Create a system user for running the Odoo service.

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


Wkhtmltopdf: Odoo uses Wkhtmltopdf for generating PDF reports. Odoo 16 typically requires a specific version of Wkhtmltopdf, so check the compatibility requirements.

Download Wkhtmltopdf for odoo 16 from here:

https://github.com/odoo/odoo/wiki/Wkhtmltopdf

According to supported version for os, for example using commnad:

$  sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb


Installing Wkhtmltopdf:

$  apt install ./wkhtmltox_0.12.6.1-3.jammy_amd64.deb

Clone odoo-16 from github:

$  git clone https://github.com/odoo/odoo.git -b 16.0 --depth 1


Create virtualenv:

Navigate to the directory where you want to create virtualenv, for example creating a virtual environment named ‘venv’:

$  virtualenv -p python3 venv


Activate virtualenv:

$  source venv/bin/activate


Install Requirements.txt for odoo:

$  pip3 install -r odoo16/requirements.txt



Setting up Conf file:

Navigate to the directory where you want to store the odoo.conf file. Here i have chosen, odoo.conf from debian folder,

Inside the odoo.conf file, you'll define various settings for your Odoo instance. Here's a basic example:

[options]
; Replace the placeholder values with your PostgreSQL database details

db_host = localhost

db_port = 5432

db_user = odoo

db_password = your_database_password


addons_path = /home/tracencode-dev/workspace/odoo16/core/addons,/home/tracencode-dev/workspace/odoo16/custom

; Set the Odoo addons path where your custom addons are located



Run odoo server using odoo conf command, within odoo directory:

$ ./odoo-bin -c debian/odoo.conf


this should be executed from the Odoo project directory after activating the virtual environment.

Ones the server runs you need to create the database from Odoo database manager, and remember the email and password.

in Odoo
How to install Odoo 16 on Ubuntu
Prateek Pargat 19 December 2023
Share this post
Tags
Unlocking Business Success: Odoo ERP Solutions for Speciality Industries
Elevate Efficiency and Drive Growth with Tailored Odoo ERP Solutions !