How To

Install Odoo 11 on Ubuntu 16.04 with Git and Python Virtualenv

Odoo is one of the most widely used open-source ERP platforms in the world. It handles accounting, CRM, inventory, HR, project management, e-commerce, and more from a single web-based application.

Odoo can be installed in three ways: from the official Odoo repository, via Docker, or from Git source code inside a Python virtual environment. The official repository method is the fastest path, but it limits you to a single Odoo instance per machine. Installing from source in a virtualenv gives you version control, multi-instance support on the same server, and cleaner upgrade paths.

This guide covers how to install Odoo 11 on Ubuntu 16.04 using Git source and a Python virtualenv.

<strong>Prerequisite:</strong>&nbsp;You need sudo access. Run&nbsp;<code>sudo apt update &amp;&amp; sudo apt upgrade</code>&nbsp;before starting.

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

Install build dependencies. These libraries are required to compile Odoo’s Python dependencies during the virtualenv install step:

bashsudo apt install git python3-pip build-essential python3-dev \  libxslt-dev libzip-dev libldap2-dev libsasl2-dev node-less

Create a dedicated system user. Running Odoo under its own non-login account limits what the process can access if it is ever compromised:

bashuseradd -m -d /opt/odoo -U -r -s /bin/bash odoo

Install PostgreSQL and create the database user. Odoo uses peer authentication with PostgreSQL by default, which means the PostgreSQL user must match the Linux system user name exactly:

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

Install wkhtmltopdf. Odoo needs this tool to generate PDF reports. Version 0.12.1 is specifically required for Odoo 11. The Ubuntu 16.04 repositories ship a different version that is incompatible, so download the correct package directly:

bashwget https://builds.wkhtmltopdf.org/0.12.1.3/wkhtmltox_0.12.1.3-1~xenial_amd64.debsudo apt install ./wkhtmltox_0.12.1.3-1~xenial_amd64.deb

Clone Odoo from GitHub and Set Up the Python Virtual Environment

Switch to the odoo user and clone the Odoo 11 source. The --depth 1 flag creates a shallow clone that downloads only the latest commit rather than the full repository history, saving significant time and disk space:

bashsudo su - odoogit clone https://www.github.com/odoo/odoo --depth 1 --branch 11.0 /opt/odoo/odoo11

Install virtualenv and create an isolated Python environment for this Odoo instance. Isolation prevents Python package conflicts with other applications on the server:

bashpip3 install virtualenvcd /opt/odoovirtualenv odoo11-venvsource odoo11-venv/bin/activatepip3 install -r odoo11/requirements.txtdeactivate &amp;&amp; exit

Create a separate directory for custom addon modules. Keeping custom addons outside the Odoo core directory means you can update or re-clone the core without overwriting your modules:

bashsudo mkdir /opt/odoo/odoo11-custom-addonssudo chown odoo: /opt/odoo/odoo11-custom-addons

Configure Odoo 11, Create the systemd Service, and Test

Copy the default config file and edit it:

bashsudo cp /opt/odoo/odoo11/debian/odoo.conf /etc/odoo11.confsudo nano /etc/odoo11.conf

Set admin_passwd to a strong password — this controls access to the database management interface. Set db_user = odoo to match the PostgreSQL user. Update addons_path to include odoo11-custom-addons if you plan to install custom modules.

Create the systemd service unit at /etc/systemd/system/odoo11.service. The key directives are User=odooExecStart pointing to the virtualenv Python binary running odoo-bin with the config file, and Requires=postgresql.service to guarantee PostgreSQL starts before Odoo:

bashsudo systemctl daemon-reloadsudo systemctl start odoo11sudo systemctl enable odoo11

Verify the service is running:

bashsudo systemctl status odoo11

For log output during troubleshooting:

bashsudo journalctl -u odoo11

Open http://your_domain_or_ip:8069 in a browser. The Odoo database creation screen confirms a successful installation.

Odoo 11 is now installed on Ubuntu 16.04 and running as a managed systemd service. Next, configure Nginx as a reverse proxy and add a Let’s Encrypt SSL certificate to secure the connection. Leave a comment below if you run into any issues.

Cyber Defence

Recent Posts

Install Nextcloud on Ubuntu 18.04 with Apache and MySQL

Nextcloud is a free, open-source, self-hosted file sharing and collaboration platform. It gives you a private…

41 minutes ago

Install Plex Media Server on Ubuntu 18.04: Step-by-Step Setup

Plex is a self-hosted streaming media server that organizes your video, music, and photo collections into…

46 minutes ago

Install Visual Studio Code on Ubuntu 18.04: Microsoft Repo Setup

Visual Studio Code is a free, open-source, cross-platform code editor from Microsoft. It ships with built-in…

51 minutes ago

Secure Nginx with Let’s Encrypt on Ubuntu 16.04: SSL Setup Guide

Let's Encrypt is a free, automated, and open certificate authority run by the Internet Security Research…

1 hour ago

Install Nginx on Ubuntu 16.04: UFW, PPA, and Config Structure

Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server and reverse proxy. It handles…

1 day ago

Install Nginx on Ubuntu 18.04: UFW, Service Control, and Config

Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server and reverse proxy. It handles…

1 day ago