Read in 5 minutes
How to install Odoo 11 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 Python virtual 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 virtual environment on Ubuntu 16.04.
Before you begin
Update the system to the latest packages:
sudo apt update && sudo apt upgrade
pip and the tools required to build Odoo dependencies:
sudo apt install git python3-pip build-essential python3-dev libxslt-dev libzip-dev libldap2-dev libsasl2-dev node-less
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
sudo su - postgres -c "createuser -s odoo"
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:
wget https://downloads.wkhtmltopdf.org/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb apt-get -f install
Install and configure Odoo
We will install odoo from the GitHub repository so we can have more control over versions and updates. We will also use virtualenv which is a tool to create isolated Python environments.
Before starting with the installation process, make sure you switch to
sudo su - odoo
To confirm that you are logged-in as
odoo user you can use the following command:
Now we can start with the installation process, first clone the odoo from the GitHub repository:
git clone https://www.github.com/odoo/odoo --depth 1 --branch 11.0 /opt/odoo/odoo11
- If you want to install a different Odoo version just change the version number after the
- You can name the directory as you like, for example instead
odoo11you can use the name of your domain.
pip is a tool for installing and managing Python packages, which will be using to install all required Python modules, install it with:
pip3 install virtualenv
Create a new Python virtual environment for the Odoo installation with:
cd /opt/odoo virtualenv odoo11-venv
activate the environment:
and install all required Python modules:
pip3 install -r odoo11/requirements.txt
If you encounter any compilation errors during the installation, make sure that you installed all of the required dependencies listed in the
Before you begin section.
Once the installation is completed deactivate the environment and switch back to your sudo user using the following commands:
If you plan to install custom modules it is best to install those modules in a separate directory. To create a new directory for our custom modules run:
sudo mkdir /opt/odoo/odoo11-custom-addons sudo chown odoo: /opt/odoo/odoo11-custom-addons
Next, we need to create a configuration file, we can either create a new one from scratch or copy the included configuration file:
sudo cp /opt/odoo/odoo11/debian/odoo.conf /etc/odoo11.conf
Open the file and edit it as follows:
[options] ; This is the password that allows database operations: admin_passwd = my_admin_passwd db_host = False db_port = False db_user = odoo db_password = False addons_path = /opt/odoo/odoo11/addons ; If you are using custom modules ; addons_path = /opt/odoo/odoo11/addons,/opt/odoo/odoo11-custom-addons
Do not forget to change the
my_admin_passwd to something more secure and adjust the
addons_path if you’re using custom modules.
Create a systemd unit file
To run odoo as a service we will create a
odoo11.service unit file in the
/etc/systemd/system/ directory with the following contents:
[Unit] Description=Odoo11 Requires=postgresql.service After=network.target postgresql.service [Service] Type=simple SyslogIdentifier=odoo11 PermissionsStartOnly=true User=odoo Group=odoo ExecStart=/opt/odoo/odoo11-venv/bin/python3 /opt/odoo/odoo11/odoo-bin -c /etc/odoo11.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
Notify systemd that we created a new unit file and start the Odoo service by executing:
sudo systemctl daemon-reload sudo systemctl start odoo11
You can check the service status with the the following command:
sudo systemctl status odoo11
● odoo11.service - Odoo11 Loaded: loaded (/etc/systemd/system/odoo11.service; disabled; vendor preset: enabled) Active: active (running) since Tue 2018-01-23 21:09:25 UTC; 1s ago Main PID: 14146 (python3) CGroup: /system.slice/odoo11.service └─14146 /opt/odoo/odoo11-venv/bin/python3 /opt/odoo/odoo11/odoo-bin -c /etc/odoo11.conf
and if there are no errors you can enable the Odoo service to be automatically started at boot time:
sudo systemctl enable odoo11
If you want to see the messages logged by the Odoo service you can use the command below:
sudo journalctl -u odoo11
Test the Installation
Open your browser and type:
Assuming the installation is successful, a screen similar to the following will appear:
That’s it! This tutorial walked you through the installation of Odoo 11 on Ubuntu 16.04 in a Python virtual environment.
To learn how to configure your Odoo with with nginx as a reverse proxy and how to access your Odoo Installation via HTTPS you can check out the following post:
You may also want to check our tutorial about how to create automatic daily backups of your Odoo databases.
If you hit any problems, leave a comment below.