How to Install Odoo 19 on Ubuntu 24.04

Complete step-by-step guide with virtual environment, PostgreSQL, and Nginx reverse proxy

Published: May 15, 2025 15 min read Difficulty: Intermediate

Odoo is a powerful open-source suite of business applications including CRM, e-commerce, accounting, inventory, project management, and more. This guide will walk you through installing Odoo 19 on Ubuntu 24.04 using a Python virtual environment with PostgreSQL as the database backend and Nginx as a reverse proxy.

📋 Prerequisites:
  • Ubuntu 24.04 server with at least 2GB RAM
  • Python 3.10 or later
  • PostgreSQL 13 or later
  • User with sudo privileges
  • Domain name pointing to your server (for SSL)

1. Installing System Dependencies

First, update your system and install the required packages:

sudo apt update
sudo apt install -y git python3-venv python3-pip build-essential wget python3-dev \
    python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev \
    python3-setuptools libjpeg-dev zlib1g-dev libpq-dev \
    libxslt1-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev \
    liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev

2. Installing Node.js

Ubuntu 24.04 ships with an older Node.js version. Install Node.js 22.x LTS from NodeSource:

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm install -g rtlcss

Verify installations:

python3 --version
node --version
npm --version

3. Creating Odoo System User

For security, create a dedicated system user to run Odoo:

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

4. Installing and Configuring PostgreSQL

Install PostgreSQL and create a database user:

sudo apt install -y postgresql
sudo su - postgres -c "createuser -R -S -D odoo19"
â„šī¸ Note: Odoo will automatically create the database when you access it for the first time.

5. Installing wkhtmltopdf for PDF Reports

Download the official 0.12.6 build for proper PDF header/footer support:

sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb
sudo apt install -y ./wkhtmltox_0.12.6.1-3.jammy_amd64.deb
âš ī¸ Warning: If you encounter dependency issues, run sudo apt --fix-broken install.

6. Installing Odoo 19 Source

Switch to the odoo19 user and clone the repository:

sudo su - odoo19
git clone https://www.github.com/odoo/odoo --depth 1 --branch 19.0 /opt/odoo19/odoo

7. Creating Python Virtual Environment

cd /opt/odoo19
python3 -m venv odoo-venv
source odoo-venv/bin/activate
pip3 install wheel
pip3 install -r odoo/requirements.txt
deactivate
exit
â„šī¸ Note: If you encounter compilation errors, ensure all dependencies from Step 1 are installed.

8. Creating Odoo Configuration File

sudo nano /etc/odoo19.conf

Add the following content (change the admin_passwd to a strong password!):

[options]
admin_passwd = ChangeThisStrongPassword!
db_host = False
db_port = False
db_user = odoo19
db_password = False
addons_path = /opt/odoo19/odoo/addons,/opt/odoo19/odoo-custom-addons

9. Creating Systemd Service

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

Add the following content:

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

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

[Install]
WantedBy=multi-user.target

10. Starting Odoo Service

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

11. Configuring Nginx as Reverse Proxy

Install Nginx and create the configuration file:

sudo apt install -y nginx
sudo nano /etc/nginx/sites-available/odoo.conf

Add this configuration (replace example.com with your domain):

upstream odoo {
    server 127.0.0.1:8069;
}

upstream odoochat {
    server 127.0.0.1:8072;
}

server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com;
    return 301 https://example.com$request_uri;
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    http2 on;
    server_name example.com;

    proxy_read_timeout 720s;
    proxy_connect_timeout 720s;
    proxy_send_timeout 720s;

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

    location / {
        proxy_redirect off;
        proxy_pass http://odoo;
    }

    location /websocket {
        proxy_pass http://odoochat;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

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

    gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
    gzip on;
}

12. Installing SSL Certificate with Let's Encrypt

sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com

13. Enabling Proxy Mode in Odoo

sudo nano /etc/odoo19.conf

Add this line:

proxy_mode = True

Then restart services:

sudo systemctl restart odoo19
sudo systemctl restart nginx

14. Configuring Firewall (Optional but Recommended)

sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw deny 8069/tcp
sudo ufw enable

15. Enabling Multiprocessing for Production

For a system with 4 CPU cores and 8GB RAM, add these settings:

limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 600
limit_time_real = 1200
max_cron_threads = 1
workers = 5

Testing Your Installation

Open your browser and navigate to:

https://yourdomain.com

You should see the Odoo database creation screen!

🎉 Success! Odoo 19 is now installed on your Ubuntu 24.04 server.

Useful Odoo Service Commands

sudo systemctl restart odoo19
sudo systemctl stop odoo19
sudo systemctl start odoo19
sudo journalctl -u odoo19

Upgrading Odoo 19

sudo su - odoo19
cd /opt/odoo19/odoo
git checkout 19.0
git pull
source /opt/odoo19/odoo-venv/bin/activate
pip3 install -r requirements.txt
deactivate
exit
sudo systemctl restart odoo19
📧 Need Help? If you need professional Odoo support or assistance with your installation, contact us on WhatsApp for expert guidance.