How-to-Install-Odoo-16-ERP-on-Ubuntu-22.04

How to Install Odoo 16 Version on Ubuntu 22.04

Introduction

In this guide, we will walk you through the process of installing and configuring Odoo 16 ERP on Ubuntu 22.04. Please follow these steps: 

Step 1: Update Package Manager

Before installing Odoo, make sure your Ubuntu package manager is up to date by executing the following commands:

sudo apt-get update
sudo apt-get upgrade -y

Step 2: Create an Odoo User

To ensure proper system management, create an Odoo user with administrative privileges using the following command:

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

Step 3: Install PostgreSQL and Create an Odoo User for PostgreSQL

Odoo relies on PostgreSQL as its database server. Install PostgreSQL and create an Odoo user for database access:

sudo apt install postgresql -y
sudo su - postgres -c "createuser -s odoo" 2> /dev/null || true
sudo chmod 700 -R /var/lib/postgresql/14/main/
sudo systemctl restart postgresql
 

Step 4: Installation of Python and Python PIP Dependencies

Install Python and Python PIP dependencies required for Odoo:

sudo apt-get 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 -y
sudo apt-get install libpq-dev python3-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev python3-psutil python3-polib python3-dateutil python3-decorator python3-lxml python3-reportlab python3-pil python3-passlib python3-werkzeug python3-psycopg2 python3-pypdf2 python3-gevent -y
 

Step 5: Additional Packages Required

Node.js is required for Odoo 16. Install it with the following command:

sudo apt-get install nodejs npm -y
If you need right-to-left CSS or language support in Odoo, you can add it with:
sudo npm install -g rtlcss

Step 6: Installation of wkhtmltox

To enable Odoo 16 to generate PDF reports, install wkhtmltopdf:

sudo apt-get install xfonts-75dpi xfonts-base -y
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb
sudo dpkg -i wkhtmltox_0.12.6.1-2.jammy_amd64.deb
 

Step 7: Create a Log Directory and Provide Permissions

Create a log directory for Odoo and grant the necessary write permissions:

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

Step 8: Installation of Odoo 16

Before installing Odoo, make sure your Ubuntu package manager is up to date by executing the following commands:

sudo apt-get install git
sudo git clone https://www.github.com/odoo/odoo /opt/odoo/odoo-server -b 16.0 --depth 1
 

Step 9: Setup Required Permissions

After installing Odoo 16, set the required permissions for it to function properly:

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

Step 10: Creation of a Server Configuration File

Create a configuration file for Odoo:

sudo touch /etc/odoo-server.conf
sudo su root -c "printf '[options]\n' | sudo tee /etc/odoo-server.conf"
sudo su root -c "printf 'admin_passwd = admin\n' | sudo tee -a /etc/odoo-server.conf"
sudo su root -c "printf 'xmlrpc_port = 9080\n' | sudo tee -a /etc/odoo-server.conf"
sudo su root -c "printf 'logfile = /var/log/odoo/odoo-server.log\n' | sudo tee -a /etc/odoo-server.conf"
sudo su root -c "printf 'addons_path=/opt/odoo/odoo-server/addons\n' | sudo tee -a /etc/odoo-server.conf"
 

Give the configuration file appropriate permissions:

sudo chown odoo:odoo /etc/odoo-server.conf
sudo chmod 640 /etc/odoo-server.conf
 

Step 11: Create a Python Virtual Environment

To isolate the Odoo installation, create a Python virtual environment:

sudo su -l odoo -s /bin/bash
cd odoo-server
python3 -m venv odoo-venv
source odoo-venv/bin/activate
pip3 install wheel
pip3 install -r requirements.txt
deactivate

Step 12: Start the Odoo Instance

Now, start the Odoo service by executing the following commands:

cd /opt/odoo/odoo-server
source odoo-venv/bin/activate
./odoo-bin -c /etc/odoo-server.conf
 

Step 13: Login and Access the Odoo Application

You can access the Odoo application by opening a web browser and visiting http://localhost:8069 or http://_ip_or_domain:8069. Follow the on-screen instructions to customize your database and start using Odoo 16.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top