How to Install Odoo 17 on Ubuntu 24.04

How to Install Odoo 17 on Ubuntu 24.04

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 of it, 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 we also need to install some Python dependencies. Let’s run this command below to install them.

# 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 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.

# /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 PostgreSQL server on our Ubuntu 24.04 system.

# 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.

# apt install wkhtmltopdf

Please note that the wkhtmltopdf from 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 https://wkhtmltopdf.org/downloads.html. 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.11 -m venv odoo17-venv

At this point, we have a new Python virtual environment under 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.

$ 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.

# nano /etc/odoo17.conf

Paste the following content into the file.

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

Replace m0d1fyth15 with something harder and stronger. 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.

# 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.

# systemctl daemon-reload
# systemctl enable --now odoo17

Check if Odoo is starting by running this command:

# systemctl status odoo17

Go open your favourite web browser and navigate to http://YOUR_SERVER_IP_ADDRESS:8069 you will see the default Odoo page

How to Install Odoo 17 on Ubuntu 24.04

When working with an Odoo database, you will be prompted for the master password. The master password is the one in your Odoo configuration file, it is the value of admin_passwd. Make sure to use a strong password for your Odoo master password.

Step 7. Install and Configure Reverse Proxy

To access your Odoo website at http://yourdomain.com instead of http://YOUR_SERVER_IP_ADDRESS:8069, we need to install a web server and configure it as a reverse proxy. There are a lot of benefits, like load balancing, caching, compression, and serving static content when using a reverse proxy. In this step, we are going to install Nginx or Apache. You can choose only one web server, and skip the other option.

Install and Configure Nginx

To use Nginx, we can install it by running this command below:

# apt install nginx

On the Ubuntu 24 server, nginx should be up and running upon installation. Let’s create a new Nginx server block now.

# nano /etc/nginx/conf.d/odoo.conf

Insert the following into that file.

upstream odoo17 {
   server 127.0.0.1:8069;
   }

upstream odoochat {
   server 127.0.0.1:8072;
   }

server {
   listen 80;
   server_name yourdomain.com;

   access_log /var/log/nginx/odoo17.access.log;
   error_log /var/log/nginx/odoo17.error.log;

   proxy_buffers 16 64k;
   proxy_buffer_size 128k;

location / {
   proxy_pass http://odoo17;
   proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
   proxy_redirect off;

   proxy_set_header Host $host;
   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header X-Forwarded-Proto https;
   }

location /longpolling {
   proxy_pass http://odoochat;
   }


location ~* /web/static/ {
   proxy_cache_valid 200 60m;
   proxy_buffering on;
   expires 864000;
   proxy_pass http://odoo17;
   }
}

Replace yourdomain.com with your actual domain name or subdomain name pointing to your server IP address. Then, save the file and exit from the editor.

To apply the changes, we can restart Nginx

# systemctl restart nginx

That’s it. You should be able to access Odoo 17 at http://yourdomain.com now.

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS

Install and Configure Apache

If you prefer Apache to Nginx, or you already have Apache installed on your system, you can follow this step.

# apt install apache2

Once Apache is installed, we can create a new virtual host.

# nano /etc/apache2/sites-enabled/odoo.conf

Insert the following into that odoo.conf file.

<VirtualHost *:80>
ServerName yourdomain.com
ServerAlias www.yourdomain.com

ErrorLog ${APACHE_LOG_DIR}/yourdomain-error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

ProxyRequests Off
<Proxy *>
Order deny,allow
Require all granted
</Proxy>

ProxyPass / http://127.0.0.1:8069/
ProxyPassReverse / http://127.0.0.1:8069/
<Location />
Order allow,deny
Require all granted
</Location>
</VirtualHost>

Make sure to replace yourdomain.com with your actual domain name, then restart Apache.

# systemctl restart apache2

Congratulations! You have followed this article and successfully installed Odoo 17 on your Ubuntu 24.04 server. At this point, you should be able to install various plugins like invoicing, accounting, inventory, and many more based on your business needs.

Of course, you don’t have to install Odoo 17 on Ubuntu 24.04 if you use one of our Odoo VPS Hosting services, in which case you can simply ask our expert Linux admins to install Odoo 17 on Ubuntu 24.04, for you. Our expert administrators are available 24×7 and will take care of your request immediately. Simply log in to the client area then submit a ticket, your Odoo 17 install should be up and running in no time.

PS. If you liked this post, on installing Odoo 17 on Ubuntu 24.04, please share it with your friends on the social networks using the buttons below or simply leave a comment in the comments section. Thanks.

Leave a Comment