How to install Odoo 11 in virtualenv on Ubuntu 16.04

There are several ways to install Odoo depending on the required use case. The easiest and quickest way to install Odoo is by using their official repositories but if you want to have more control over versions and updates or if you want to run multiple Odoo versions on your machine then this approach will not work for you because the Odoo package doesn’t allow multiple Odoo installations on a same machine. In this case you can either use docker containers or install Odoo by creating a virtualenv environment and fetching the Odoo code from their Github repository.

This guide covers the steps necessary for installing and configuring Odoo using Git source and Python virtualenv on Ubuntu 16.04.

Create Odoo user

Create a new system user and group with home directory /opt/odoo that will run the Odoo service.

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

You can name the user whatever you like, just make sure you create a postgres user with the same name.

Install and configure PostgreSQL

Install the Postgres package from the Ubuntu’s default repositories:

sudo apt-get install postgresql

Once the installation is completed create a postgres user with the same name as the previously created system user, in our case odoo:

sudo su - postgres -c "createuser -s odoo"

Install Wkhtmltopdf

In order to print PDF reports, you will need the wkhtmltopdf tool. The recommended version for Odoo is 0.12.1 which is not available in the official Ubuntu 16.04 repositories. To download and install the recommended version run the following commands: