Skip to content
Home » My Blog Tutorial » How to Install Odoo 17 on Ubuntu 24.04

How to Install Odoo 17 on Ubuntu 24.04

odoo 17

Odoo, previously recognized as OpenERP, is a collection of open-source business applications. It is a highly utilized open-source enterprise resource planning (ERP) software. Odoo provides a variety of modules that can be installed within a single application, contributing to its current popularity. The most recent version, Odoo 17, introduces supplementary functionalities that enhance its user-friendliness. The latest interface integrates keyboard shortcuts, simplifying the task of selecting records and making multiple selections effortlessly. In this article, we will demonstrate the process of how you can install Odoo 17 on Ubuntu 24.04 servers.

Prerequisites

  • An Ubuntu 24.04 VPS with at least 2GB of RAM
  • SSH root access, or user with sudo privileges.

Step 1. Install Dependencies

At the time of this writing, Odoo 17 does not support Python 3.12. You will see an error when trying to install Odoo using Python 3.12. So, to proceed with this installation, we will use Python 3.11 and also need to install some Python dependencies. Let’s run this command below to install them.

sudo apt install build-essential wget git python3.11-dev python3.11-venv libfreetype-dev libxml2-dev libzip-dev libsasl2-dev node-less libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libldap2-dev libtiff5-dev libopenjp2-7-dev libcap-dev

Step 2. Add System User

There are some methods to install Odoo. Since we are going to install it using a Python virtual environment and will be running under a regular system user, we will create a new system user. Let’s create a new system user now by executing the command below.

sudo /usr/sbin/adduser \
   --system \
   --shell /bin/bash \
   --gecos 'Odoo user' \
   --group \
   --home /opt/odoo17 \
odoo17

That’s it! A new system user named ‘odoo17’ has been added, and its home directory is /opt/odoo17.

Step 3. Install PostgreSQL

For data storage, Odoo only supports PostgreSQL. Let’s execute the command below to install the PostgreSQL server on our Ubuntu 24.04 system.

sudo apt install postgresql

After installing PostgreSQL, create a PostgreSQL user with the same name as the new system user. Run the following command to create a PostgreSQL user:

su - postgres -c "createuser -s odoo17"

It’s done, now we have a system user and a PostgreSQL user with the same name called ‘odoo17’. We can proceed to the next step.

Step 4. Install wkhtmltopdf

Wkhtmltopdf, a command line tool, is available as an open-source solution for converting HTML data into PDF format using Qt webkit. However, since the .DEB package for Ubuntu 24.04 is still not available, we can install the one from the default Ubuntu repository.

sudo apt install wkhtmltopdf

Please note that the wkhtmltopdf from the Ubuntu 24.04 repository is not built against a forked version of Qt, hence some options are not supported. You can check and download once the .DEB package for Ubuntu 24.04 is available at wkhtmltopdf Downloads. Alternatively, you can also download and install the one for Ubuntu 22.04.

Step 5. Install Odoo 17

In the previous step, we added a new system user to install and run Odoo. Let’s switch to the system user ‘odoo17’ to download Odoo files from GitHub and create a new Python environment.

su - odoo17

Next, let’s download Odoo from GitHub

git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 odoo17

Create a Python virtual environment. By using a Python virtual environment, this Odoo installation method enables you to install multiple Odoo versions on your server. Now that Odoo 17 has been downloaded to /opt/odoo/odoo17, it is time to create a Python virtual environment.

python3 -m venv odoo17-venv

At this point, we have a new Python virtual environment under the directory /opt/odoo17/odoo17-venv. We need to activate it first before installing Odoo.

source odoo17-venv/bin/activate

Once invoked, your shell prompt would look like this:

(odoo17-venv) odoo17@ubuntu24:~$

Next, let’s install Odoo

(odoo17-venv) odoo17@ubuntu24:~$ pip3 install wheel setuptools pip --upgrade
(odoo17-venv) odoo17@ubuntu24:~$ pip3 install -r odoo17/requirements.txt

That’s it. Odoo has been installed under the directory /opt/odoo17/odoo17. We can create a new directory to store our custom Odoo add-ons now.

sudo mkdir /opt/odoo17/odoo17/custom-addons

Done, let’s exit from user ‘odoo17’ and create an Odoo configuration file.

exit

The command above should bring you back to the previous user, in this case, root.

sudo nano /etc/odoo17.conf

Paste the following content into the file.

[options]
admin_passwd = superadmin
db_host = False
db_port = False
db_user = odoo17
db_password = False
addons_path = /opt/odoo17/odoo17/addons,/opt/odoo17/odoo17/custom-addons

This will be your Odoo’s master password. Save the file then exit from nano editor.

Step 6. Create Odoo Systemd Unit file

We will need to create a systemd service file to manage the Odoo 17 service. In this step, we will create a systemd unit file, to manage our Odoo installation like starting/stopping/restarting it.

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

Insert the following content into the systemd unit file.

[Unit]
Description=odoo17
Requires=postgresql.service
After=network.target postgresql.service

[Service]
Type=simple
SyslogIdentifier=odoo17
PermissionsStartOnly=true
User=odoo17
Group=odoo17
ExecStart=/opt/odoo17/odoo17-venv/bin/python3 /opt/odoo17/odoo17/odoo-bin -c /etc/odoo17.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

Save the file then exit. And, do not forget to reload systemd service and then run Odoo.

sudo systemctl daemon-reload
sudo systemctl enable --now odoo17

Check if Odoo is starting by running this command:

sudo systemctl status odoo17

Go open your favorite web browser and navigate to http://localhost:8069 you will see the default Odoo page.


Discover more from teguhteja.id

Subscribe to get the latest posts sent to your email.

Optimized by Optimole
WP Twitter Auto Publish Powered By : XYZScripts.com

Discover more from teguhteja.id

Subscribe now to keep reading and get access to the full archive.

Continue reading