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

xargs Command in Linux: Build and Execute Commands from Input

The xargs command in Linux reads items from standard input and passes them as arguments to another…

2 days ago

locate Command in Linux: Find Files Fast with a Database Search

The locate command in Linux searches for files and directories by name. It queries a pre-built database…

2 days ago

Listing Linux Services with systemctl: A Complete Guide

Most modern Linux distributions use systemd as the default service manager. Knowing how to list…

2 days ago

How to Truncate Files in Linux: Empty Files Without Deleting

Truncating a file in Linux means removing its contents while leaving the file itself in…

2 days ago

ss Command in Linux: Display Socket Statistics and Connections

The ss command in Linux lists open sockets and active network connections. It replaced the deprecated netstat command and…

3 days ago

ftp Command in Linux: Connect to Servers and Transfer Files

The ftp command in Linux connects to a remote FTP server and transfers files. FTP transmits everything…

3 days ago