This guide shows you how to install Odoo from source on a fresh Ubuntu 24.04 server: Odoo 19 or Odoo 20 Community, running as a system service behind Nginx with a free SSL certificate. Installing from source gives you full control over versions, addons and server settings. The same steps install Odoo 17 and 18; only the branch name in step 4 changes.
Before you start
- A server running Ubuntu 24.04 with at least 2 CPU cores and 4 GB of RAM for a small team. See Odoo server configuration for sizing.
- A user with sudo rights and SSH access.
- A domain or subdomain (for example erp.yourcompany.com) pointing at the server, for the SSL step.
- About 45 minutes.
Ubuntu 24.04 ships Python 3.12 and PostgreSQL 16. That suits Odoo 17, 18 and 19, and it is exactly the minimum Odoo 20 asks for (Python 3.12 and PostgreSQL 16). Odoo 16 and older expect an older Python, so use an older Ubuntu release or a separate Python build for those.
1. Install system packages
Update the server, then install Git, Python build tools and the libraries Odoo's Python packages compile against.
sudo apt update && sudo apt upgrade -y
sudo apt install -y git python3-dev python3-venv python3-pip build-essential \
libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libpq-dev \
libjpeg-dev zlib1g-dev libffi-dev libssl-devCreate a dedicated system user to own the Odoo files and run the service:
sudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo2. Set up PostgreSQL
Odoo stores everything in PostgreSQL. Install it and create a database role with the same name as the system user, so Odoo can connect over the local socket without a password.
sudo apt install -y postgresql
sudo -u postgres createuser --createdb --no-createrole --no-superuser odoo3. Install wkhtmltopdf
Odoo prints invoices, quotations and other reports to PDF with wkhtmltopdf, in Odoo 19 and 20 alike. Use the patched-Qt build from the wkhtmltopdf project rather than the Ubuntu package, or headers and footers will be missing from your PDFs. The Ubuntu 22.04 (jammy) build installs on 24.04.
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 --versionOn an ARM server (for example AWS Graviton or Hetzner CAX), download wkhtmltox_0.12.6.1-3.jammy_arm64.deb from the same release instead. Run dpkg --print-architecture if you are not sure which one you have.
4. Download Odoo and its Python packages
Switch to the odoo user, clone the Odoo source for the version you want, and install its Python requirements into a virtual environment. The example uses Odoo 19.
sudo su - odoo
git clone https://github.com/odoo/odoo.git --depth 1 --branch 19.0 /opt/odoo/odoo
python3 -m venv /opt/odoo/venv
source /opt/odoo/venv/bin/activate
pip install wheel
pip install -r /opt/odoo/odoo/requirements.txt
deactivate
mkdir /opt/odoo/custom-addons
exitTo install Odoo 20, replace 19.0 with 20.0; for Odoo 18 or 17, use 18.0 or 17.0. Each branch's requirements.txt pins versions for Ubuntu 24.04's Python 3.12, so the rest of the guide is identical. Odoo Enterprise is a separate private repository: clone it next to the Community code and add its path to addons_path in the next step.
5. Create odoo.conf
Create a log folder, then the configuration file Odoo reads at startup.
sudo mkdir /var/log/odoo && sudo chown odoo: /var/log/odoo
sudo nano /etc/odoo.conf[options]
; Master password for creating, restoring and dropping databases. Change it.
admin_passwd = replace-with-a-long-random-password
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo/addons,/opt/odoo/custom-addons
data_dir = /opt/odoo/.local/share/Odoo
logfile = /var/log/odoo/odoo.log
; Odoo sits behind Nginx (step 7)
proxy_mode = Truesudo chown odoo: /etc/odoo.conf
sudo chmod 640 /etc/odoo.confThis is a minimal setup that runs Odoo in a single process. Before real users arrive, add workers and memory limits as described in Odoo server configuration.
6. Run Odoo as a service
A systemd unit starts Odoo on boot and restarts it if it stops.
[Unit]
Description=Odoo
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
User=odoo
Group=odoo
ExecStart=/opt/odoo/venv/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf
Restart=on-failure
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable --now odoo
sudo systemctl status odooOdoo now listens on port 8069. Open http://your-server-ip:8069 to create your first database, or check /var/log/odoo/odoo.log if the page doesn't load.
7. Add a domain and free SSL
Put Nginx in front of Odoo so users reach it on your domain over HTTPS, and get a free certificate from Let's Encrypt with Certbot.
sudo apt install -y nginx certbot python3-certbot-nginx
sudo nano /etc/nginx/sites-available/odooupstream odoo {
server 127.0.0.1:8069;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name erp.yourcompany.com;
client_max_body_size 100m;
proxy_read_timeout 720s;
location /websocket {
proxy_pass http://odoo;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_pass http://odoo;
}
}sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d erp.yourcompany.comCertbot edits the Nginx file to serve HTTPS and sets up automatic renewal. In single-process mode, Odoo answers websockets (live chat and notifications) on port 8069, which is why /websocket gets the upgrade headers. When you enable workers later, point /websocket at Odoo's gevent port instead; the server configuration guide has the full Nginx file.
After the install
Odoo is running, but a production server needs a few more things before your team relies on it:
- Backups of both the PostgreSQL database and the filestore in
data_dir, copied off the server, with a restore you have actually tested. - Workers and limits sized for your users, so one heavy report doesn't freeze everyone else.
- Security: a firewall that only opens ports 22, 80 and 443,
list_db = False, and regular Ubuntu and Odoo updates. - Monitoring for CPU, memory, disk and uptime, so you hear about problems before users do.
- Outgoing email through an SMTP provider with SPF and DKIM set on your domain.
The faster way: managed Odoo hosting
If you would rather skip the Odoo installation and the upkeep, Easy Instance managed Odoo hosting handles the server, backups, monitoring and updates. Pick a version from Odoo 16 to 20, Community or Enterprise, name your instance, and it's live on a secure URL in under 60 seconds. Custom modules deploy from GitHub, Python packages install from one field, and there's a browser terminal when you need a shell.
- Start a free trial (10 days, no credit card).
- Choose your Odoo version and edition, and name the instance.
- Open your new Odoo. Backups, SSL and monitoring are already on.
Pricing is $30 per worker a month with no per-user fees; see pricing.
Still deciding where to run Odoo?
Read how to host Odoo for a comparison of Odoo Online, Odoo.sh, a self-managed server and managed hosting, or Odoo Community vs Enterprise if you are still picking an edition.