DevelopmentTutorials

Effortlessly Installing Odoo 15 on Ubuntu 22.04: A Step by Step Guide

Introduction

Odoo is a business management software suite that provides all the basic to advanced tools, and these tools help the users in their billing, accounting, or warehouse management. Other than these, it also contains tools helpful for Human resources, Project Management, and Customer Support. In simple, Odoo is an ERP software that different business organizations around the world use to automate their organizational processes.

In this blog, we will demonstrate the detailed installation method of Odoo 15 on Ubuntu.

How to install Odoo 15 on Ubuntu?

In this section, the installation method of Odoo 15 is described in a step-by-step manner. Let’s start:

Step 1: Installation of PostgreSQL in Ubuntu

To store the data of the organization, we need some database, so it is recommended to use the PostgreSQL database that can be installed on Ubuntu using the command:

$ sudo apt install postgresql -y

Step 2: Create an Odoo system user in Ubuntu

If we use the service of the Odoo in the root user, it will create a risk for other files stored in the computer so for a safe side, we will create an Odoo user:

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

Step 3: Create a PostgreSQL user in Ubuntu

Next step is to create a user for the PostgreSQL, here we are going to create a user with the name of “Odoo 15”, you can use another name as well:

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

Step 4: Installation of wkhtmltopdf in Ubuntu

To generate the reports of the Odoo 15 in pdf, we will use the “wkhtmltopdf” tool that is open source and used to convert HTML pages to the pdf. Download its “.deb” package file via the command:

$ sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb

When the package is downloaded, install it using the command:

$ sudo dpkg -i ./wkhtmltox_0.12.5-1.bionic_amd64.deb

Step 5: Switch to Odoo15 user in Ubuntu

Now, switch to the newly created Ubuntu user “odoo15” using the “su” command:

$ sudo su - odoo15

Step 6: Download Odoo 15 on Ubuntu

To download the Odoo 15, clone its source code from the GitHub in the same directory where the Odoo is downloaded using the command:

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

Step 7: Create Python Virtual Environment on Ubuntu

We will create a Python Virtual Environment for the Odoo 15 by running the command:

$ python3 -m venv odoo-venv

Finally, activate the Python virtual environment:

$ source odoo-venv/bin/activate

Step 8: Install dependencies of Python on Ubuntu

Few dependencies are required inside the virtual environment. The important one is “wheel”; we will use the command to install it:

$ pip3 install wheel

Other dependencies are mentioned in a text file named “requirements.txt” (which is already available in the installed package of Odoo) to install them, run the command:

$ pip3 install -r odoo/requirements.txt

When dependencies are installed, deactivate the python virtual environment using the command:

$ deactivate

Step 9: Add a new directory on Ubuntu

We are supposed to add some third-party addons which will introduce different features, so for them, we will create a new directory using a mkdir command:

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

Once done, switch to the root user using the command:

$ exit

Step 10: Create configuration file

To create and access a configuration file of Odoo 15, use the nano text editor as follows:

$ sudo nano /etc/odoo15.conf

Paste all the text mentioned below in that file:

[options]; This is the password that allows database operations:
admin_passwd = itslinuxfoss
db_host = False
db_port = False
db_user = odoo15
db_password = False
addons_path = /opt/odoo15/odoo/addons,/opt/odoo15/odoo-custom-addons

Note: You can change the password with some other more strong password and then exit the file after saving it.

Step 11: Create a Systemd unit file

To initialize the Odoo 15, we have to create a Systemd Unit file that keeps all the information about the service. So again, open a new text file using the nano text editor in the command as written below:

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

Paste the script mentioned-below in the newly opened file:

[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/odoo-venv/bin/python3 /opt/odoo15/odoo/odoo-bin -c /etc/odoo15.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

Then reload the daemon using the systemctl command:

$ sudo systemctl daemon-reload

Enable the Odoo 15 service using the command:

$ sudo systemctl enable --now odoo15

Then start the Odoo 15 service using the command:

$ sudo systemctl start odoo15

Finally, verify the status of Odoo 15 service using the command:

$ sudo systemctl status odoo15

Step 12: Testing of Odoo 15 on Ubuntu

After the successful installation, we will open the browser and go to the URL of http://localhost:8069:

The Odoo 15 screen validates its installation on Ubuntu.

How to Remove Odoo 15 from Ubuntu

If you are not using Odoo 15 anymore and want to remove it to free space for the new applications, just execute the commands provided below

First, remove the directory of Odoo 15:

$ sudo rm -R /opt/odoo15

Then, remove the configuration files using the command:

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

That’s all from this detailed guide on the installation of Odoo 15 on Ubuntu 22.04.

Conclusion

To install Odoo 15 on Ubuntu, you need to clone the Oddo 15 Git repository in the Home directory, then create a Python virtual environment and install the dependencies; after that, configure the Odoo service on Ubuntu 22.04 by creating its “sytstemd” file. Once all is done, you can access the Odoo 15 environment through its web interface. In this guide, a detailed method is demonstrated which guides you through installing and configuring Odoo 15 on Ubuntu 22.04.

Related Articles

Leave a Reply

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

Back to top button