How To Install Odoo on Ubuntu 22.04 LTS

Install Odoo on Ubuntu 22.04

In this tutorial, we will show you how to install Odoo on Ubuntu 22.04 LTS. For those of you who didn’t know, Odoo is a popular open-source suite of business management software tools including, for example, CRM, e-commerce, billing, accounting, manufacturing, warehouse, project management, and inventory management. The applications within Odoo are perfectly integrated with each other, allowing you to fully automate your business processes easily. Odoo Community edition is available for Ubuntu for free, but you can switch to the Enterprise edition as needed.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of Odoo on Ubuntu 22.04 (Jammy Jellyfish). You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.

Prerequisites

  • A server running one of the following operating systems: Ubuntu 22.04, 20.04, and any other Debian-based distribution like Linux Mint.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A non-root sudo useror access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Odoo on Ubuntu 22.04 LTS Jammy Jellyfish

Step 1. First, make sure that all your system packages are up-to-date by running the following apt commands in the terminal.

sudo apt update
sudo apt upgrade
sudo apt install python3-pip 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 libssl1.1

Step 2. Installing PostgreSQL.

By default, PostgreSQL is available on Ubuntu 22.04 base repository. Now run the following command below to install the latest version of PostgreSQL to your system:

sudo apt install postgresql postgresql-contrib

Once successfully installed, enable PostgreSQL (to start automatically upon system boot), start, and verify the status using the commands below:

sudo systemctl enable postgresql
sudo systemctl start postgresql
sudo systemctl status postgresql

After successfully installing PostgreSQL we need to create a PostgreSQL user and we will name it Odoo15.

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

Next, create a system user for our Odoo15 instance. To do that run this command:

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

For additional resources on installing PostgreSQL, read the post below:

Step 3. Installing Wkhtmltopdf.

Run the following command below to download Wkhtmltopdf package from Github:

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb

Once the file is downloaded, install it using the following command:

chmod +x wkhtmltox_0.12.6.1-2.jammy_amd64.deb
sudo apt install ./wkhtmltox_0.12.6.1-2.jammy_amd64.deb
ln -s /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf

Verify installation was successful by checking the version:

wkhtmltopdf --version

Step 4. Installing Odoo 15 on Ubuntu 22.04.

First, we change the user “odoo15”:

su - odoo15

Next, clone the Odoo 15 source code from GitHub:

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

After that, create a new Python virtual environment for Odoo:

cd /opt/odoo15
python3 -m venv myodoo15-venv
source myodoo15-venv/bin/activate

Then we will install all the Odoo15 dependencies:

(venv) $ pip3 install wheel
(venv) $ pip3 install -r odoo/requirements.txt

After installing the dependencies we need to deactivate the virtual environment:

(venv) $ deactivate

We’ll create a new directory and a separate directory for custom addons:

mkdir /opt/odoo15/custom-addons

Let us exit to the Odoo15 user:

exit

Then, create the configuration file of our Odoo15:

sudo nano /etc/odoo15.conf

Add the following file:

[options]
; This is the password that allows database operations:
admin_passwd = my-admin-password
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

Step 5. Create Systemd Unit File.

Let us create a systemd unit file:

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

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

[Install]
WantedBy=multi-user.target

Save and close the file, then reload the systemd daemon to apply the changes:

sudo systemctl daemon-reload
sudo systemctl enable --now odoo15
sudo systemctl status odoo15

You can check the messages logged by the Odoo service using the command below:

sudo journalctl -u odoo15

Step 6. Accessing Odoo Web Interface.

Once successfully installed, open your web browser and access the Odoo  Web UI using the URL http://your-IP-address:8069. You will be redirected to the following page:

Install Odoo on Ubuntu 22.04 LTS Jammy Jellyfish

Congratulations! You have successfully installed Odoo. Thanks for using this tutorial for installing Odoo 15 on Ubuntu 22.04 LTS Jammy Jellyfish system. For additional help or useful information, we recommend you check the official Odoo website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!