January 27, 2022
How to install Odoo 15 on Ubuntu 20.04

How To Install Odoo 15 on Ubuntu 20.04

On this tutorial we will learn how to install Odoo version 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. On this tutorial, we will use Odoo Community version, where Odoo Community version is a libre software, licensed under the GNU LGPLv3, while the Enterprise version has proprietary extra features and services.

Installing Odoo 15 On Ubuntu 20.04

On this tutorial, we will use Odoo version 15.0 (the latest stable version) which was released on 22 October 2021. The binary file was hosted on Odoo official GitHub repository. The installation process will consist of several stages, namely:

  1. Prerequisites
    1. Update Ubuntu 20.04 system
    2. Install Prerequisites Tools
  2. Install and Configure PostgreSQL
  3. Install Wkhtmltopdf
  4. Install and Configure Odoo 15
    1. Creating a System User
    2. Clone from GitHub
    3. Install Odoo15
    4. Configure Odoo 15
    5. Creating Systemd Unit File
  5. Testing Odoo 15 Installation

1. Prerequisite

Before starting Odoo 15 Installation, there are prerequisites that must be fulfilled. The prerequisites are as shown below.

1.1. Updating Ubuntu 20.04 System

Before we add new applications or new software to our system, it is better if we update the system first.By updating our Ubuntu system, it will refresh the local list of available packages software to the newer stable version. To update Ubuntu 20.04 LTS repositories, we will use the command line.

$ sudo apt update

1.2. Install Prerequisites Tools

On this section we will install several dependencies tools, such as : Python 3, Git, GCC and other other libraries. To install dependencies applications, we will use the 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 liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev

2. Install and Configure PostgreSQL

Odoo is using PostgreSQL as default database. For this tutorial, we will use PostgreSQL 14. The PostgreSQL 14 installation on Ubuntu 20.04 has been discussed on previous article. At this section we will check if the PostgreSQL 14 service has been running on the system properly by submitting command line .

$ sudo systemctl status postgresql

The output will be as follow :

rapik@worker2:~$ sudo systemctl status postgresql
[sudo] password for rapik: 
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
     Active: active (exited) since Mon 2022-01-10 01:28:48 PST; 1min 6s ago
    Process: 1237 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 1237 (code=exited, status=0/SUCCESS)

Jan 10 01:28:48 worker2.otodiginet.com systemd[1]: Starting PostgreSQL RDBMS...
Jan 10 01:28:48 worker2.otodiginet.com systemd[1]: Finished PostgreSQL RDBMS.

For Odoo 15 application purpose, we will create a new database user called as odoo15, by submitting command line :

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

3. Installing Wkhtmltopdf

Wkhtmltopdf application is used to print PDF reports in Odoo 15. wkhtmltopdf is an open source (LGPLv3) and much effective command-line shell utility that enables user to convert any given HTML (Web Page) to PDF document or an image (jpg, png, etc). The installation of wkhtmltopdf has been discussed on How to Install wkthmltopdf on Ubuntu 20.04 article. To ensure if the wkhtmltopdf application has been installed on the system, we will verify its version, by typing command line :

$ wkhtmltopdf --version

The output will be as follow:

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

4. Install and Configure Odoo 15

After all needed packages are installed, then we will install and configure Odoo 15 community edition. We will install the Odoo version 15 community edition where the binary source is located at the Odoo Official Github website. We will clone it to our system by using a new system user called as odoo1, here are the detailed steps.

4.1. Creating a system user

for the installation of Odoo 15, we need a special user system that can be used for management. We will create a new user with the name odoo15. For this purpose we will type the command line:

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

4.2. Clone Odoo Binary files from GitHub

The next step is to clone Odoo 15 binary file from Odoo official Github website, for this purpose we will us the wget command line as shown below :

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

The output will be as shown below :

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 Odoo 15 Source from Github
Cloning Odoo 15 Source from Github

4.3. Installing Odoo 15 on Ubuntu 20.04

After binary file we will do the installation inside Python virtual environment. We will create new Python virtual environment for Odoo 15 installation, on this tutorial called as odoo-digi and activate it. Here are the series of command line we use:

$ cd /opt/odoo15
$ python3 -m venv odoo-digi 
odoo15@$ source odoo-digi/bin/activate
(odoo-digi) odoo15@$ pip3 install wheel

The output will be as follow :

odoo15@worker2:~$ cd /opt/odoo15
odoo15@worker2:~$ python3 -m venv odoo-digi
odoo15@worker2:~$ source odoo-digi/bin/activate
(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 

..

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
Installing Odoo 15 on Ubuntu 20.04
Installing Odoo 15 on Ubuntu 20.04

Until this point, we have successfully installed Odoo 15 on Ubuntu 20.04. We will deactivate environment and make directory for the 3rd party addons

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

4.4. Configuring Odoo 15

At this point, we will configure the Odoo 15 that was installed. Odoo configuration file is locate on the /etc/odoo15.conf. We will make a configuration file by adding some parameters as shown below.

rapik@worker2:~$ 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
Odoo 15 Configuration file
Odoo 15 Configuration file

4.5. Creating Odoo 15 Systemd Unit File

On this step, we will create an Odoo 15 systemd unit file by creating a new file. A unit file is a configuration file that holds information about a service. The configuration file will be located on /etc/systemd/system/odoo15_digi.service. The content of this file is shown below.

$ sudo vi /etc/systemd/system/odoo15_digi.service
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
Odoo 15 systemd unit file
Odoo 15 systemd unit file

On this stage, we will reload and starting Odoo 15 service by submitting series command as shown below.

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

The output will be as shown below.

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>
Odoo 15 service
Odoo 15 service

We will use journalctl to see if the messages logged by the Odoo service.

$ sudo journalctl -u odoo15

5. Testing Odoo 15 Installation

Until this point, the Odoo 15 installaton is completed done. On this section we will test the installation by using web browser. We will hit the http://<your_domain_or_IP_address>:8069.

On this tutorial, we will also use the Demo data to be installed. The front end Odoo 15 will be as shown below.

Odoo 15 front page
Odoo 15 front page

So far, we have successfully installed Odoo 15 accompanied by demo data that can be used as learning material.

Conclusion

The Odoo 15 installation on Ubuntu 20.04 has been completed done successfully. On this tutorial is less of NginX installation and configuration, but as the basic function of Odoo it has been fulfilled. I hope this tutorial will be useful for any one who need it. For more detail about Odoo, will be found on Odoo official website.

Share this article via :

Leave a Reply

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