support Click to see our new support page.
support For sales enquiry!

How to Install Odoo 16 on Ubuntu 22.04

ubundu 22.04, Odoo 16 Installation, Ubuntu 22.04, Odoo Setup Guide, Step-by-Step Installation, Odoo on Ubuntu, Software Installation Tutorial, Ubuntu Server Configuration, Open Source ERP Installation, Odoo Deployment, Ubuntu 22.04 Compatibility
Author

Abhishek S DinilNov. 7, 2022

 

In this blog post, you will learn how to install Odoo 16 on Ubuntu 22.04

There are some must followed steps involved in the installation and there are also some files that are necessary to install as a prerequisites.

Prerequisites

  • Access to the command line/terminal with sudo permissions.

  • Access to a browser.

  • Git installed.

  • Pip for Python 3 installed.

     

After meet all the prerequisites, follow the steps below to install Odoo 16 on Ubuntu in a Python virtual environment.

Installing Odoo in a virtual environment creates an isolated system and allows testing of different versions on the same machine.

Here are the steps to follow one by one to install Odoo 16.
 

STEP 1 : Open the terminal and update the apt repository.

Update your server and then also upgrade it using below commands.

  • sudo apt-get update

  • sudo apt-get upgrade
     

STEP 2 : Create odoo user and odoo group.

  • sudo adduser -system -home=/opt/odoo16 -group odoo16
     

STEP3 : Install and Configure PostgreSQL

Odoo needs a PostgreSQL database server to run properly. The default configuration for the Odoo package is to use the PostgreSQL server on the same host as your Odoo instance. Execute the following command in order to install the PostgreSQL server.

  • sudo apt-get install -y postgresql

After the installation, Use the below commands to start the postgresql database server

  • sudo service postgresql start

Then create a database user for odoo16

  • sudo su - postgres

  • createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo16

You have to give a role password for the newly created role and verify it by giving the same password again.

  • /q

  • exit

Then restart the postgresql server

  • sudo service postgresql restart

STEP 4 : Install python and depended python packages on the server.

  • sudo apt-get install -y python3-pip

Install Python Dependencies for Odoo 16.


Switch into odoo user by

  • sudo su odoo16 -s /bin/bash
    and then install the dependency packages.

  • pip3 install Babel decorator docutils ebaysdk feedparser gevent greenlet html2text Jinja2 lxml Mako MarkupSafe mock num2words ofxparse passlib Pillow psutil psycogreen psycopg2 pydot pyparsing PyPDF2 pyserial python-dateutil python-openid pytz pyusb PyYAML qrcode reportlab requests six suds-jurko vatnumber vobject Werkzeug XlsxWriter xlwt xlrd polib

     

STEP 5 : Install Odoo 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

  • sudo python3 -m pip install libsass

STEP 6 : Install odoo 16 community version from GITHUB
 

Below command to install GIT on your system. If it is already there, then you can ignore this.

  • sudo apt-get install -y git

Then switch to odoo user

  • sudo su - odoo16 -s /bin/bash

Clone branch 16.0 of Odoo from Github:

  • git clone https://www.github.com/odoo/odoo --depth 1 --branch=16.0 --single-branch
    And exit from the odoo user

     

STEP 7 : Create an odoo configuration file

  • sudo vim /etc/odoo16-server.conf

Copy the below content in configuration file.

[options]

; This is the password that allows database operations:

; admin_passwd = admin

db_host = False

db_port = False

db_user = odoo16

db_password = False

logfile = /var/log/odoo16/odoo16-server.log

addons_path = /opt/odoo16/odoo/addons,/opt/odoo16/odoo/odoo/addons

Change permission and also the user ownership of configuration file as below

  • sudo chown odoo16: /etc/odoo16-server.conf

  • sudo chmod 640 /etc/odoo16-server.conf

STEP 8 : Create odoo log file

  • sudo mkdir /var/log/odoo16

  • sudo chown odoo16:root /var/log/odoo16
     

STEP 9 : You can copy and paste the script to this file.

  • sudo vim /etc/init.d/odoo16-server

Then change ownership and permission

  • sudo chmod 755 /etc/init.d/odoo16-server

  • sudo chown root: /etc/init.d/odoo16-server

STEP 10 : Test the server running as service

To start the odoo server

  • sudo /etc/init.d/odoo16-server start

Stop the odoo server

  • sudo /etc/init.d/odoo16-server stop

View the odoo log files

  • tail -f /var/log/odoo16/odoo-server.log

STEP 11 : Run Odoo locally

  • sudo su - odoo -s /bin/bash

  • python3 /opt/odoo/odoo-bin

Then go to web browser to access odoo16

http://localhost:8069

or

http://0.0.0.0:8069

STEP 12 : Installing WKHTMLTOPDF

 

To print PDF reports need to install right version of wkhtmltopdf.

  • sudo wget https://builds.wkhtmltopdf.org/0.12.1.3/wkhtmltox_0.12.1.3-1~bionic_amd64.deb

  • sudo apt install ./wkhtmltox_0.12.1.3-1~bionic_amd64.deb

  • sudo cp /usr/local/bin/wkhtmltoimage /usr/bin/wkhtmltoimage

  • sudo cp /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf

 

In short, for more support about Odoo 16 installation in Ubuntu, contact our Odoo support team. 

0

Leave a Comment

Subscribe to our Newsletter

Sign up to receive more information about our latest offers & new product announcement and more.