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.
DEBy DevMarket Editorial·Published: ·8 min read
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Odoo runs as a different Linux user than the role name
Run the service as odoo, or set a password and db_password
Address already in use
Another process uses port 8069
Find it with sudo ss -ltnp, then stop it or change http_port
Unable to find Wkhtmltopdf on this system
wkhtmltopdf is missing
Install it as shown above, then restart Odoo
The browser cannot connect
Odoo listens on 127.0.0.1 only
Use 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.
Compare the three Odoo hosting options from Odoo documentation: what each allows, who runs what, which editions fit, where data sits, what costs to expect and how to move between them.
An Odoo implementation is a project, not an installation. Follow the phases from scope to go-live, see who does what, decide between a partner and doing it yourself, and use a go-live checklist.
Odoo Studio changes Odoo without code; custom modules add code. See what each can do, which edition and hosting allow them, what upgrades mean for both, and how to decide by need.
·9 min read
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.