This article will guide you through the installation and configuration of Odoo 20 on an Ubuntu 24.04 system. Odoo 20 requires Python 3.12 or newer and PostgreSQL 16 or newer. Ubuntu 24.04 ships Python 3.12 and PostgreSQL 16, so both requirements are met using the standard Ubuntu packages.
Prerequisites
OS: Ubuntu 24.04 with Python 3.12 and PostgreSQL 16
Resources: 2-core CPU & 2GB of RAM minimum, 4GB of RAM recommended for production
Access: SSH connection to the server
Permissions: a user with 'sudo' privileges
Note: you can execute all of the commands below from the root user, but for security purposes, it is recommended that you use a separate user with sudo privileges.
Step 1: Connect to Your Server
Log in to your server over SSH. Replace the IP address with your own.
ssh root@your_server_ip
Step 2: Update the System
sudo apt update && sudo apt upgrade -y
Step 3: Create an Odoo System User
Odoo should never run as root. Create a dedicated system user with its home directory in /opt/odoo20.
sudo useradd -m -d /opt/odoo20 -U -r -s /bin/bash odoo20
Step 4: Install Dependencies
Install Git, the Python build tools, and the development libraries Odoo's Python packages need to compile.
sudo apt install -y git wget python3-dev python3-venv python3-pip build-essential \
libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev libssl-dev \
libffi-dev libjpeg-dev libpq-dev liblcms2-dev libblas-dev
If you will use a right-to-left language such as Arabic or Hebrew, also install rtlcss.
sudo apt install -y npm
sudo npm install -g rtlcss
Step 5: Install and Configure PostgreSQL
Install PostgreSQL from the Ubuntu repositories. On Ubuntu 24.04 this installs PostgreSQL 16.
sudo apt install -y postgresql
psql --version
Create a PostgreSQL user with the same name as the system user. This user can create databases but is not a superuser, which limits the damage if Odoo is ever compromised.
sudo -u postgres createuser -d -R -S odoo20
Step 6: Install wkhtmltopdf
Odoo uses wkhtmltopdf to generate PDF reports such as invoices and quotations. The version in the Ubuntu repositories is not the patched build Odoo needs, so install the official package instead.
cd /tmp
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 -y ./wkhtmltox_0.12.6.1-2.jammy_amd64.deb
Verify the installation. The output should include "with patched qt".
wkhtmltopdf --version
Step 7: Install Odoo 20
Download the Odoo 20 source code from GitHub as the odoo20 user.
sudo -u odoo20 git clone https://github.com/odoo/odoo --depth 1 --branch 20.0 --single-branch /opt/odoo20/odoo
Create a Python virtual environment and install Odoo's Python requirements into it. This step can take several minutes.
sudo -u odoo20 python3 -m venv /opt/odoo20/venv
sudo -u odoo20 /opt/odoo20/venv/bin/pip install wheel
sudo -u odoo20 /opt/odoo20/venv/bin/pip install -r /opt/odoo20/odoo/requirements.txt
Step 8: Create a Custom Addons Directory
Keep third-party and custom modules separate from the core Odoo code so updates do not overwrite them.
sudo -u odoo20 mkdir /opt/odoo20/custom-addons
Step 9: Create the Configuration File
Create the Odoo configuration file. Replace ChangeThisMasterPassword with a strong password. This is the master password used to create, back up, and delete databases.
sudo tee /etc/odoo20.conf > /dev/null <<'EOF'
[options]
admin_passwd = ChangeThisMasterPassword
db_host = False
db_port = False
db_user = odoo20
db_password = False
addons_path = /opt/odoo20/odoo/addons,/opt/odoo20/custom-addons
logfile = /var/log/odoo20/odoo20.log
http_port = 8069
EOF
Lock down the configuration file and create the log directory.
sudo chown odoo20: /etc/odoo20.conf
sudo chmod 640 /etc/odoo20.conf
sudo mkdir -p /var/log/odoo20
sudo chown odoo20: /var/log/odoo20
Step 10: Create a Systemd Service
Create a service file so Odoo starts automatically at boot.
sudo tee /etc/systemd/system/odoo20.service > /dev/null <<'EOF'
[Unit]
Description=Odoo 20
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo20
User=odoo20
Group=odoo20
ExecStart=/opt/odoo20/venv/bin/python3 /opt/odoo20/odoo/odoo-bin -c /etc/odoo20.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
EOF
Reload systemd, then enable and start Odoo.
sudo systemctl daemon-reload
sudo systemctl enable --now odoo20
sudo systemctl status odoo20
To follow the log while Odoo starts, run the following.
sudo tail -f /var/log/odoo20/odoo20.log
Step 11: Access Odoo
If the UFW firewall is enabled, allow port 8069.
sudo ufw allow 8069/tcp
Open your browser and go to the following address. Replace the IP address with your server's IP or domain.
http://your_server_ip:8069
You will see the Odoo database creation page. Enter the master password you set in Step 9, then create your first database.
Next Steps
For production use, put Odoo behind Nginx with an SSL certificate rather than exposing port 8069 directly. See our guide on How to Setup Odoo with Nginx as a Reverse Proxy in Ubuntu.
If you would rather not manage this yourself, our managed Odoo hosting includes Odoo 20 installation, PostgreSQL tuning, backups, and 24/7 US-based support.


