Ubuntu

How to Install Odoo 15 on Ubuntu 22.04

Odoo 15 is a web-based business application package that can be operated from a single console. Warehouse Management, Open Source CRM, Billing & Accounting, eCommerce, Website Builder, Human Resources, Project Management, Manufacturing, Purchase Management, Point of Sale, and Marketing are just a few of the business apps offered on Odoo 15.

This blog will demonstrate the procedure of installing Odoo 15 on Ubuntu 22.04. Let’s get started.

How to install Odoo 15 on Ubuntu 22.04

For the purpose of installing Odoo 15 on Ubuntu 22.04, follow the given instructions.

Step 1: Update system packages
First of all, hit “CTRL+ALT+T” and update the system packages:

$ sudo apt update

All packages are updated:

Step 2: Install dependencies
In the next step, run the provided command for the installation of essential dependencies:

$ sudo apt install python3-pip wget python3-dev python3-venv python3-wheel libxml2-dev libpq-dev libjpeg8-dev liblcms2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential git libssl-dev libffi-dev libmysqlclient-dev libjpeg-dev libblas-dev libatlas-base-dev -y

Wait for some minutes to let the installation complete:

After installing the mentioned packages, we will move ahead to install the database.

Step 3: PostgreSQL installation
PostgreSQL is utilized by the Odoo 15 users as backend database:

$ sudo apt install postgresql -y

Step 4: Create PostgreSQL user

Write out the provided command for creating PostgreSQL user named “odoo15”:

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

odoo15” user will be created within a few mini seconds:

Step 5: Create Odoo 15 system user
We will now create Odoo 15 system user:

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

After creating the system user, move ahead to the next step.

Step 6: Install libssl1.1
Next, install the libssl1.1 on your system. To do so, firstly, add the “impish-security-main” to the source list:

$ echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list

Then, install the “libssl1.1” package with the help of the given command:

$ sudo apt-get install libssl1.1 -y

Step 7: Download and install wkhtmltox
Next download the “wkhtmltox” package that comprises “wkhtmltopdf” tool used for rendering HTML into pdf:

$ wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb

Make the downloaded “wkhtmltox” deb package executable:

$ sudo chmod +x wkhtmltox_0.12.6-1.focal_amd64.deb

Install “wkhtmltox” by executing the following command in Ubuntu 22.04 terminal:

$ sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb

Step 8: Create symlink
Create a symlink for “wkhtmltox”:

$ sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf

Step 9: Check wkhtmltox version

Lastly, verify if the “wkhtmltox” installation is successful by checking its version:

$ wkhtmltopdf --version

Step 10: Switch to odoo15 user
Switch to odoo15 user using the “su” command:

$ su - odoo15

Step 11: Download Odoo 15
For the purpose of downloading Odoo15, type the below-given command in Ubuntu 22.04 terminal:

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

Step 12: Move to odoo directory
Move to the “/opt/odoo” directory:

$ cd /opt/odoo15

Step 13: Create and activate virtual environment
Next, create a virtual environment “myodoo15-venv”:

$ python3 -m venv myodoo15-venv

Then, activate the created “myodoo15-venv” virtual environment:

$ source myodoo15-venv/bin/activate

Step 14: Wheel installation
Before installing Odoo 15 dependencies, it is essential to have python module named “wheel” on your system:

$ pip3 install wheel

Step 15: Install python modules
This step is about the installation of dependencies that are specified in the “odoo/requirements.txt” document:

$ pip3 install -r odoo/requirements.txt

Then deactivate the created environment.

Step 16: Deactivate virtual environment
Deactivate the “myodoo15-venv” virtual environment after installing the required Odoo 15 dependencies:

$ deactivate

Step 15: Make directory for custom addons
We will now execute the provided command for creating a directory for custom addons:

$ mkdir /opt/odoo15/custom-addons

Step 16: Logout as Odoo15 user
Next, log out as Odoo15 user using terminal:

$ exit

Step 17: Create Odoo15 configuration file
Open “nano” editor for creating “odoo15.conf” file:

$ sudo nano /etc/odoo15.conf

Add the following lines while specifying the “admin_passwd” according to your preferences and hit “CTRL+O” to save the content of Odoo 15 configuration file:

[options]
admin_passwd = linuxhint
db_host = False
db_port = False
db_user = odoo15
db_password = False
xmlrpc_port = 8069
logfile = /var/log/odoo15/odoo.log
addons_path = /opt/odoo15/odoo/addons,/opt/odoo15/custom-addons

After doing so, make a log directory.

Step 18: Make log directory
Utilize the below-given command for creating a log directory:

$ sudo mkdir /var/log/odoo15

Then, specify “odoo15” as the owner of the created log directory:

$ sudo chown odoo15:root /var/log/odoo15

Step 19: Create Odoo15 service
In the next step, we will create a Odoo 15 systemd unit file using the “nano” editor:

$ sudo nano /etc/systemd/system/odoo15.service

Add the following lines in the opened file, specify user and group in the “Service” section, and hit “CTRL+O” to save the added content:

[Unit]

Description=Odoo15
Requires=postgresql.service
After=network.target postgresql.service

[Service]
Type=simple
SyslogIdentifier=odoo15
PermissionsStartOnly=true
User=odoo15
Group=odoo15
ExecStart=/opt/odoo15/myodoo15-venv/bin/python3 /opt/odoo15/odoo/odoo-bin -c >
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

Save the added content and move to the next step.

Step 20: Reload systemd daemon
After making the required changes, reload the systemd daemon:

$ sudo systemctl daemon-reload

Step 21: Enable Odoo15 service
Next, enable the Odoo15 service with the help of the following command:

$ sudo systemctl enable --now odoo15

Step 22: Check Odoo15 status
After enabling the Odoo15 service, check if it is running on your Ubuntu 22.04 system or not:

$ sudo systemctl status odoo15

The given output indicates that odoo15 is currently active:

Step 23: Access Odoo15 on Browser

In order to access Odoo15, browse http://localhost:8069/ on your favorite browser:

How to remove Odoo15 from Ubuntu 22.04

In order to remove Odoo15 from Ubuntu 22.04, firstly remove the “/opt/odoo15” directory:

$ sudo rm -R /opt/odoo15

Then, execute the below-given command to remove the Odoo 15 server configuration file “odoo15-server.conf”:

$ sudo rm -f /etc/odoo15-server.conf

In the next step, remove the Odoo15 configuration file “odoo15.conf” that is utilized for configuring the database:

$ sudo rm -f /etc/odoo15.conf

Lastly, remove the “/etc/init.d/odoo15-server” directory that assists in starting Odoo15 service at system boot:

$ sudo rm -f /etc/init.d/odoo15-server

We have compiled the easiest method to install Odoo 15 on Ubuntu 22.04.

Conclusion

To install Odoo 15 on Ubuntu 22.04, firstly, install the required dependencies. Then, install and configure PostgreSQL Database, create a system user, and install wkhtmltox package. After that, install, configure Odoo15 and its dependencies, and access it on http://localhost:8069/ browser. This blog demonstrated the method of installing Odoo 15 on Ubuntu 22.04.

About the author

Sharqa Hameed

I am a Linux enthusiast, I love to read Every Linux blog on the internet. I hold masters degree in computer science and am passionate about learning and teaching.