Technology

How To Install Odoo 16 on Ubuntu 22.04

This blog post will give crucial information you how to install Odoo 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 prerequisite.

Prerequisites

  • Access to the command line/terminal with sudo permissions.
  • Access to a browser.
  • Git installed.
  • Pip for Python 3 installed.

After meeting 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 inaccessible system and allows testing different versions on the existing machine.

Here are the crucial process, defined in steps one should follow one by one to install Odoo 16 ubuntu.

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

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

  • sudo apt-get update
  • sudo apt-get upgrade

 

STEP 2: Create an 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 must give a role password for the newly created role and verify it by giving it the same password again.

  •  /q
  • exit

Then restart the postgresql server

  • sudo service postgresql restart


STEP 4: Install python and dependent 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 the 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 the 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 a 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

Conclusion

With the above steps, we are sure you figured out how to install odoo 16 Ubuntu 22.04. Linescripts is one of the reputed, trusted, and certified odoo partners. Every person wants to ease their life, and luckily odoo fulfills this by providing all departments needed to run a business in one place and helping to grow your business by putting everything in the same place. Now you don’t have to recruit many employees to handle and run your company seamlessly, all the needs are being fulfilled by Odoo which delivers a seamless experience. Click here to find the certified odoo development partner.

< Blogs>

More Blogs

Empowering Thoughts & Engaging Discussions
ERP

What is Knowledge Module in Odoo 16?

ERP

Why is Odoo an Ideal ERP for Food Manufacturers?

Odoo Partners

Why is Debugging Important in Odoo 15?