
Odoo is an open-source suite of business apps that covers CRM, sales, invoicing, inventory, purchase, manufacturing, POS, website and much more, all sharing one database. Odoo 19 brings a faster interface, smarter AI features and many improvements across every app. Many servers still run Ubuntu 22.04 LTS, and Odoo 19 runs well on it because its default Python 3.10 meets Odoo's minimum requirement. In this tutorial we will show you how to install Odoo 19 Community on Ubuntu 22.04 from source, run it as a systemd service, and serve it securely through Nginx with a free SSL certificate.
Table of Contents
- Prerequisites
- Step 1. Update the System
- Step 2. Add a System User
- Step 3. Install Dependencies
- Step 4. Install PostgreSQL
- Step 5. Install Wkhtmltopdf
- Step 6. Install Odoo 19
- Step 7. Create the Odoo Configuration File
- Step 8. Create an Odoo Systemd Unit File
- Step 9. Configure Nginx as a Reverse Proxy
- Step 10. Install a Free SSL Certificate
- Conclusion
Prerequisites
- A server or VPS running Ubuntu 22.04 with at least 2 GB of RAM (4 GB recommended for production)
- SSH access with root or a user with sudo privileges
- A domain or subdomain pointing to the server's IP address (for Steps 9 and 10)
Conventions
# – run the command with root privileges, either as the root user or with sudo
$ – run the command as a regular (non-root) userStep 1. Update the System
Log in to your Ubuntu 22.04 server via SSH:
ssh root@IP_ADDRESS -p PORT_NUMBERReplace IP_ADDRESS and PORT_NUMBER with your server's IP address and SSH port. Then update the package index and upgrade installed packages:
$ sudo apt update && sudo apt upgrade -yStep 2. Add a System User
Odoo should never run as root. Create a dedicated system user and group named odoo19, with /opt/odoo19 as its home directory:
$ sudo useradd -m -d /opt/odoo19 -U -r -s /bin/bash odoo19Step 3. Install Dependencies
Odoo needs Git, Python 3.10 development files and several libraries to build its Python packages. Install them with:
$ sudo apt install git wget build-essential python3-dev python3-venv python3-pip python3-wheel \
libxml2-dev libxslt1-dev libzip-dev libldap2-dev libsasl2-dev libpq-dev libssl-dev libffi-dev \
libjpeg-dev zlib1g-dev libfreetype6-dev libtiff-dev libopenjp2-7-dev liblcms2-dev libwebp-dev \
fonts-dejavu-core -yStep 4. Install PostgreSQL
Odoo stores all its data in PostgreSQL. The default repository already includes PostgreSQL 14, which is supported by Odoo 19:
$ sudo apt install postgresql -yCheck that the service is running:
$ sudo systemctl status postgresqlNow create a PostgreSQL role with the same name as the system user, so Odoo can connect without a password:
$ sudo su - postgres -c "createuser -s odoo19"Step 5. Install Wkhtmltopdf
Odoo uses wkhtmltopdf to turn invoices, quotations and other reports into PDF files. Install version 0.12.6.1 with patched Qt; other versions print PDFs without headers and footers.
$ cd /tmp
$ wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb
$ sudo apt install ./wkhtmltox_0.12.6.1-2.jammy_amd64.deb -yVerify the installation:
$ wkhtmltopdf --versionThe output should be:
wkhtmltopdf 0.12.6.1 (with patched qt)Step 6. Install Odoo 19
Switch to the odoo19 user and download the Odoo 19 source code from GitHub:
$ sudo su - odoo19
$ git clone https://github.com/odoo/odoo --depth 1 --branch 19.0 /opt/odoo19/odoo19Create a Python virtual environment, so Odoo's packages do not conflict with system packages, and activate it:
$ python3 -m venv /opt/odoo19/odoo19-venv
$ source /opt/odoo19/odoo19-venv/bin/activateInstall the required Python packages:
(odoo19-venv) $ pip install --upgrade pip wheel
(odoo19-venv) $ pip install -r /opt/odoo19/odoo19/requirements.txtThis takes a few minutes. When it finishes, deactivate the environment, create a folder for custom modules and return to your sudo user:
(odoo19-venv) $ deactivate
$ mkdir /opt/odoo19/custom-addons
$ exitIf you have an Odoo Enterprise subscription, clone the odoo/enterprise repository (branch 19.0) into /opt/odoo19/enterprise and add that path first in addons_path in the next step.
Step 7. Create the Odoo Configuration File
Create a log folder and the Odoo configuration file:
$ sudo mkdir -p /var/log/odoo19
$ sudo chown odoo19: /var/log/odoo19
$ sudo nano /etc/odoo19.confPaste the following content. Replace STRONG_MASTER_PASSWORD with a long random password; it protects the database manager.
[options]
admin_passwd = STRONG_MASTER_PASSWORD
db_host = False
db_port = False
db_user = odoo19
db_password = False
addons_path = /opt/odoo19/odoo19/addons,/opt/odoo19/custom-addons
http_port = 8069
gevent_port = 8072
proxy_mode = True
logfile = /var/log/odoo19/odoo19.log
workers = 2
max_cron_threads = 1Save the file, then make sure only the odoo19 user can read it:
$ sudo chown odoo19: /etc/odoo19.conf
$ sudo chmod 640 /etc/odoo19.confAs a rule of thumb, set workers to (number of CPU cores x 2) + 1. On a small test server you can use workers = 0.
Step 8. Create an Odoo Systemd Unit File
To start Odoo automatically at boot, create a systemd unit file:
$ sudo nano /etc/systemd/system/odoo19.servicePaste the following lines:
[Unit]
Description=Odoo 19
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo19
User=odoo19
Group=odoo19
ExecStart=/opt/odoo19/odoo19-venv/bin/python3 /opt/odoo19/odoo19/odoo-bin -c /etc/odoo19.conf
StandardOutput=journal+console
Restart=on-failure
[Install]
WantedBy=multi-user.targetReload systemd, then start and enable the service:
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now odoo19Check that it is running:
$ sudo systemctl status odoo19You should see output similar to this:
● odoo19.service - Odoo 19
Loaded: loaded (/etc/systemd/system/odoo19.service; enabled; preset: enabled)
Active: active (running) since Sat 2026-11-21 10:15:02 UTC; 6s ago
Main PID: 41213 (python3)
CGroup: /system.slice/odoo19.service
└─41213 /opt/odoo19/odoo19-venv/bin/python3 /opt/odoo19/odoo19/odoo-bin -c /etc/odoo19.confOdoo now listens on port 8069. You can test it at http://YOUR_SERVER_IP:8069, where you will see the database creation screen. Fill in the master password from the config file, a database name, your admin email and password, language and country, then click Create database.
Step 9. Configure Nginx as a Reverse Proxy
Running Odoo behind a reverse proxy lets you use your domain name and HTTPS instead of port 8069. Install Nginx:
$ sudo apt install nginx -yCreate a new server block:
$ sudo nano /etc/nginx/sites-available/odoo19Paste the following, and replace yourdomain.com with your own domain or subdomain that points to the server:
upstream odoo19 {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name yourdomain.com;
client_max_body_size 100m;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
access_log /var/log/nginx/odoo19.access.log;
error_log /var/log/nginx/odoo19.error.log;
location /websocket {
proxy_pass http://odoochat;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header 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_pass http://odoo19;
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;
}
location ~* /web/static/ {
proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo19;
}
gzip on;
gzip_types text/css text/plain application/json application/javascript;
}Enable the site, test the configuration and reload Nginx:
$ sudo ln -s /etc/nginx/sites-available/odoo19 /etc/nginx/sites-enabled/
$ sudo nginx -t
$ sudo systemctl reload nginxIf the syntax is correct you will see:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successfulStep 10. Install a Free SSL Certificate
Secure Odoo with a free Let's Encrypt certificate. Certbot gets the certificate, updates the Nginx configuration and sets up automatic renewal:
$ sudo apt install certbot python3-certbot-nginx -y
$ sudo certbot --nginx -d yourdomain.comFinally, allow SSH and web traffic in the firewall. Port 8069 does not need to be open because Nginx talks to Odoo locally:
$ sudo ufw allow OpenSSH
$ sudo ufw allow 'Nginx Full'
$ sudo ufw enableYou can now open https://yourdomain.com and log in to Odoo 19.
Conclusion
Congratulations! You have successfully installed Odoo 19. Open your browser, create your first database and start installing the apps your business needs. For more options, check the official Odoo documentation, or see our Odoo 19 installation guide for every platform.
Of course, you don't have to install Odoo 19 yourself. As a CloudPk client you can ask our Odoo team to install, configure, host and maintain Odoo for you, on our fully managed SaaS or on your own server. Book a free consultation, or message us on WhatsApp +92 302 0600001, and we will take care of it.
PS. If this guide helped you, please share it with your friends on social networks, or ask a question in our Odoo Help Forum. Want to learn more? Take our free course Install and Administer Odoo 19.