This guide explains how to install Odoo 20 Community Edition from source on an Ubuntu or Debian server. You will install Python 3.12, PostgreSQL 16, Odoo's own dependencies, set up a systemd service, and open your new Odoo 20 instance in a browser.
Odoo is one of the most popular open-source business management platforms in the world, combining CRM, sales, inventory, accounting, HR, and website tools into a single system. Odoo 20 is the newest version, and it raised its minimum Python and PostgreSQL requirements, which is the main thing that trips people up when following an older guide.
You do not need to be a Linux expert to follow along. Just work through the commands in order, and by the end you will have a working Odoo 20 environment. The steps apply to any recent Ubuntu or Debian release, and we call out the couple of places where an older release needs one extra command.
Ways to Install Odoo 20
Before diving in, it helps to know that source installation is only one of a few ways to get Odoo 20 running. Here is how they compare:
Odoo's own documentation notes that source installation is particularly convenient for people building or testing custom modules, since it is easy to run alongside other Odoo versions on the same machine β see Odoo's official source-installation docs. That is the approach this guide walks through, step by step.
Odoo 20 System Requirements
Odoo 20 raised its minimum software requirements compared to earlier versions, so check these carefully:
Odoo 20 on Ubuntu 24.04 vs. Ubuntu 22.04
If you searched specifically for Odoo 20 on one of these releases, here is the short version:
Note: Every other step is identical on both releases, and on Debian 11, 12, and 13 as well.
Step-by-Step Odoo 20 Installation
Connect to Your Server
If you are working on a remote server, connect to it over SSH from your local computer:
ssh your_username@your_server_ip
If your server uses a custom SSH port or a private key file, connect like this instead:
ssh -p 2222 your_username@your_server_ip ssh -i /path/to/key.pem your_username@your_server_ip
Once you are logged in, check which distribution and version you are on:
lsb_release -a
Make a note of the Codename value shown, as you will use it again later.
Update the System
Always start with a fully updated system. This avoids errors caused by outdated packages.
sudo apt update sudo apt upgrade -y
Make Sure You Have Python 3.12 or Later
Check the Python version that is currently installed:
python3 --version
If this already shows 3.12 or higher, skip ahead. If it shows an older version, install Python 3.12 alongside your existing Python.
On Ubuntu, install it using the deadsnakes PPA:
sudo apt install -y software-properties-common sudo add-apt-repository -y ppa:deadsnakes/ppa sudo apt update sudo apt install -y python3.12 python3.12-venv python3.12-dev
On Debian, use pyenv to install Python 3.12 without replacing the system Python.
Create a Dedicated System User for Odoo
Running Odoo under its own dedicated system user is safer and keeps your setup organized.
sudo adduser --system --home=/opt/odoo20 --group odoo20
This creates the odoo20 system user with its home directory at /opt/odoo20.
Install PostgreSQL 16 or Newer
Odoo stores all its data in PostgreSQL. Install PostgreSQL using the official PostgreSQL repository:
sudo apt install -y curl ca-certificates postgresql-common sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y sudo apt update sudo apt install -y postgresql postgresql-client
Confirm the installed version:
psql --version
Then create the PostgreSQL role used by Odoo:
sudo -u postgres createuser -d -R -S odoo20
Download the Odoo 20 Source Code
Switch to the Odoo system user and clone the Odoo 20 source code:
sudo su - odoo20 -s /bin/bash cd /opt/odoo20 git clone https://github.com/odoo/odoo.git --branch 20.0 --depth 1 --single-branch .
Once the download finishes, verify that files such as odoo-bin, requirements.txt, and the addons directory are present.
Install Dependencies with Odoo's Setup Script
Odoo provides a setup script that installs the system dependencies required by the source code:
cd /opt/odoo20 sudo ./setup/debinstall.sh
Let the script finish before continuing to the next step.
Install Node.js Tools for the Web Client
Install Node.js and the Less packages required for Odoo's web assets:
sudo apt install -y nodejs npm sudo npm install -g less less-plugin-clean-css
Confirm Node.js is available:
node --version
Set Up a Python Virtual Environment
Create an isolated Python environment for Odoo and install its Python dependencies:
sudo -u odoo20 python3.12 -m venv /opt/odoo20/venv sudo -u odoo20 /opt/odoo20/venv/bin/pip install --upgrade pip wheel sudo -u odoo20 /opt/odoo20/venv/bin/pip install -r /opt/odoo20/requirements.txt
Install wkhtmltopdf
Odoo uses wkhtmltopdf to generate PDF documents such as invoices and quotations. Install the required package and dependencies:
sudo apt install -y xfonts-75dpi wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb sudo dpkg -i wkhtmltox_0.12.6.1-2.jammy_amd64.deb sudo apt install -f -y
Verify that wkhtmltopdf was installed successfully:
wkhtmltopdf --version
Create the Odoo Configuration File
Create the log directory and configuration file:
sudo mkdir -p /var/log/odoo20 sudo chown odoo20: /var/log/odoo20 sudo nano /etc/odoo20.conf
Add the following configuration:
[options] admin_passwd = choose_a_strong_master_password db_host = localhost db_port = 5432 db_user = odoo20 db_password = False addons_path = /opt/odoo20/addons logfile = /var/log/odoo20/odoo20.log xmlrpc_port = 8069
Then secure the configuration file:
sudo chown odoo20: /etc/odoo20.conf sudo chmod 640 /etc/odoo20.conf
Create a Systemd Service
Create a systemd service so Odoo starts automatically and can restart if it stops unexpectedly:
sudo nano /etc/systemd/system/odoo20.service
Add the following service definition:
[Unit] Description=Odoo 20 Requires=postgresql.service After=network.target postgresql.service [Service] Type=simple User=odoo20 Group=odoo20 ExecStart=/opt/odoo20/venv/bin/python3 /opt/odoo20/odoo-bin -c /etc/odoo20.conf Restart=on-failure [Install] WantedBy=multi-user.target
sudo systemctl daemon-reload
Start Odoo and Check Its Status
Start the service, enable it on system boot, and verify that it is running:
sudo systemctl start odoo20 sudo systemctl enable odoo20 sudo systemctl status odoo20
A status of active (running) means Odoo has started successfully.
Open Odoo in Your Browser
Odoo listens on port 8069 by default. Open your browser and visit:
http://your_server_ip:8069
If Odoo is running locally, use http://localhost:8069 instead.
Install the Apps You Need
Once you are inside Odoo, open the Apps menu, search for the applications you need, and click Activate or Install. Odoo will configure the selected application inside your database.
Once these steps are complete, your Odoo 20 environment is ready to use. You can now configure your database, install additional applications, and begin setting up your business workflows.
Common Odoo 20 Installation Errors and How to Fix Them
Ten of the most frequent issues readers run into, and the fastest fix for each.
Check the log file for the exact error message:
sudo tail -n 50 /var/log/odoo20/odoo20.log
You can also watch the systemd journal in real time while restarting the service, which is often the fastest way to catch the problem:
sudo journalctl -u odoo20 -f
This is almost always a module-loading problem rather than a network issue. Check the log file from Step 11's path for a Python traceback, and try starting Odoo with the -u all flag once to force all modules to update:
sudo -u odoo20 /opt/odoo20/venv/bin/python3 /opt/odoo20/odoo-bin -c /etc/odoo20.conf -u all -d your_database_name
Setting Up an Odoo 20 Development Environment
If your goal is to build custom modules rather than just run Odoo, the steps above still apply, with two small additions:
Use an IDE
Use an IDE such as PyCharm or VS Code, and point it at the
odoo-bin
file so you can run and debug Odoo directly from the editor.
Keep Custom Modules Separate
Keep your custom modules in a separate folder, for example
/opt/odoo20/custom-addons,
and add that path to
addons_path
in your configuration file, separated by a comma.
Keeping your custom modules separate from Odoo's source code makes the project easier to maintain and simplifies future upgrades.
Conclusion
You now have Odoo 20 installed, configured as a background service, and ready to use from your browser. From here, you can explore Odoo's apps, connect your own domain and set up SSL for production use, and start customizing modules to fit your business. Take it one step at a time, keep an eye on the log file whenever something looks off, and you will have a stable Odoo 20 environment running smoothly.
How to Install Odoo 20 on Ubuntu: Complete Step-by-Step Setup Guide