How To

Install Odoo 11 on Ubuntu 18.04: Virtualenv and Nginx Proxy Setup

Odoo 11 is an open-source all-in-one business software platform covering CRM, e-commerce, billing, accounting, manufacturing, warehouse management, project management, and inventory. It is widely used by small and mid-sized businesses that need multiple integrated business tools without the cost of enterprise software.

Installing Odoo 11 from the GitHub source inside a Python virtual environment isolates its Python dependencies from the system Python installation, allows you to run multiple Odoo versions in parallel, and gives you full control over when updates are applied.

This guide covers how to install Odoo 11 on Ubuntu 18.04 from source with Nginx as the SSL termination proxy and multiprocessing enabled for production workloads.

<strong>Prerequisite</strong>: You need sudo access, Nginx installed, and an SSL certificate for your domain.

Install Odoo 11 on Ubuntu: System User, PostgreSQL, and Wkhtmltopdf

Install system dependencies:

bash

sudo apt update &amp;&amp; sudo apt upgrade<br>sudo 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<br>Create the Odoo system user. The system username must also be the PostgreSQL username because Odoo uses PostgreSQL peer authentication:

bash

sudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo<br>Install PostgreSQL and create the database user:

bash

sudo apt install postgresql<br>sudo su - postgres -c "createuser -s odoo"<br>Install Wkhtmltopdf 0.12.1. Odoo 11 requires Wkhtmltopdf 0.12.x for PDF report generation. The version packaged in Ubuntu 18.04 is too old and incompatible:

bash

wget https://builds.wkhtmltopdf.org/0.12.1.3/wkhtmltox_0.12.1.3-1~bionic_amd64.deb<br>sudo apt install ./wkhtmltox_0.12.1.3-1~bionic_amd64.deb<br>Clone Odoo 11 from GitHub, Configure the Virtualenv, and Create the Service Unit<br>Switch to the odoo user. Use whoami to confirm the user switch succeeded before proceeding:

bash

sudo su - odoo<br>whoami<br>Clone Odoo 11 and set up the virtual environment:

bash

git clone https://www.github.com/odoo/odoo --depth 1 --branch 11.0 /opt/odoo/odoo11<br>cd /opt/odoo<br>python3 -m venv odoo11-venv<br>source odoo11-venv/bin/activate<br>pip3 install wheel &amp;&amp; pip3 install -r odoo11/requirements.txt<br>deactivate<br>exit<br>Create the custom addons directory with correct ownership. The chown odoo: syntax (with trailing colon and no group specified) sets both the owner and group to odoo:

bash

sudo mkdir /opt/odoo/odoo11-custom-addons<br>sudo chown odoo: /opt/odoo/odoo11-custom-addons<br>Copy the sample configuration and edit it:

bash

sudo cp /opt/odoo/odoo11/debian/odoo.conf /etc/odoo11.conf<br>sudo nano /etc/odoo11.conf<br>Set a strong admin_passwd, confirm db_user = odoo, and update addons_path to include the custom addons path if you plan to install custom modules.

Create /etc/systemd/system/odoo11.service. Set Requires=postgresql.service so Odoo never attempts to start before PostgreSQL is ready, and point ExecStart to the virtual environment’s Python binary at /opt/odoo/odoo11-venv/bin/python3.

bash

sudo systemctl daemon-reload<br>sudo systemctl start odoo11<br>sudo systemctl enable odoo11<br>Check the status: sudo systemctl status odoo11. Access the Odoo 11 installer at http://your_ip:8069.
Nginx SSL Proxy, Localhost Binding, and Multiprocessing for Production<br>Enable proxy mode first. Add proxy_mode = True to /etc/odoo11.conf and restart Odoo before configuring Nginx. Without this, Odoo cannot correctly read the client IP addresses forwarded by the proxy.

Configure Nginx with two upstream blocks: odoo on port 8069 for standard web requests and odoochat on port 8072 for the live chat and longpolling service. The server blocks handle:

HTTP to HTTPS redirect<br>WWW to non-WWW redirect<br>SSL certificate and trusted certificate paths<br>Proxy headers including X-Forwarded-Proto (required for HTTPS detection inside Odoo)<br>Static asset caching: 90-minute server cache, 10-day browser cache<br>Gzip compression for CSS, JavaScript, and XML responses<br>Restart Nginx after saving the configuration.

Restrict Odoo to localhost. Add these lines to /etc/odoo11.conf to block direct access on port 8069 from external networks:

ini

xmlrpc_interface = 127.0.0.1<br>netrpc_interface = 127.0.0.1<br>Enable multiprocessing. Worker-based processing is required for production stability and better resource utilization. Use this formula: theoretical maximum workers = (CPU cores × 2) + 1; practical workers = concurrent users ÷ 6. For a 4-core server with 30 concurrent users: 5 workers + 1 cron thread. Append to /etc/odoo11.conf:

ini

workers = 5<br>max_cron_threads = 1<br>limit_memory_hard = 2684354560<br>limit_memory_soft = 2147483648<br>limit_time_cpu = 600<br>limit_time_real = 1200<br>Restart Odoo: sudo systemctl restart odoo11.

Odoo 11 is now installed and running in production mode on Ubuntu 18.04. Monitor the service logs with sudo journalctl -u odoo11 and schedule regular PostgreSQL database backups to protect your business data. Leave a comment below if you run into any problems.

Cyber Defence

Recent Posts

Install MariaDB on Ubuntu 18.04: Two Methods and Secure Setup

MariaDB is an open-source, multi-threaded relational database management system and a fully backward-compatible replacement for MySQL.…

5 minutes ago

Install Odoo on Ubuntu 18.04: Deploy Version 12 with Nginx

Odoo is the most widely used open-source all-in-one business software suite. It integrates CRM, e-commerce, billing,…

15 minutes ago

Install phpMyAdmin with Nginx on Ubuntu 18.04: Setup and Config

phpMyAdmin is a free, open-source PHP application for managing MySQL and MariaDB servers through a browser.…

25 minutes ago

Install phpMyAdmin on Ubuntu 18.04 with Apache: Setup Guide

phpMyAdmin is a free, open-source PHP application that provides a browser-based interface for managing MySQL and…

2 days ago

Install Zabbix on Ubuntu 18.04: Server Setup with MySQL Backend

Zabbix is a mature open-source infrastructure monitoring platform that collects metrics from network devices, servers, virtual…

2 days ago

Install Gradle on Ubuntu 18.04: Set Up OpenJDK and Environment

Gradle is a powerful open-source build automation tool used primarily for Java, Kotlin, Groovy, and Android…

2 days ago