Skip to content
DevMarket
Odoo ModulesWordPress PluginsWordPress ThemesShopify ThemesApp TemplatesScripts & UtilitiesBlogSell on DevMarket
Odoo guides

Install Odoo on Ubuntu: A Safe Step-by-Step Guide for Odoo 19.0

A step-by-step guide to install Odoo 19.0 on Ubuntu 24.04 LTS from source, safely: no root, a dedicated PostgreSQL role, a strong master password, systemd, a reverse proxy with HTTPS and backups.

By DevMarket EditorialPublished: 8 min read
Install Odoo on Ubuntu: A Safe Step-by-Step Guide for Odoo 19.0
On this page

To install Odoo on Ubuntu from source, you install PostgreSQL and a few system packages, create a dedicated odoo system user and a matching PostgreSQL role, clone the Odoo 19.0 branch, install its Python requirements in a virtual environment, write a configuration file with a strong master password, and run Odoo as a systemd service. This guide follows Odoo's official 19.0 documentation and keeps the server safe: Odoo never runs as root, and it sits behind a reverse proxy with HTTPS.

In short

  • Odoo 19.0 needs Python 3.10 or later and PostgreSQL 13 or later. Ubuntu 24.04 LTS provides Python 3.12 and PostgreSQL 16.
  • Use a dedicated odoo user and a PostgreSQL role that is not a superuser. Never run Odoo as root.
  • Listen on 127.0.0.1 only, put nginx or another reverse proxy with HTTPS in front, and open only SSH, HTTP and HTTPS in the firewall.
  • Set a long random admin_passwd, create your database once, then switch the database manager off.
  • Install wkhtmltopdf 0.12.6 for PDF reports, and rtlcss if you use Arabic.

Before you start: versions and requirements

Odoo's documentation for the 19.0 packaged installer names Ubuntu 24.04 LTS (Noble) as the supported Ubuntu release, so this guide uses it. Ubuntu 26.04 LTS was released in April 2026 with newer Python and PostgreSQL versions. Odoo's 19.0 requirements file already lists packages for it, but the documentation still names 24.04, so check the docs before using 26.04 in production.

Odoo 20.0 was released in September 2026, and its documentation raises the minimums to Python 3.12 and PostgreSQL 16, which Ubuntu 24.04 meets. To install 20.0 instead, replace 19.0 with 20.0 in the clone command and read the 20.0 documentation first. If you rely on third-party modules, check that they support the version you choose.

A row of cards joined by arrows from left to right
Install in this order: packages, users, code, configuration, service, and only then HTTPS and backups.

Step 1: install the system packages

Run these as a normal user with sudo rights. The PostgreSQL and library packages come from Odoo's source-install page. Git, a compiler, Python headers and the venv module are added because the requirements build from source. fonts-noto-core is one of the font packages that Odoo's own Debian package accepts for multilingual text.

sudo apt update
sudo apt install -y git build-essential python3-dev python3-pip python3-venv libldap2-dev libpq-dev libsasl2-dev postgresql postgresql-client fonts-noto-core

wkhtmltopdf for PDF reports

Odoo prints invoices and other PDFs with wkhtmltopdf. The documentation requires version 0.12.6 with patched Qt for headers and footers, and Ubuntu's own package is not that build. The wkhtmltopdf release page has no Ubuntu 24.04 build. The Ubuntu 22.04 (jammy) build is the nearest and is widely used on 24.04, but Odoo does not document that combination, so print a test invoice afterwards. Use the arm64 file name on ARM servers.

cd /tmp
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
wkhtmltopdf --version

The Odoo wiki page on wkhtmltopdf explains the versions.

rtlcss for Arabic

Odoo's documentation says right-to-left languages such as Arabic need the rtlcss package, which comes from npm.

sudo apt install -y nodejs npm
sudo npm install -g rtlcss

Step 2: create the odoo user and the PostgreSQL role

Odoo refuses to connect to PostgreSQL as postgres, so it needs its own role. When the role has the same name as the Linux user that runs Odoo, PostgreSQL authenticates it through the local socket without a password. The -d flag lets the role create databases, and -R and -S deny it role creation and superuser rights.

sudo adduser --system --group --home /opt/odoo --shell /usr/sbin/nologin odoo
sudo -u postgres createuser -d -R -S odoo
sudo install -d -o odoo -g odoo -m 750 /opt/odoo /opt/odoo/custom-addons /var/lib/odoo /var/log/odoo /etc/odoo

Step 3: download Odoo and install the Python packages

Odoo's documentation prefers distribution packages through setup/debinstall.sh and treats pip as the alternative, with a warning. This guide uses a virtual environment, which the documentation mentions for keeping Odoo's packages apart from the system's, and which Ubuntu 24.04 effectively requires because it blocks system-wide pip installs. Open a shell as the odoo user.

cd /tmp
sudo -u odoo -H bash

Inside that shell, clone the 19.0 branch and install the requirements. Both steps take a few minutes. Type exit when they finish.

cd /opt/odoo
git clone --branch 19.0 --single-branch https://github.com/odoo/odoo.git
python3 -m venv venv
venv/bin/pip install -r odoo/requirements.txt

Step 4: write the configuration file

Generate a long random value for the master password, which protects the database manager.

python3 -c 'import secrets; print(secrets.token_urlsafe(24))'

Create the file with sudo nano /etc/odoo/odoo.conf and paste in the following, replacing the first value with the one you generated.

[options]
admin_passwd = PASTE-THE-GENERATED-VALUE-HERE
db_user = odoo
addons_path = /opt/odoo/odoo/addons,/opt/odoo/custom-addons
data_dir = /var/lib/odoo
logfile = /var/log/odoo/odoo-server.log
http_interface = 127.0.0.1
http_port = 8069

Then run sudo chown odoo:odoo /etc/odoo/odoo.conf and sudo chmod 640 /etc/odoo/odoo.conf. Odoo may rewrite this file, for example when the master password is changed, so the odoo user must own it. The db_user line matches the role from step 2, and no database password is needed over the socket. The http_interface line keeps Odoo reachable from the server itself only. Do not add proxy_mode yet: Odoo's documentation says to enable it only behind a reverse proxy.

Step 5: run Odoo as a systemd service

Create /etc/systemd/system/odoo.service with sudo nano. It is modelled on the unit in Odoo's own Debian package, adjusted for the virtual environment.

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

[Service]
Type=simple
User=odoo
Group=odoo
ExecStart=/opt/odoo/venv/bin/python /opt/odoo/odoo/odoo-bin --config /etc/odoo/odoo.conf
KillMode=mixed
Restart=on-failure

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now odoo
sudo systemctl status odoo --no-pager
sudo tail -n 30 /var/log/odoo/odoo-server.log

The log should include a line saying the HTTP service is running on 127.0.0.1:8069. This file is the first place to look when something fails, and standard log rotation tools can manage it.

Step 6: create your database and lock the door

Because Odoo listens on 127.0.0.1, reach it from your own computer through an SSH tunnel.

ssh -L 8069:127.0.0.1:8069 you@your-server

Browse to http://localhost:8069/web/database/manager, enter the master password, choose a database name, an administrator email and a strong password, and leave demonstration data off. Then add the following lines to /etc/odoo/odoo.conf and restart with sudo systemctl restart odoo. Odoo's deployment guide recommends this once the name and filter match a single database: it hides the database list and blocks the management screens, which it warns are not meant for internet-facing systems.

db_name = mycompany
dbfilter = ^mycompany$
list_db = False

Step 7: add HTTPS, a firewall and backups

Reverse proxy and HTTPS. Put nginx or another reverse proxy in front, with a valid certificate (Odoo's guide notes that many free options exist), a redirect from HTTP to HTTPS, and proxy_mode = True in the config once the proxy is working. Odoo's deployment documentation has the requirements and an nginx example. For larger teams it also describes multi-processing with workers, which needs an extra proxy rule for websockets.

Three stacked layers, one above the other, each a little wider than the one above
Visitors reach only the proxy. Odoo and PostgreSQL stay on the server and answer to nobody else.

Firewall. Allow SSH before you enable the firewall, or you will lock yourself out. Leave 8069 and 5432 closed: Odoo listens on localhost, and PostgreSQL accepts only local connections by default.

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

Odoo's guide also advises key-only SSH logins and rate limiting.

Backups. With the database manager off, back up from the command line. The db dump command in Odoo 19 writes a zip that includes the filestore. Copy the file off the server, schedule it, and rehearse a restore with db load and its -n option, which neutralises the test copy.

sudo install -d -o odoo -g odoo -m 750 /var/backups/odoo
sudo -u odoo -H /opt/odoo/venv/bin/python /opt/odoo/odoo/odoo-bin db -c /etc/odoo/odoo.conf dump mycompany /var/backups/odoo/mycompany.zip

Troubleshooting common errors

Message or symptomCauseFix
error: externally-managed-environmentpip run outside a virtual environment on Ubuntu 24.04Use venv/bin/pip from step 3
ensurepip is not availableThe venv module is missingsudo apt install python3-venv
pg_config executable not foundPostgreSQL headers missing for psycopg2sudo apt install libpq-dev build-essential python3-dev
A build error mentioning lber.hLDAP headers missing for python-ldapsudo apt install libldap2-dev libsasl2-dev
role "odoo" does not existThe PostgreSQL role was not createdRun the createuser command from step 2
Peer authentication failedOdoo runs as a different Linux user than the role nameRun the service as odoo, or set a password and db_password
Address already in useAnother process uses port 8069Find it with sudo ss -ltnp, then stop it or change http_port
Unable to find Wkhtmltopdf on this systemwkhtmltopdf is missingInstall it as shown above, then restart Odoo
The browser cannot connectOdoo listens on 127.0.0.1 onlyUse the SSH tunnel or the reverse proxy

Frequently asked questions

Why not run Odoo as root?

A bug or a malicious module would then control the whole server. A dedicated user limits the damage to Odoo's own files and database role.

Should I use the packaged installer instead?

The official .deb package is simpler: it installs Odoo as a service and creates the PostgreSQL user for you, and Odoo documents it for Ubuntu 24.04. A source install gives more control over versions, add-ons and several instances on one server.

How do I update Odoo later?

Take a backup and test on a copy first. Odoo's documentation says a source install is updated with git fetch and git rebase --autostash in the Odoo folder, followed by a restart. Moving to a new major version is a database upgrade and a separate project.

Where do I put third-party modules?

In /opt/odoo/custom-addons, which is already in the add-ons path. Review each module first, as in our 30-minute review routine, then restart Odoo and update the Apps list.

Next steps

Odoo's source install page is the reference for the steps above, and its command-line reference covers every option. If you are still weighing costs, read how much Odoo costs. When you are ready for add-ons, see how to choose an Odoo module and browse Odoo modules.

Find the right software for the job

Every item on DevMarket has a human-reviewed release, an instant licence key and clear update and support terms.