Odoo is a suite of business management software tools including, for example, CRM, e-commerce, billing, accounting, manufacturing, warehouse, project management, and inventory management. Odoo 14 was release on October 3, 2020.
Ubuntu 22.04 is the latest long term version(LTS) released by Canonical Ltd. the company behind Ubuntu software and related projects.
In this tutorial we will setup Odoo 14 using a virtual environment to isolate our application and avoid conflict within the system level.
Let us start with the installation.
Updating the system
sudo apt update -y && apt upgrade -y
Installing the Dependencies
After updating the system we need to install all the necessary dependencies.
sudo apt install python3-dev nodejs git build-essential node-less npm python3-pip python3-venv python3-wheel python3-setuptools libjpeg-dev libpq-dev liblcms2-dev libwebp-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libpq-dev libldap2-dev libsasl2-dev libxslt1-dev zlib1g-dev libxml2-dev
Installing and configuring the Database
The default backend database of Odoo is PostgreSQL.
Let us install PostgreSQL.
sudo apt install postgresql -y
After the installation we need to create a database user.
sudo su - postgres -c "createuser -s odoo14"
Creating a system user
Let us create a system user for our instance.
sudo useradd -m -d /opt/odoo14 -U -r -s /bin/bash odoo14
Installing wkhtmltopdf
Wkhtmltopdf is a package that converts HTML into PDF format using the Qt WebKit rendering engine. This package is needed for printing PDF reports for sales invoice, sales report and others.
Ubuntu 22.04 has the wkhtmltopdf package on its repositories but this package don’t support header and footer. We will use then the wkhtmltox(wkhtmltopdf) package from Github.
But before we download and install the wkhtmltox package we need to install the libssl1.1 first because wkhtmltox depends on this libssl version.
The libssl version in Ubuntu 22.04 was upgraded to version 3, so we need to add the Ubuntu 21.10 source to force the installation to libssl version 1.
echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list
Update the system.
sudo apt-get update
Install libssl version 1.
sudo apt-get install libssl1.1 -y
Let us download and install wkhtmltox package from Github.
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
chmod +x wkhtmltox_0.12.6-1.focal_amd64.deb
sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb
Create a symlink.
ln -s /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
Check if the installation was successful.
wkhtmltopdf --version
Output:
wkhtmltopdf 0.12.6 (with patched qt)
Odoo 14 installation and configuration
Before we proceed with the installation we need to switch to the Odoo14 user.
su - odoo14
Clone the repository from Github.
git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 /opt/odoo14/odoo
Change the directory to the Odoo14 directory.
cd /opt/odoo14
Create a virtual environment.
python3 -m venv venv
Activate the virtual environment.
source venv/bin/activate
Since the default Python version of ubuntu 22.04 is 3.10 we need to make sure that the Python modules listed in the requirements.txt are compatible with Python 3.10. Let us modify the version of some of the modules in the requirements.txt.
Now open the requirement.txt file using your favorite text editor.
nano /opt/odoo15/odoo/requirements.txt
Modify your current requirements.txt with the highlighted modules.
Babel==2.9.1
chardet==3.0.4
decorator==4.3.0
docutils==0.14
ebaysdk==2.1.5
freezegun==0.3.11; python_version < '3.8'
freezegun==0.3.15; python_version >= '3.8'
gevent==1.1.2 ; sys_platform != 'win32' and python_version < '3.7'
gevent==1.5.0 ; python_version == '3.7'
gevent>=20.9.0 ; python_version >= '3.8'
gevent==1.4.0 ; sys_platform == 'win32' and python_version < '3.7'
greenlet==0.4.10 ; python_version < '3.7'
greenlet==0.4.15 ; python_version == '3.7'
greenlet>=0.4.17 ; python_version > '3.7'
idna==2.6
Jinja2==2.10.1; python_version < '3.8'
# bullseye version, focal patched 2.10
Jinja2==2.11.2; python_version >= '3.8'
libsass==0.17.0
lxml==3.7.1 ; sys_platform != 'win32' and python_version < '3.7'
lxml==4.3.2 ; sys_platform != 'win32' and python_version == '3.7'
lxml==4.6.5 ; sys_platform != 'win32' and python_version > '3.7'
lxml ; sys_platform == 'win32'
Mako==1.0.7
MarkupSafe==1.1.0
num2words==0.5.6
ofxparse==0.19
passlib==1.7.1
Pillow==5.4.1 ; python_version <= '3.7' and sys_platform != 'win32'
Pillow==6.1.0 ; python_version <= '3.7' and sys_platform == 'win32'
Pillow==8.1.1 ; python_version > '3.7'
polib==1.1.0
psutil==5.6.6
psycopg2==2.7.7; sys_platform != 'win32' and python_version < '3.8'
psycopg2==2.8.5; sys_platform == 'win32' or python_version >= '3.8'
pydot==1.4.1
python-ldap==3.1.0; sys_platform != 'win32'
PyPDF2==1.26.0
pyserial==3.4
python-dateutil==2.7.3
pytz==2019.1
pyusb==1.0.2
qrcode==6.1
reportlab==3.5.13; python_version < '3.8'
reportlab==3.5.55; python_version >= '3.8'
requests==2.21.0
zeep==3.2.0
python-stdnum==1.8
vobject==0.9.6.1
Werkzeug==0.16.1
XlsxWriter==1.1.2
xlwt==1.3.*
xlrd==1.1.0; python_version < '3.8'
xlrd==1.2.0; python_version >= '3.8'
pypiwin32 ; sys_platform == 'win32'
After modifying the requirements.txt save the file and exit.
Install the python module wheel.
(venv) $ pip3 install wheel
Install the python modules under requirement.txt.
(venv) pip3 install -r odoo/requirements.txt
Deactivate the virtual environment.
(venv) deactivate
Create a custom addons directory.
mkdir /opt/odoo14/custom-addons
Then exit.
exit
Create a configuration file.
sudo nano /etc/odoo14.conf
Insert the content below.
[options]
; This is the password that allows database operations:
admin_passwd = admin_password
db_host = False
db_port = False
db_user = odoo14
db_password = False
xmlrpc_port = 8069
logfile = /var/log/odoo14/odoo.log
addons_path = /opt/odoo14/odoo/addons,/opt/odoo14/custom-addons
Please change the “admin_password” to your preferred password, then save and close the file.
Now create a log directory.
mkdir /var/log/odoo14
chown odoo14:root /var/log/odoo14
Create a Systemd Service
To easily manage our instance let us create a systemd service.
sudo nano /etc/systemd/system/odoo14.service
Insert the content below.
[Unit]
Description=Odoo14
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo14
PermissionsStartOnly=true
User=odoo14
Group=odoo14
ExecStart=/opt/odoo14/venv/bin/python3 /opt/odoo14/odoo/odoo-bin -c /etc/odoo14.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
Save and close the file and reload the systemd daemon to apply the changes.
sudo systemctl daemon-reload
Enable and start the systemd service.
sudo systemctl enable --now odoo14
Check the status.
systemctl status odoo14
That’s it you should be able to access your instance at http://ipaddress:8069.
If you need reverse proxy you can check our guide on how to configure Odoo with Apache or Nginx as reverse proxy. If you need SSL certificate you can check our article on Let’s Encrypt.
Conclusion
In this tutorial you have learned how to install Odoo 14 on Ubuntu 22.04 and it is very challenging because of compatibility issues but we are able to pull it off. If you like this article you might also like our article on Odoo 14 on Ubuntu 20.04.
If you have questions, feel free to leave a comment and we will try to answer it.
Thank you and hope you enjoy our tutorial ?
THANK YOU … just Thank you !!!