How To

Install Odoo 13 on Ubuntu 18.04: Python Venv and Nginx Guide

Odoo is a popular open-source suite of business applications. A single platform covers CRM, e-commerce, accounting, inventory, warehouse, and project management — all integrated out of the box.

This guide shows you how to install Odoo 13 on Ubuntu 18.04 inside a Python virtual environment, with Nginx configured as an SSL reverse proxy. This setup gives you better control, clean dependency isolation, and a production-ready deployment.

<strong>Prerequisite:</strong>&nbsp;You need sudo access and a domain name pointing to your server.

Install Preraequisites and Create the System User

Update the package list and install the required build tools and development libraries:

bashsudo apt updatesudo apt install git python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less

Create a dedicated system user named odoo13 with a home directory at /opt/odoo13. Odoo will run as this user:

bashsudo useradd -m -d /opt/odoo13 -U -r -s /bin/bash odoo13

Install PostgreSQL and wkhtmltopdf

Odoo uses PostgreSQL as its database backend. Install it and create a database user that matches the system username:

bashsudo apt install postgresqlsudo su - postgres -c "createuser -s odoo13"

Install wkhtmltopdf version 0.12.5 for PDF report generation. The version in the Ubuntu 18.04 repositories is incompatible, so download it directly from the project’s release page:

bashwget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.debsudo apt install ./wkhtmltox_0.12.5-1.bionic_amd64.deb

Install Odoo 13 on Ubuntu from GitHub

Switch to the odoo13 user and clone the Odoo 13 source code from GitHub:

bashsudo su - odoo13git clone https://www.github.com/odoo/odoo --depth 1 --branch 13.0 /opt/odoo13/odoo

Create a Python virtual environment and install all required packages:

bashpython3 -m venv odoo-venvsource odoo-venv/bin/activatepip3 install wheelpip3 install -r odoo/requirements.txtdeactivate

Create a directory for third-party addons, then return to your sudo user:

bashmkdir /opt/odoo13/odoo-custom-addonsexit

Create the Odoo configuration file at /etc/odoo13.conf. Set a strong admin_passwd, set db_user to odoo13, and point addons_path to both the main Odoo addons directory and your custom addons folder.

Create the Systemd Service and Start Odoo

Create a systemd unit file at /etc/systemd/system/odoo13.service. Set User and Group to odoo13, declare postgresql.service as a dependency, and set ExecStart to the virtual environment’s Python binary with -c /etc/odoo13.conf.

Load and start the service:

bashsudo systemctl daemon-reloadsudo systemctl enable --now odoo13sudo systemctl status odoo13

Odoo is now accessible at http://your_server_ip:8069.

Configure Nginx as SSL Reverse Proxy

For production, place Odoo behind Nginx with an SSL certificate. The Nginx configuration needs two upstream blocks — odoo on port 8069 and odoochat on port 8072 for long-polling. Proxy all HTTPS traffic to Odoo, enable gzip compression, and configure static file caching to improve page load performance.

Add proxy_mode = True to /etc/odoo13.conf and restart both Nginx and Odoo after saving changes.

To restrict direct access to the Odoo process, add xmlrpc_interface = 127.0.0.1 and netrpc_interface = 127.0.0.1 to the configuration file. This forces Odoo to listen only on the local interface so all external traffic must go through Nginx.

Enable Multiprocessing for Production

Odoo runs in multithreading mode by default. Switching to multiprocessing gives better stability and more efficient use of server resources.

Calculate your worker count based on CPU cores: (CPUs x 2) + 1 is the theoretical maximum. Each worker handles roughly 6 concurrent users. Add the workers value and appropriate memory limits to /etc/odoo13.conf, then restart Odoo. Use grep -c ^processor /proc/cpuinfo to check how many CPU cores your server has.

Odoo 13 is now installed and running on Ubuntu 18.04 inside a Python virtual environment, served securely through Nginx. The setup is production-ready with SSL, long-polling support, and multiprocessing. Leave a comment below if you run into any issues during setup.

Cyber Defence

Recent Posts

What I Wish I Knew Before Learning Malware Analysis and Reverse Engineering

When I first started learning malware analysis and reverse engineering, I thought the hardest part…

1 day ago

git fetch vs git pull: How They Work and When to Use Each

Both git fetch and git pull talk to a remote repository, but they do very different things to your…

2 weeks ago

git cherry-pick Command: Apply Commits from Another Branch

Sometimes the change you need already exists, just on the wrong branch. A hotfix lands…

2 weeks ago

Best Email APIs for Secure Business Email: Why Developers Are Moving Beyond SMTP

Email is still one of the most important communication channels inside modern applications. Password resets,…

2 weeks ago

Nginx Commands in Linux: Start, Stop, Reload, Test, and Log

Nginx is a high-performance web server and reverse proxy trusted by some of the largest…

2 weeks ago

ufw Command in Linux: Manage Firewall Rules with Examples

ufw (Uncomplicated Firewall) sits on top of iptables (or nftables on newer systems) and replaces…

2 weeks ago