How to Install Odoo 19 on Ubuntu

how to install odoo 19 on ubuntu

In this guide, I’ll walk you step by step through how to install Odoo 19 on Ubuntu, and then show you how to tune it for a responsive, stable production setup. Whether you’re setting up a test server or a production instance, this article will give you everything you need—from dependencies to performance tweaks.

Let’s jump in.

How to Install Odoo 19 on Ubuntu

Prerequisites & Assumptions

Before we start the guide on how to install odoo 19 on Ubuntu, make sure:

  • You have a fresh Ubuntu 24 LTS server (or VM) with SSH access.
  • You’re using a non-root sudo user (or root directly, but sudo is safer).
  • The server has at least 2 CPU cores / 4 GB RAM (higher is better for production).
  • You have basic familiarity with Linux command line, file editing, and services.

Also, make sure your system is up to date before installing anything:

sudo apt update && sudo apt upgrade -y
ShellScript

Step 1: Install Required System Dependencies

Odoo is a Python-based application, but it also depends on many system libraries. To avoid missing libraries, install this large set of dependencies:

sudo apt install -y \
    git wget python3 python3-pip python3-dev python3-venv python3-wheel \
    build-essential libxml2-dev libxslt1-dev libzip-dev libsasl2-dev libldap2-dev \
    libjpeg-dev libfreetype6-dev libtiff-dev libpng-dev libpq-dev libssl-dev libffi-dev \
    nodejs npm rtlcss node-less \
    xfonts-75dpi xfonts-base fontconfig libxrender1 libxcb1-dev
ShellScript

Why these?

  • The libxml2-dev, libxslt1-dev etc. are needed for XML processing, which Odoo uses heavily.
  • libpq-dev is needed to compile Python’s PostgreSQL driver.
  • nodejs and npm are required to generate web assets (CSS, JavaScript).
  • xfonts & fontconfig are needed by wkhtmltopdf (for PDF generation).

Make sure all dependencies are in place before proceeding.

Step 2: Install PostgreSQL & Create Database User

Odoo relies on PostgreSQL as its database engine. Let’s install and configure it:

sudo apt install -y postgresql
sudo systemctl enable postgresql
sudo systemctl start postgresql
ShellScript

Once PostgreSQL is running, create a PostgreSQL user:

sudo -u postgres createuser --createdb --username postgres --no-superuser --no-createrole odoo19
ShellScript

  • createdb: allows the user to create new databases.
  • username postgres: specifies that the PostgreSQL superuser will execute the command.
  • no-createrole: prevents the user from creating additional roles.
  • superuser: grants the user full superuser privileges.

This command makes a user odoo19 who can create databases (but is not a superuser). That’s typically enough; we don’t give it extra privileges for security.

Step 3: Create a System User for Odoo

It’s best practice not to run apps as root. Create a system user that will own and run Odoo:

sudo adduser --system --home=/opt/odoo19 --group --shell=/bin/bash odoo19
ShellScript

This gives you a user odoo19, with a home at /opt/odoo19. You can adjust the path if you prefer. We’ll use this account for installing and running Odoo.

Step 4: Download Odoo 19 Source & Set Up Environment

We’ll install Odoo from its Git repository so you can apply updates, custom modules, etc.

Switch to the odoo19 user:

sudo su - odoo19 -s /bin/bash
cd /opt/odoo19
ShellScript

Clone the Odoo 19 branch:

git clone --depth 1 --branch 19.0 https://github.com/odoo/odoo.git odoo
ShellScript

Now, create a Python virtual environment and install Python dependencies:

cd odoo
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip wheel setuptools
pip install -r requirements.txt
deactivate
ShellScript

This ensures the Odoo environment is isolated and easier to maintain.

Exit back to your sudo user:

exit
ShellScript

Step 5: Install wkhtmltopdf for PDF Reporting

Odoo generates reports (PDFs) using the wkhtmltopdf tool. The recommended version is one with patched Qt support. Here’s how to install it:

cd /tmp
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
sudo dpkg -i wkhtmltox_0.12.6-1.focal_amd64.deb
sudo apt install -f -y
ShellScript

After that, ensure wkhtmltopdf and wkhtmltoimage are accessible:

which wkhtmltopdf
which wkhtmltoimage
ShellScript

If this won’t work, then try to install version 0.12.5:

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

Step 6: Configuration File & Log Directories

Create a log directory and configuration file:

sudo mkdir -p /var/log/odoo19
sudo chown odoo19:odoo19 /var/log/odoo19
ShellScript

Now, create a config file /etc/odoo19.conf (you’ll need sudo to edit):

[options]
admin_passwd = your_master_password_here
db_host = False
db_port = False
db_user = odoo19
db_password = False
logfile = /var/log/odoo19/odoo.log
addons_path = /opt/odoo19/odoo/addons
xmlrpc_port = 8069
; Workers (we’ll adjust later)
; limit_memory_hard = 2684354560
; limit_time_cpu = 1200
; limit_time_real = 2400
ShellScript

Replace your_master_password_here with a strong password; this is your “super-admin” password used in the Odoo UI.

Make sure to set ownership:

sudo chown odoo19:odoo19 /etc/odoo19.conf
sudo chmod 640 /etc/odoo19.conf
ShellScript

Step 7: Systemd Service for Odoo

To manage Odoo as a service (start on boot, restart, etc.), we’ll create a systemd service file:

Create /etc/systemd/system/odoo19.service:

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

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

[Install]
WantedBy=multi-user.target
ShellScript

Then, in the terminal, enable and start:

sudo systemctl daemon-reload
sudo systemctl enable --now odoo19
sudo systemctl status odoo19
ShellScript

You should see the service active (running). Check logs if there are errors:

journalctl -u odoo19 -f
ShellScript

Step 8: Access Odoo via Web Browser

Now, open your browser and point it to:

http://your_server_ip:8069
ShellScript

You should see the Odoo database creation page. Use the master_password one you set in config. Create a new database, install a few apps (Sales, CRM, etc.) to confirm everything is running smoothly.

Step 9: Basic Tuning & Performance Tips

To make Odoo 19 performant and stable, especially under load, here are some tuning tips:

Worker Mode & Concurrency

By default, Odoo runs in single-threaded “non-worker” mode, which is okay for small testing. But for production, enable worker mode in your config:

# In /etc/odoo19.conf
workers = 4
max_cron_threads = 1
limit_time_cpu = 120
limit_time_real = 240
limit_memory_soft = 2147483648  ; ~2 GB
limit_memory_hard = 2684354560  ; ~2.5 GB
ShellScript

Number of workers = roughly (CPU cores × 2) + 1. You can adjust these numbers based on your hardware.

Database Connection Pooling

If your installation serves a large number of users, consider using pgbouncer or other pooling mechanisms to manage PostgreSQL connections more efficiently.

Reverse Proxy & SSL (Nginx)

Use Nginx as a reverse proxy, manage the domain name, and enable SSL:

Install Nginx:

sudo apt install nginx
ShellScript

Create an Nginx config (e.g. /etc/nginx/sites-available/odoo19):

# how to install odoo 19 on ubuntu
upstream odoo {
    server 127.0.0.1:8069;
}

server {
    listen 80;
    server_name example.com;

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

    location / {
        proxy_pass http://odoo;
        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 $scheme;
    }

    # For longpolling (chat, live features)
    location /longpolling {
        proxy_pass http://odoo;
    }

    # static / media, if needed
}
Nginx

Enable site and reload:

sudo ln -s /etc/nginx/sites-available/odoo19 /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
Bash

Use Let’s Encrypt Certbot to secure SSL:

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com
Bash

This ensures your Odoo site is served over HTTPS with proper headers and performance.

PostgreSQL Tuning

Edit PostgreSQL’s postgresql.conf (often under /etc/postgresql/…/main/) and adjust:

  • shared_buffers to ~25% of RAM
  • work_mem moderate (e.g., 16MB)
  • max_connections appropriate (if using pooling)

Restart PostgreSQL after changes:

sudo systemctl restart postgresql
Bash

Log Rotation & Monitoring

Set up logrotate for Odoo logs, and monitor memory / CPU usage using tools like htop, top, or system monitoring (Prometheus, Grafana).

Final Tips & Checklist

  • Always back up your PostgreSQL database and Odoo custom modules.
  • Keep both Ubuntu and Odoo up to date (security patches).
  • Test performance under the expected user load before going into production.
  • Use a staging server before applying updates to production.
  • Limit public access to only necessary ports (e.g., 80, 443) via a firewall (e.g., ufw or iptables).

Related Post:

>> Guide for Odoo PostgreSQL Performance Tuning

>> What is Odoo Runbot and How to Access It?

>> How to Install Odoo 17 on Windows

Conclusion on How to Install Odoo 19 on Ubuntu

Setting up Odoo 19 on Ubuntu 24 LTS might seem challenging at first, but with the right steps and a little attention to detail, you can easily get a fully functional Odoo environment up and running. By installing essential dependencies, configuring PostgreSQL, setting up a dedicated Odoo user, and fine-tuning your server performance, you ensure your ERP system runs efficiently and securely.

Ubuntu 24 LTS provides an incredibly stable and reliable foundation for Odoo, making it ideal for both development and production environments. With proper system tuning, such as enabling worker optimization, caching, and using Nginx as a reverse proxy, your Odoo 19 instance can handle even heavy workloads smoothly.

Whether you’re an Odoo developer, system administrator, or a business owner deploying ERP for the first time, following this guide on How to Install Odoo 19 on Ubuntu 24 LTS gives you the perfect roadmap for a successful installation.

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.