Odoo 19: Complete Installation Guide for Ubuntu 24.04 (Community & Enterprise)
Introduction
Deploying an ERP system often seems like a complex task, but the right architecture turns the process into a clear algorithm. In this guide, we will cover how to set up Odoo 19 on a fresh Ubuntu 24.04 using the source installation method within an isolated virtual environment.
The primary highlight of this method is its versatility. We establish a folder and permission structure that allows you to run the free Community version while maintaining the ability to instantly upgrade to Enterprise by simply adding modules to the addons folder. No manual hacks – just a clean Python venv workflow and automatic SSL via Caddy.
Technical Stack (Verified):
- OS: Ubuntu 24.04 LTS
- Environment: Python 3.12 (Virtual Environment)
- Web Server: Caddy (Automatic HTTPS and Proxying)
- Database: PostgreSQL 16.11
- VM Specs: 2 vCPU, 4 GB RAM, 40 GB NVMe
Generally, this guide works with various versions of supporting software. The critical component is the Ubuntu 24.04 LTS distribution.
Step 1: System Preparation
Update the system:
sudo apt update && sudo apt upgrade -y
Install the required packages:
sudo apt install -y git python3-pip python3-dev python3-venv \ libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev \ libldap2-dev build-essential libssl-dev libffi-dev \ libmysqlclient-dev libjpeg-dev libpq-dev libjpeg8-dev \ liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev \ libxcb1-dev nodejs npm
Step 2: Database (PostgreSQL)
Install PostgreSQL and create a database user:
sudo apt install -y postgresql # Create the DB user sudo -u postgres createuser -s odoo19
Step 3: System User and Source Code
Create the odoo19 user and download the 19.0 branch:
sudo useradd -m -d /opt/odoo19 -U -r -s /bin/bash odoo19 sudo su - odoo19
git clone https://www.github.com/odoo/odoo --depth 1 --branch 19.0 /opt/odoo19/odoo
Step 4: Virtual Environment (Required for 24.04)
While still in the odoo19 user session:
python3 -m venv odoo-venv source odoo-venv/bin/activate pip install --upgrade pip pip install wheel phonenumbers pip install -r /opt/odoo19/odoo/requirements.txt
Exit the odoo19 session:
exit
Step 5: PDF Generator (wkhtmltopdf)
For Ubuntu 24.04, it is recommended to use the package from the Jammy (22.04) version or download the current binary, as the default repositories may lack QT support.
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb sudo apt install ./wkhtmltox_0.12.6.1-2.jammy_amd64.deb -y
Step 6: Configuration
Create a configuration file and set a strong admin_passwd. You will need this for the first login and database initialization:
sudo nano /etc/odoo19.conf
Insert the following configuration:
[options] admin_passwd = YOUR_SUPER_PASSWORD db_host = False db_port = False db_user = odoo19 db_password = False addons_path = /opt/odoo19/odoo/addons logfile = /var/log/odoo/odoo19.log proxy_mode = True
Set permissions:
# Create log directory and empty log file sudo mkdir /var/log/odoo # Transfer ownership to odoo19 user sudo chown odoo19:odoo19 /var/log/odoo sudo chown odoo19:odoo19 /etc/odoo19.conf # Restrict access to the config (owner and group only) sudo chmod 640 /etc/odoo19.conf
Step 7: Automation (Systemd)
Create the service file:
sudo nano /etc/systemd/system/odoo19.service
Insert the following configuration:
[Unit] Description=Odoo 19 After=network.target postgresql.service [Service] Type=simple 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
Start the service:
sudo systemctl daemon-reload sudo systemctl enable --now odoo19
Step 8: Reverse Proxy Setup – Caddy
Install the official Caddy repository for Ubuntu
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list sudo apt update sudo apt install caddy -y
Configuring Odoo for Reverse Proxy
Ensure proxy_mode = True is in your /etc/odoo19.conf (as done in Step 6), then restart Odoo:
sudo nano /etc/odoo19.conf
sudo systemctl restart odoo19
Configure the Caddyfile
sudo nano /etc/caddy/Caddyfile
Insert the following block:
# Replace :80 with YOUR_DOMAIN for automatic SSL :80 { request_body { max_size 300MB } # Longpolling reverse_proxy /longpolling/* localhost:8072 # Main traffic reverse_proxy localhost:8069 { header_up X-Forwarded-Host {host} header_up X-Forwarded-Proto {scheme} header_up X-Real-IP {remote_host} } }
Validate and restart Caddy:
sudo caddy validate --config /etc/caddy/Caddyfile
sudo systemctl restart caddy
Step 9: Initial Login
Navigate to:
- Via IP: http://YOUR_SERVER_IP
- Via Domain: https://YOUR_DOMAIN (if configured in Caddy)
Complete the database creation form:
- Master Password: Use the password created in Step 6.
- Database Name: e.g., mycompany.
- Email: Your login email.
- Password: Your system access password.
- Language & Country: Select as appropriate.
- Demo Data: Leave unchecked for a clean production database.
Click Create database and wait (1-2 minutes).

Domain Name Configuration
To enable automatic SSL via Let's Encrypt:
Step 1. Set DNS: Point an A-record from YOUR_DOMAIN to your server IP.
Step 2. Edit Caddyfile: Replace :80 with YOUR_DOMAIN.
Step 3. Restart Caddy:
sudo systemctl restart caddy
Caddy will automatically provision the SSL certificate. Access Odoo at https://YOUR_DOMAIN.