How to install Odoo 15 On Ubuntu 20.04 LTS

How to install Odoo 15 on Ubuntu 20.04 LTS 1

In this short tutorial we will learn how to install Odoo 15 Community edition on Linux Ubuntu 20.04 LTS. We will use Odoo binary source from Odoo official GitHub repository and Python virtual environment. Also we will be using Odoo default webserver and PostgreSQL 14 for this installation.

Introduction

Odoo is a suite of business management software tools that ships with various business applications including: CRM, e-Commerce, billing, accounting, manufacturing, warehouse, project management, inventory management and much more, all seamlessly integrated.

The Odoo Community version is a libre software, licensed under the GNU LGPLv3, while the Enterprise version has proprietary extra features and services. The source code for the framework and core ERP modules is curated by the Belgium-based Odoo S.A. Odoo is available for both on-premise and ready to use SaaS environment. In this article we will discuss how to install Odoo 15 on Ubuntu 20.04 LTS operating system.

Odoo 15 Installation on Ubuntu 20.04 LTS

Odoo can be installed in different ways, depending on the use case and available technologies. The easiest and quickest way to install Odoo is by using the official Odoo APT repositories.

Prerequisites

Before we are going to the install Odoo 15 on Ubuntu 20.04, we have to prepare the environment first as mentioned below :

  • Ubuntu 20.04 System with updated repository
  • a user with sudo privilege
  • Sufficient disk space and good internet access

There are several support packages that we must install first. The Odoo 15 Installation will be consist of several steps as shown below :

The installation steps will be detail discussed below.

1. Update Ubuntu 20.04 system

The first stape, we will update our Ubuntu repository system. To update local repository, we will execute command line :

$ sudo apt update

Output :

rapik@worker2:~$ sudo apt update
[sudo] password for rapik: 
Hit:1 https://packages.microsoft.com/repos/edge stable InRelease
Hit:2 http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu focal InRelease                                   
Hit:3 http://deb.anydesk.com all InRelease                                                                  
Hit:4 http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04  InRelease
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease                                            
Err:3 http://deb.anydesk.com all InRelease                                                                  
  The following signatures were invalid: EXPKEYSIG 18DF3741CDFFDE29 philandro Software GmbH <info@philandro.com>
Hit:6 http://us.archive.ubuntu.com/ubuntu focal InRelease                                      
Hit:7 http://ppa.launchpad.net/team-xbmc/ppa/ubuntu focal InRelease 
Hit:8 https://shop.softmaker.com/repo/apt stable InRelease                                               
Hit:9 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease                                        
Hit:10 http://ppa.launchpad.net/ubuntuhandbook1/gimp/ubuntu focal InRelease        
Hit:11 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done

2. Install Prerequisites Tools

Odoo consists of several applications that are put together in a seemless integrated bundle, so it requires several supporting tools or libraries to make the application run smoothly. On this stage we will install all Oddo’s required packages, by submitting command line :

$ sudo apt install git python3-pip build-essential wget python3-dev python3-venv
$ sudo apt install python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev
$ sudo apt install python3-setuptools node-less libjpeg-dev zlib1g-dev libpq-dev
$ sudo apt install libxslt1-dev libldap2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev
$ sudo apt install liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev

Output :

rapik@worker2:~$ sudo apt install git python3-pip build-essential wget python3-dev python3-venv
Reading package lists... Done
Building dependency tree       
Reading state information... Done
wget is already the newest version (1.20.3-1ubuntu2).
wget set to manually installed.
The following packages were automatically installed and are no longer required:
  gimp-data kodi-inputstream-adaptive kodi-inputstream-rtmp kodi-peripheral-joystick libamd2 libaom2
  libass9 libbabl-0.1-0 libcamd2 libccolamd2 libcdio19 libcec4 libcholmod3 libcrossguid0 libdav1d5
  libde265-0 libfstrcmp0 libgegl-0.4-0 libgegl-common libgimp2.0 libheif1 libiso9660-11 libmariadb3
  libmetis5 libmicrohttpd12 libmng2 libmypaint-1.5-1 libmypaint-common libp8-platform2 libpcrecpp0v5
  libsdl2-2.0-0 libshairplay0 libtinyxml2.6.2v5 libudfread0 libumfpack5 libva-wayland2 libwayland-client++0
  libwayland-cursor++0 libwayland-egl++0 libx265-192 mariadb-common python3-bluez python3-pycryptodome
. . .
Setting up build-essential (12.8ubuntu1.1) ...
Setting up python3-dev (3.8.2-0ubuntu2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
rapik@worker2:~$ sudo apt install python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-wheel is already the newest version (0.34.2-1).
python3-wheel set to manually installed.
The following packages were automatically installed and are no longer required:
  gimp-data kodi-inputstream-adaptive kodi-inputstream-rtmp kodi-peripheral-joystick libamd2 libaom2 libass9 libbabl-0.1-0
  libcamd2 libccolamd2 libcdio19 libcec4 libcholmod3 libcrossguid0 libdav1d5 libde265-0 libfstrcmp0 libgegl-0.4-0
  libgegl-common libgimp2.0 libheif1 libiso9660-11 libmariadb3 libmetis5 libmicrohttpd12 libmng2 libmypaint-1.5-1
  libmypaint-common libp8-platform2 libpcrecpp0v5 libsdl2-2.0-0 libshairplay0 libtinyxml2.6.2v5 libudfread0 libumfpack5
  libva-wayland2 libwayland-client++0 libwayland-cursor++0 libwayland-egl++0 libx265-192 mariadb-common python3-bluez
  python3-pycryptodome
. . .
Setting up libfreetype6-dev:amd64 (2.10.1-2ubuntu0.1) ...
Setting up libxml2-dev:amd64 (2.9.10+dfsg-5ubuntu0.20.04.1) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
rapik@worker2:~$ sudo apt install python3-setuptools node-less libjpeg-dev zlib1g-dev libpq-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-setuptools is already the newest version (45.2.0-1).
python3-setuptools set to manually installed.
zlib1g-dev is already the newest version (1:1.2.11.dfsg-2ubuntu1.2).
zlib1g-dev set to manually installed.
The following packages were automatically installed and are no longer required:
  gimp-data kodi-inputstream-adaptive kodi-inputstream-rtmp kodi-peripheral-joystick libamd2 libaom2 libass9 libbabl-0.1-0
  libcamd2 libccolamd2 libcdio19 libcec4 libcholmod3 libcrossguid0 libdav1d5 libde265-0 libfstrcmp0 libgegl-0.4-0
  libgegl-common libgimp2.0 libheif1 libiso9660-11 libmariadb3 libmetis5 libmicrohttpd12 libmng2 libmypaint-1.5-1
  libmypaint-common libp8-platform2 libpcrecpp0v5 libsdl2-2.0-0 libshairplay0 libtinyxml2.6.2v5 libudfread0 libumfpack5
  libva-wayland2 libwayland-client++0 libwayland-cursor++0 libwayland-egl++0 libx265-192 mariadb-common python3-bluez
  python3-pycryptodome
. . .
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Processing triggers for man-db (2.9.1-1) ...
rapik@worker2:~$ sudo apt install libxslt1-dev libldap2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libjpeg8-dev is already the newest version (8c-2ubuntu8).
libjpeg8-dev set to manually installed.
libldap2-dev is already the newest version (2.4.49+dfsg-2ubuntu1.8).
The following packages were automatically installed and are no longer required:
  gimp-data kodi-inputstream-adaptive kodi-inputstream-rtmp kodi-peripheral-joystick libamd2 libaom2 libass9 libbabl-0.1-0
  libcamd2 libccolamd2 libcdio19 libcec4 libcholmod3 libcrossguid0 libdav1d5 libde265-0 libfstrcmp0 libgegl-0.4-0
  libgegl-common libgimp2.0 libheif1 libiso9660-11 libmariadb3 libmetis5 libmicrohttpd12 libmng2 libmypaint-1.5-1
  libmypaint-common libp8-platform2 libpcrecpp0v5 libsdl2-2.0-0 libshairplay0 libtinyxml2.6.2v5 libudfread0 libumfpack5
  libva-wayland2 libwayland-client++0 libwayland-cursor++0 libwayland-egl++0 libx265-192 mariadb-common python3-bluez
  python3-pycryptodome
. . .
Setting up libtiff-dev:amd64 (4.1.0+git191117-2ubuntu0.20.04.2) ...
Setting up libtiff5-dev (4.1.0+git191117-2ubuntu0.20.04.2) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Processing triggers for man-db (2.9.1-1) ...
rapik@worker2:~$ sudo apt install liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gimp-data kodi-inputstream-adaptive kodi-inputstream-rtmp kodi-peripheral-joystick libamd2 libaom2 libass9 libbabl-0.1-0
  libcamd2 libccolamd2 libcdio19 libcec4 libcholmod3 libcrossguid0 libdav1d5 libde265-0 libfstrcmp0 libgegl-0.4-0 libgegl-common
  libgimp2.0 libheif1 libiso9660-11 libmariadb3 libmetis5 libmicrohttpd12 libmng2 libmypaint-1.5-1 libmypaint-common
  libp8-platform2 libsdl2-2.0-0 libshairplay0 libtinyxml2.6.2v5 libudfread0 libumfpack5 libva-wayland2 libwayland-client++0
  libwayland-cursor++0 libwayland-egl++0 libx265-192 mariadb-common python3-bluez python3-pycryptodome
. . .
Processing triggers for install-info (6.7.0.dfsg.2-5) ...
Setting up x11proto-dev (2019.2-1ubuntu1) ...
Setting up libxau-dev:amd64 (1:1.0.9-0ubuntu1) ...
Setting up libxdmcp-dev:amd64 (1:1.1.3-0ubuntu1) ...
Setting up x11proto-core-dev (2019.2-1ubuntu1) ...
Setting up libxcb1-dev:amd64 (1.14-2) ...

3. Install PostgreSQL 14 on Ubuntu 20.04

Odoo requires database for storing and updating data. In this tutorial, we will use PostgreSQL 14 as database engine. The PostgreSQL 14 installation has been discussed at How To Install PostgreSQL 14 on Ubuntu 20.04 tutorial.

We will verifyt PostgreSQL 14 by loging and query its version.

rapik@worker2:~$ sudo -i -u postgres
postgres@worker2:~$ psql
psql (14.1 (Ubuntu 14.1-2.pgdg20.04+1))
Type "help" for help.

postgres=# SELECT version();
                                                             version                                                              
-------------------------------------------------------------------------------------------------------------------
 PostgreSQL 14.1 (Ubuntu 14.1-2.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit
(1 row)

4. Install Wkhtmltopdf

Odoo 15 requires wkhtmltopdf application to print any reports. The wkhtmltopdf is an open source tools which enable to render HTML pages into PDFs and images for generating reports in various formats. The wkhtmltopdf article has been discussed on How To Install Wkhtmltopdf On Ubuntu 20.04 LTS article

We will verifyt the wkhtmltopdf application by submitting comand line :

$ wkhtmltopdf --version.

Output :

rapik@worker2:~$ wkhtmltopdf --version
wkhtmltopdf 0.12.6 (with patched qt)

5. Creating System User

To avoid running Odoo with root user poses a security risk, we need to create a new dedicated system user, group, and home directory for Odoo application. We will create a new user named as odoo15. For this purpose we will do following command line :

$ sudo useradd -m -d /opt/odoo15 -U -r -s /bin/bash odoo15

Output :

rapik@worker2:~$ sudo useradd -m -d /opt/odoo15 -U -r -s /bin/bash odoo15

6. Install and Configure Odoo 15

6.1. Clone Odoo 15 Source Code From Git Repo

At this stage, we will install and configure Odoo 15 application. We will clone the Odoo 15 source code from the Odoo 15 Git repository. For this purpose we will use a new user which was created, odoo15, we need to switch a user to odoo15.

$ sudo su - odoo15
$ git clone https://www.github.com/odoo/odoo --depth 1 --branch 15.0 /opt/odoo15/odoo

Output :

rapik@worker2:~$ sudo su - odoo15
odoo15@worker2:~$ git clone https://www.github.com/odoo/odoo --depth 1 --branch 15.0 /opt/odoo15/odoo
Cloning into '/opt/odoo15/odoo'…
warning: redirecting to https://github.com/odoo/odoo.git/
remote: Enumerating objects: 32743, done.
remote: Counting objects: 100% (32743/32743), done.
remote: Compressing objects: 100% (26613/26613), done.
remote: Total 32743 (delta 9315), reused 16046 (delta 4905), pack-reused 0
Receiving objects: 100% (32743/32743), 132.32 MiB | 418.00 KiB/s, done.
Resolving deltas: 100% (9315/9315), done.
Updating files: 100% (28677/28677), done.
Cloning Odoo15 from Github
Cloning Odoo15 from Github

After cloning process was done, then we have to navigate to the odoo15 directory and create a Python virtual environment for Odoo15, and named it as odoo-digi.

$ cd /opt/odoo15
$ python3 -m venv odoo-digi
$ source odoo-digi/bin/activate

Output :

odoo15@worker2:~$ cd /opt/odoo15
odoo15@worker2:~$ python3 -m venv odoo-digi
odoo15@worker2:~$ source odoo-digi/bin/activate
(odoo-digi) odoo15@worker2:~$ 
Odoo 15 Python virtual environment
Odoo 15 Python virtual environment

6.2. Install Requirements for Odoo 15

After all are set, then we will install requirements for Odoo. To perform this task, we will submit the following command line :

$ pip3 install wheel
$ pip3 install -r odoo/requirements.txt

Output :

(odoo-digi) odoo15@worker2:~$ pip3 install wheel
Collecting wheel
  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.37.1
(odoo-digi) odoo15@worker2:~$ pip3 install -r odoo/requirements.txt
Ignoring freezegun: markers 'python_version < "3.8"' don't match your environment
Ignoring gevent: markers 'python_version == "3.7"' don't match your environment
Ignoring greenlet: markers 'python_version == "3.7"' don't match your environment
Ignoring Jinja2: markers 'python_version < "3.8"' don't match your environment
Ignoring lxml: markers 'sys_platform != "win32" and python_version == "3.7"' don't match your environment
Ignoring lxml: markers 'sys_platform == "win32"' don't match your environment
Ignoring psycopg2: markers 'sys_platform != "win32" and python_version < "3.8"' don't match your environment
Ignoring pypiwin32: markers 'sys_platform == "win32"' don't match your environment
Ignoring xlrd: markers 'python_version < "3.8"' don't match your environment
Collecting Babel==2.6.0
  Downloading Babel-2.6.0-py2.py3-none-any.whl (8.1 MB)
     |████████████████████████████████| 8.1 MB 315 kB/s 
Collecting chardet==3.0.4
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 3.3 MB/s 
Collecting decorator==4.4.2
  Downloading decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
Collecting docutils==0.16
  Downloading docutils-0.16-py2.py3-none-any.whl (548 kB)
     |████████████████████████████████| 548 kB 233 kB/s 
. . .
Successfully installed Babel-2.6.0 Jinja2-2.11.2 MarkupSafe-1.1.0 Pillow-8.1.2 PyPDF2-1.26.0 Werkzeug-0.16.1 XlsxWriter-1.1.2 appdirs-1.4.4 attrs-21.4.0 beautifulsoup4-4.10.0 cached-property-1.5.2 certifi-2021.10.8 cffi-1.15.0 chardet-3.0.4 cryptography-36.0.1 decorator-4.4.2 defusedxml-0.7.1 docutils-0.16 ebaysdk-2.1.5 freezegun-0.3.15 gevent-20.9.0 greenlet-0.4.17 html2text-2020.1.16 idna-2.8 isodate-0.6.1 libsass-0.18.0 lxml-4.6.1 num2words-0.5.6 ofxparse-0.19 passlib-1.7.2 polib-1.1.0 psutil-5.6.6 psycopg2-2.8.6 pyasn1-0.4.8 pyasn1-modules-0.2.8 pycparser-2.21 pydot-1.4.1 pyopenssl-19.0.0 pyparsing-3.0.6 pyserial-3.4 python-dateutil-2.7.3 python-ldap-3.2.0 python-stdnum-1.13 pytz-2019.3 pyusb-1.0.2 qrcode-6.1 reportlab-3.5.59 requests-2.22.0 requests-toolbelt-0.9.1 six-1.16.0 soupsieve-2.3.1 urllib3-1.25.11 vobject-0.9.6.1 xlrd-1.2.0 xlwt-1.3.0 zeep-3.4.0 zope.event-4.5.0 zope.interface-5.4.0

After installation was completed, then we will install adds on package, for Odoo 15 additional setup and configuration. For this purpose we have to deactivate the environment.

$ deactivate
$ mkdir /opt/odoo15/odoo-custom-addons

Output :

(odoo-digi) odoo15@worker2:~$ deactivate
odoo15@worker2:~$ mkdir /opt/odoo15/odoo-custom-addons
odoo15@worker2:~$ exit
logout

6.3. Create Odoo 15 configuration file

The Odoo 15 configuration file will be located at /etc/odoo15.conf.

$ sudo vi /etc/odoo15.conf
[sudo] password for rapik: 

[options]
 admin_passwd = otod1g1net_oke
 db_host = False
 db_port = False
 db_user = odoo15
 db_password = False
 addons_path = /opt/odoo15/odoo/addons, /opt/odoo15/odoo-custom-addons
~  

6.4. Creating Systemd Unit File

At this point, we will create Odoo 15 systemd unit file. By creating this file, we will manage the Odoo 15 service. The file will located at /etc/systemd/system/odoo15_digi.service (naming will be depend on you).

$ sudo vi /etc/systemd/system/odoo15_digi.service

Output :

rapik@worker2:~$ sudo vi /etc/systemd/system/odoo15_digi.service

[Unit]
Description=Odoo15_Digi
Requires=postgresql.service
After=network.target postgresql.service

[Service]
Type=simple
SyslogIdentifier=odoo15
PermissionsStartOnly=true
User=odoo15
Group=odoo15
ExecStart=/opt/odoo15/odoo-digi/bin/python3 /opt/odoo15/odoo/odoo-bin -c /etc/odoo15.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target
~  

After all are set, then we will notify systemd if a new unit file has already exist, by subumitting command line :

$ sudo systemctl daemon-reload
$ sudo systemctl enable --now odoo15_digi

Then we will verify if our Odoo 15 sevices has already running on the system by submitting command line:

$ sudo systemctl status odoo15_digi

Output :

rapik@worker2:~$ sudo systemctl daemon-reload
rapik@worker2:~$ sudo systemctl enable --now odoo15_digi
rapik@worker2:~$ sudo systemctl status odoo15_digi
● odoo15_digi.service - Odoo15_Digi
     Loaded: loaded (/etc/systemd/system/odoo15_digi.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-01-04 18:45:24 PST; 4s ago
   Main PID: 17241 (python3)
      Tasks: 4 (limit: 8782)
     Memory: 66.3M
     CGroup: /system.slice/odoo15_digi.service
             └─17241 /opt/odoo15/odoo-digi/bin/python3 /opt/odoo15/odoo/odoo-bin -c /etc/odoo15.conf

Jan 04 18:45:24 worker2.otodiginet.com systemd[1]: Started Odoo15_Digi.
Jan 04 18:45:25 worker2.otodiginet.com odoo15[17241]: 2022-01-05 02:45:25,581 17241 INFO ? odoo: Odoo version 15.0
Jan 04 18:45:25 worker2.otodiginet.com odoo15[17241]: 2022-01-05 02:45:25,582 17241 INFO ? odoo: Using configurati>
Jan 04 18:45:25 worker2.otodiginet.com odoo15[17241]: 2022-01-05 02:45:25,582 17241 INFO ? odoo: addons paths: ['/>
Jan 04 18:45:25 worker2.otodiginet.com odoo15[17241]: 2022-01-05 02:45:25,582 17241 INFO ? odoo: database: odoo15@>
Jan 04 18:45:25 worker2.otodiginet.com odoo15[17241]: 2022-01-05 02:45:25,777 17241 INFO ? odoo.addons.base.models>
Jan 04 18:45:25 worker2.otodiginet.com odoo15[17241]: 2022-01-05 02:45:25,995 17241 INFO ? odoo.service.server: HT>

We should verify the messages logged by the Odoo service using the command line.

$ sudo journalctl -u odoo15

Output :

rapik@worker2:~$ sudo journalctl -u odoo15
-- Logs begin at Wed 2021-10-20 21:54:17 PDT, end at Tue 2022-01-04 18:46:27 PST. --
-- No entries --

7. Accessing Odoo 15 Installation

Until this stage, we have reached if the Odoo 15 installation was successfull. Then we will test the installation by accessing Odoo 15 application via web interface. The Odoo 15 application can be accessed via web browser at the URL : http://<domainname_or_IP_address>:8069.

Odoo 15 first use
Odoo 15 first use
Odoo 15 creating database
Odoo 15 Main Menu
Odoo 15 Main Menu

Conclusion

In this short tutorial, we have learnt how to install Odoo 15 on Ubuntu 20.04 LTS operating system. In the Odoo installation, there are a lot of dependencies with other packages. if you experience failure during Odoo installation, try again by updating the package dependencies. I hope this tutorial will be helpful.

(Visited 247 times, 1 visits today)

You may also like