Back to blog

9 min readTechnical guide

Installation Guide: Odoo 19 (Community & Enterprise) on Ubuntu 24.04

This guide covers installing Odoo 19 Community and Enterprise from source on Ubuntu 24.04: dependencies, PostgreSQL, systemd service and Nginx with HTTPS.

Installation Guide: Odoo 19 (Community & Enterprise) on Ubuntu 24.04

Prerequisites

  • OS: Ubuntu 24.04
  • Python: Version 3.10 or higher
  • Access: SSH with sudo privileges

System preparation and dependencies

First, make sure your system repositories are up to date and install the necessary dependencies for Python and the database.

Download the sources

Download and extract the Odoo Community and Enterprise source folders to your server.

Install the Python virtual environment

sudo apt install python3-venv

Install PostgreSQL

sudo apt install postgresql postgresql-client

Configure the PostgreSQL user

Create a new postgres user. Replace $USER with your actual system username.

sudo -u postgres createuser -d -R -S $USER

Install development libraries

sudo apt install python3-pip libldap2-dev libpq-dev libsasl2-dev libcairo2-dev pkg-config

Environment setup and installation

Create the virtual environment

Create a virtual environment (venv) in the same directory where the Odoo Community and Enterprise folders are located, then activate it.

python3 -m venv venv
source venv/bin/activate

(Note: Make sure you are inside the active virtual environment for the following steps.)

Install Python prerequisites

Navigate to the community folder and run:

pip install -r requirements.txt
pip install phonenumbers rlPyCairo

Install wkhtmltopdf

Download and install the specific version required for report printing.

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb
sudo dpkg -i wkhtmltox_0.12.6.1-3.jammy_amd64.deb

Note: The above command will fail. Run the next step to fix it:

sudo apt install -f

Verify the installation

Go back to the community path and verify that Odoo is accessible:

python3 -m odoo --version

Initial test launch

Before fully configuring the production service, perform a test launch to set up the database.

Start Odoo manually

Run the following command to point to the Enterprise addons path and initialize the test database.

python3 -m odoo --addons-path=/home/ubuntu/odoo_enterprise/ -d odoo_db_test

Access the Web interface

Open the port in your firewall and access it through your browser.

sudo ufw allow 8069/tcp

Go to: http://<server-ip>:8069 and verify that Odoo starts correctly and the database manager is displayed.

Stop the server

Go back to your terminal and stop Odoo with ctrl+c.

Production configuration

We will now create the permanent configuration file and prepare the system for production.

Create and edit odoo.conf

Create the configuration file:

vim /home/ubuntu/odoo.conf

First, generate a hashed master password. With your venv activated, run:

source /home/ubuntu/venv/bin/activate
python3 -c "from passlib.context import CryptContext; print(CryptContext(['pbkdf2_sha512']).hash('YOUR_PASSWORD_HERE'))"

Replace YOUR_PASSWORD_HERE with your actual master password. This will output something like:

$pbkdf2-sha512$25000$abc123...long_hash_string...

Copy that entire hash and add it to the configuration file below:

[options]
admin_passwd = $pbkdf2-sha512$25000$abc123...the_full_hash...
db_user = ubuntu
db_password = False
db_host = False
db_port = False
addons_path = /home/ubuntu/odoo_enterprise/odoo/addons,/home/ubuntu/odoo_community/odoo/addons
workers = 17
logfile = /home/ubuntu/odoo.log
log_level = debug
http_port = 8069
longpolling_port = 8072
proxy_mode = True

Configuration notes:

  • admin_passwd: The hashed master password you generated above.
  • db_user: Replace ubuntu if the $USER created in step 1.4 is different.
  • addons_path: Adjust if your source folders are located elsewhere.
  • log_level: Can be changed to info once in production.
  • workers: Calculated using echo "workers = $(( $(nproc) * 2 + 1 ))". Adjust this number based on your CPU cores. Decrease if the instance has limited RAM.
  • proxy_mode: Set to True because we will be using Nginx.

Prepare the log file

touch /home/ubuntu/odoo.log

Prepare the startup script

Navigate to the community folder and download odoo-bin.

cd /home/ubuntu/odoo_community
wget https://raw.githubusercontent.com/odoo/odoo/refs/heads/19.0/odoo-bin
chmod +x odoo-bin

Systemd service configuration

Create a system service to manage Odoo automatically.

Create the service file

sudo vim /etc/systemd/system/odoo.service

Paste the service configuration

[Unit]
Description=Odoo 19 Service
Documentation=https://www.odoo.com
# Wait for network and postgres before starting
Requires=postgresql.service
After=network.target postgresql.service

[Service]
# ---------------------------------------------------------
# Run as your user so it can access your home dir & venv
# ---------------------------------------------------------
User=ubuntu
Group=ubuntu

# ---------------------------------------------------------
# PATHS
# ---------------------------------------------------------
# We run from the community folder so relative paths work if needed
WorkingDirectory=/home/ubuntu/odoo_community

# IMPORTANT: Point to your VENV python, then the module, then the config
ExecStart=/home/ubuntu/venv/bin/python3 /home/ubuntu/odoo_community/odoo-bin -c /home/ubuntu/odoo.conf

# ---------------------------------------------------------
# RELIABILITY
# ---------------------------------------------------------
# Restart automatically if it crashes
Restart=always
RestartSec=5s

# Increase open file limit (Critical for 17 workers!)
LimitNOFILE=65535

# standard output is handled by Odoo internal logging,
# but this catches startup errors before Odoo takes over
StandardOutput=journal+console
StandardError=journal+console

[Install]
WantedBy=multi-user.target

Start the service

sudo systemctl daemon-reload
sudo systemctl start odoo

Check the status to make sure it is running, then enable it.

Nginx reverse proxy configuration

Configure Nginx to handle traffic, SSL, and buffering.

Install Nginx

sudo apt install nginx -y

Create the Odoo site configuration

sudo vim /etc/nginx/sites-available/odoo

Paste the Nginx configuration

# Upstream for the main web interface
upstream odoo {
    server 127.0.0.1:8069;
}

# Upstream for LiveChat/Websockets
upstream odoochat {
    server 127.0.0.1:8072;
}

server {
    listen 80;
    server_name erp.tadoo.io;
    # Increase upload size to 100MB
    client_max_body_size 100M;

    # Proxy Headers
    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;

    # Timeouts for long reports
    proxy_read_timeout 720s;
    proxy_connect_timeout 720s;
    proxy_send_timeout 720s;

    # Route Websocket traffic to port 8072
    location /websocket {
        proxy_pass http://odoochat;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

    # Route standard traffic to port 8069
    location / {
        proxy_redirect off;
        proxy_pass http://odoo;
    }

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

Note: Replace erp.tadoo.io with your own domain name.

Enable the site

sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/
sudo rm /etc/nginx/sites-enabled/default
sudo nginx -t
sudo systemctl reload nginx

Security and finalization

Configure SSL (TLS)

Install Certbot and configure SSL for the domain.

sudo apt install certbot python3-certbot-nginx -y

Then run Certbot to obtain and configure the SSL certificate:

sudo certbot --nginx -d erp.tadoo.io

Note: Replace erp.tadoo.io with your own domain name.

You can now access your Odoo instance via https://your-domain.com.

Create the production database

Go to /web/database/manager and create your production database, making sure to set a strong user password.

Lock the database manager

To prevent database switching and hide the manager, edit the configuration file again:

vim /home/ubuntu/odoo.conf

Add these lines:

dbfilter = ^tadoo$
list_db = False

Note: Replace tadoo with the name of your production database.

Apply the changes

sudo systemctl restart odoo

Your Odoo 19 installation is now complete!