Website Vidya
Linux & ServersStep-by-Step Guide

How to Install Odoo on Ubuntu 24.04

Step-by-step guide to install Odoo on Ubuntu 24.04 LTS with PostgreSQL, Python 3 virtual environment, systemd service, and Nginx reverse proxy.

RR
Rajesh RayLead Systems Educator
Published:
6 min read
PDF Cheat Sheet
How to Install Odoo on Ubuntu 24.04
AI Executive SummaryWebsiteVidya AI

6 min read

Step-by-step guide to install Odoo on Ubuntu 24.04 LTS with PostgreSQL, Python 3 virtual environment, systemd service, and Nginx reverse proxy.

Key Highlights
  • Prerequisites and Supported Releases
  • Step 1: Updating System and Installing Core Dependencies
  • Step 2: Creating a Dedicated System User for Odoo
Grounded in full engineering runbookWebsiteVidya AI Engine

Interactive Builder for this Guide

Build your custom nginx syntax (How to Install Odoo on Ubuntu 24.04)

Generated Config Output
server {
    listen 80;
    listen [::]:80;
    server_name app.example.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name app.example.com;

    ssl_certificate /etc/letsencrypt/live/app.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/app.example.com/privkey.pem;

    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;

    gzip on;
    gzip_types text/plain text/css application/json application/javascript application/xml;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
Production Nginx reverse proxy -> 127.0.0.1:3000 for app.example.com.
Flag-by-Flag Breakdown
server_nameBinds this virtual host to app.example.com
return 301 https://...Redirects all plain HTTP requests permanently to TLS/HTTPS
proxy_pass http://127.0.0.1:3000Forwards HTTP + WebSocket requests to local application server
X-Content-Type-Options / X-Frame-OptionsProtects users against MIME sniffing and clickjacking

Enterprise Resource Planning (ERP) systems unify business functions—including supply chain management, human resources, billing, and customer relationships—into a single synchronized database. When you install odoo on ubuntu 24.04, you deploy a highly modular, Python-powered enterprise suite backed by the high-performance PostgreSQL relational database.

Deploying Odoo manually in an isolated Python 3 virtual environment under /opt/odoo provides immense administrative advantages over containerized or generic package manager bundles. It allows you to select specific community branches (such as Odoo 17 or Odoo 18 Community), isolate Python runtime dependencies without conflicting with Ubuntu's system packages, and maintain granular control over custom third-party addons.

This technical guide details the end-to-end deployment lifecycle. You will configure PostgreSQL, build the isolated Python environment, install Wkhtmltopdf for high-resolution PDF invoices, construct a managed systemd background service, and configure Nginx as a reverse proxy with TLS termination.

Advertisement

Prerequisites and Supported Releases

This guide is thoroughly verified on Ubuntu 24.04 LTS (Noble Numbat). The instructions apply cleanly to cloud instances (AWS EC2, Google Compute Engine, DigitalOcean, Hetzner), bare-metal servers, and local virtual machines.

Before proceeding, ensure you have the following requirements satisfied:

  • A server running Ubuntu 24.04 LTS with at least 2 GB RAM (4 GB recommended for production workloads).
  • A non-root user account configured with sudo administrative privileges.
  • A registered domain name (e.g., odoo.example.com) pointing to your server's public IP address.
  • An active Internet connection for fetching dependencies and source code.

Step 1: Updating System and Installing Core Dependencies

Odoo requires several development toolchains, image processing libraries, and cryptographic headers to compile its Python dependencies.

First, refresh your APT package database and install Git, Python 3 development libraries, Node.js tools (required for compiling Odoo stylesheets), and essential system utilities.

Advertisement
# Update package index and upgrade packages
sudo apt update && sudo apt upgrade -y

# Install build dependencies, Python headers, and node-less
sudo apt install -y git python3-dev python3-pip python3-venv build-essential \
  libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev libssl-dev \
  libffi-dev libjpeg-dev libpq-dev liblcms2-dev libblas-dev libatlas-base-dev \
  npm node-less curl

Step 2: Creating a Dedicated System User for Odoo

Running complex business applications under the root account is a severe security risk. Create an isolated system user and group named odoo with home directory /opt/odoo.

The system account is configured without login shell privileges to prevent unauthorized interactive access.

# Create dedicated system user and group for Odoo
sudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo

Step 3: Installing and Configuring PostgreSQL Database

Odoo relies strictly on PostgreSQL for relational data storage. Install PostgreSQL and create a database user that matches the system user name (odoo).

Grant the odoo database user permissions to create databases so that Odoo can initialize separate company databases on demand.

Advertisement
# Install PostgreSQL database server
sudo apt install -y postgresql postgresql-contrib

# Create PostgreSQL database user for Odoo
sudo su - postgres -c "createuser -s odoo"

Step 4: Installing Wkhtmltopdf for Report and Invoice Generation

Odoo generates PDF documents—such as quotes, delivery orders, and invoices—using the wkhtmltopdf command-line utility. Note that the standard Ubuntu repository version lacks patched QT support required for Odoo header/footer rendering.

Download and install the official upstream .deb package with patched QT for Ubuntu 24.04.

# Download wkhtmltopdf with patched QT
cd /tmp
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb

# Install package and resolve dependencies
sudo apt install -y ./wkhtmltox_0.12.6.1-3.jammy_amd64.deb
rm -f wkhtmltox_0.12.6.1-3.jammy_amd64.deb

Step 5: Cloning Odoo Source Code into /opt/odoo

Switch to the odoo system user and clone the official Odoo Community source code from GitHub into /opt/odoo/odoo-server.

Using --depth 1 creates a shallow clone that significantly reduces download time and disk space consumption.

# Switch to odoo user shell
sudo su - odoo

# Clone Odoo 17/18 Community edition into odoo-server directory
git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 odoo-server

# Exit back to administrative user shell
exit

Step 6: Configuring Python 3 Virtual Environment

Isolating Odoo's Python dependencies inside a dedicated virtual environment ensures that system package upgrades never break Odoo's required library versions.

Create a virtual environment at /opt/odoo/odoo-venv, activate it as the odoo user, and install all required Python wheels using pip.

# Switch to odoo user and create virtual environment
sudo su - odoo
python3 -m venv odoo-venv
source odoo-venv/bin/activate

# Upgrade pip and install wheel
pip install --upgrade pip wheel

# Install all Odoo Python dependencies
pip install -r odoo-server/requirements.txt

# Exit virtual environment and user session
deactivate
exit

Step 7: Creating Custom Addons Directory and Configuration File

Create an isolated directory for custom third-party modules at /opt/odoo/odoo-custom-addons. Then, configure Odoo's operational parameters inside /etc/odoo.conf.

Set a strong administrative master password (admin_passwd) used for creating, duplicating, and restoring databases.

# Create custom addons directory
sudo mkdir -p /opt/odoo/odoo-custom-addons
sudo chown -R odoo:odoo /opt/odoo/odoo-custom-addons

# Create Odoo configuration file
sudo tee /etc/odoo.conf << 'EOF'
[options]
admin_passwd = SuperSecretMasterPassword_ChangeMe!
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo-server/addons,/opt/odoo/odoo-custom-addons
logfile = /var/log/odoo/odoo.log
http_port = 8069
longpolling_port = 8072
proxy_mode = True
EOF

# Create log directory and set ownership
sudo mkdir -p /var/log/odoo
sudo chown -R odoo:odoo /var/log/odoo
sudo chmod 640 /etc/odoo.conf
sudo chown odoo:odoo /etc/odoo.conf

Step 8: Configuring systemd Background Service

To ensure Odoo starts automatically upon system boot and recovers gracefully from crashes, configure a systemd service unit at /etc/systemd/system/odoo.service.

This unit specifies the virtual environment binary path, configuration file location, and user execution boundaries.

[Unit]
Description=Odoo Open Source ERP and CRM
After=network.target postgresql.service

[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo-server/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console
StandardError=journal+console
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Step 9: Starting Odoo and Configuring Nginx Reverse Proxy

Reload the systemd daemon, enable the Odoo service to run at system startup, and start the daemon.

Next, configure an Nginx virtual host at /etc/nginx/sites-available/odoo that proxies standard HTTP port 80 traffic to Odoo's backend port 8069, handling WebSockets on port 8072.

# Reload systemd and start Odoo service
sudo systemctl daemon-reload
sudo systemctl enable --now odoo

# Verify Odoo is listening on port 8069
sudo ss -tulpn | grep 8069

Step 10: Setting Up Nginx Virtual Host and Web Initialization

Create the Nginx configuration file for your Odoo instance. Configure large client body buffers to support heavy document uploads and file attachments.

Enable the site and reload Nginx.

upstream odoo {
    server 127.0.0.1:8069;
}
upstream odoochat {
    server 127.0.0.1:8072;
}

server {
    listen 80;
    server_name odoo.example.com;

    proxy_read_timeout 720s;
    proxy_connect_timeout 720s;
    proxy_send_timeout 720s;
    client_max_body_size 100M;

    access_log /var/log/nginx/odoo.access.log;
    error_log /var/log/nginx/odoo.error.log;

    location /websocket {
        proxy_pass http://odoochat;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-Host $http_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://odoo;
        proxy_redirect off;
        proxy_set_header X-Forwarded-Host $http_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 ~* /web/static/ {
        proxy_cache_valid 200 60m;
        proxy_buffering on;
        expires 864000;
        proxy_pass http://odoo;
    }
}

Troubleshooting and Common Errors

When configuring Ubuntu servers, unexpected permission errors, network timeouts, or lock contention can occur. Review these common issues and verified resolutions:

Odoo service fails to start with error: 'Database connection failed'

Resolution: Check whether PostgreSQL is running with sudo systemctl status postgresql. Ensure the odoo PostgreSQL user exists by checking sudo su - postgres -c 'psql -c \'\du\''.

PDF reports print without CSS styles or images

Resolution: This indicates Wkhtmltopdf was installed without patched QT. Verify that running wkhtmltopdf --version shows with patched qt. Check that system parameter web.base.url matches your exact domain in Odoo Settings.

504 Gateway Timeout during module installation or database creation

Resolution: Module installations can take several minutes. Ensure your Nginx configuration includes proxy_read_timeout 720s; and proxy_connect_timeout 720s; inside the server block.

Security Best Practices and Hardening

Always set a high-entropy admin_passwd in /etc/odoo.conf and restrict file read permissions (0640 owned by odoo:odoo) to prevent database hijacking.

Deploy an SSL/TLS certificate with Let's Encrypt Certbot (sudo certbot --nginx -d odoo.example.com) to encrypt business credentials and customer data in transit.

Keep Odoo isolated within a non-root system account and dedicated Python virtual environment to avoid privilege escalation.

Configure automated daily PostgreSQL database dumps (pg_dump) to remote offsite storage to protect against catastrophic data loss.

Deepen your Linux system administration skills with our related production-tested guides:

Authoritative References and Official Documentation

Frequently Asked Questions

Quick answers to common questions and configurations

3 FAQs
Yes. Odoo Community Edition is licensed under LGPLv3 and is free to deploy, customize, and run on your own servers without licensing fees.
Place your custom module folders inside /opt/odoo/odoo-custom-addons/, ensure permissions belong to user odoo, activate Developer Mode in Odoo, and click Update Apps List.
Yes. By isolating each version into its own home directory, Python virtual environment, configuration file, and distinct HTTP/longpolling ports, you can host multiple instances concurrently.
RR
Written byVerified Author

Rajesh Ray

I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.

SPAM-FREE MODERATED DISCOURSE

Join the Conversation & Perspective

Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.

AT
MP
JV
+2

No comments on this guide yet. Be the first to share your thoughts or ask a question!

Recommended Reading10 Guides

Related Technical Guides

Tested runbooks, server administration walkthroughs, and troubleshooting guides

Featured Infrastructure PartnerUp to 75% OFF + 3 Months Free

Supercharge Your Linux & Cloud Workloads with Hostinger

Deploy high-speed NVMe KVM VPS, Docker containers, and LiteSpeed-accelerated WordPress servers in under 60 seconds with full root access, dedicated IPv4, and 24/7 technical support.

Pure NVMe SSD StorageFull Root Access & SSHFree Domain & Unlimited SSL99.9% Uptime SLA
Plans from$2.99/mo
Claim Hostinger DealAffiliate link • Special discount applied at checkout