Installing Odoo from source gives you full control over versions, addons and server settings. This guide installs Odoo 19 Community on a fresh Ubuntu 24.04 server, runs it as a system service, and puts it behind Nginx with a free SSL certificate. The same steps work for Odoo 17 and 18: change the branch name in step 4.
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, which suit Odoo 17, 18 and 19. Older releases such as Odoo 16 expect an older Python, so pick 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-dev node-lessCreate 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. 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 --version4. 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.
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
exitFor Odoo 18 or 17, replace 19.0 with 18.0 or 17.0. 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;
}
server {
listen 80;
server_name erp.yourcompany.com;
client_max_body_size 100m;
proxy_read_timeout 720s;
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. When you enable workers later, you'll also route /websocket to Odoo's gevent port; 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
Everything above, plus backups, monitoring and updates, is what EasyInstance managed Odoo hosting does for you. Pick a version from Odoo 16 to 19, 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, edition and region.
- Open your new Odoo. Backups, SSL and monitoring are already on.
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.