Odoo is one of the most popular business software in the world. Depending on the desired application, there are several options for installing Odoo.
The easiest and fastest way to install Odoo
is through the use of their official repositories.
If you want more control over versions and updates, or want to run multiple Odoo versions on your computer, this approach won’t work for you as the Odoo package doesn’t allow multiple Odoo installations on the same computer. In this case you can either use docker and docker compose or install Odoo in a virtual Python environment.
This guide describes the steps required to install and configure Odoo using Git source code and the Python virtual environment on Ubuntu 16.04.
before you start
Before proceeding with this tutorial, make sure that you are logged in as a user with sudo permissions.
Update the package index and any installed packages to the latest packages:
sudo apt update && sudo apt upgrade
Install Git, Pip, Node.js and the tools needed to create 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 a new group with a home directory
/opt/odoo which will run the Odoo service:
useradd -m -d /opt/odoo -U -r -s /bin/bash odoo
Install and configure PostgreSQL
Install the PostgreSQL package from Ubuntu’s standard repositories:
sudo apt install postgresql
After the installation is complete, create a new PostgreSQL user with the same name as the previously created system user, so in our case
sudo su - postgres -c "createuser -s odoo"
To print PDF reports, you need the
wkhtmltopdf Tool. The recommended version of Wkhtmltopdf is
0.12.1 which is not available in the official Ubuntu 16.04 repositories. We will download and install the recommended version from the official Wkhtmltopdf site.
Download the package with the following wget command:
Once the download is complete, install the package by typing:
sudo apt install ./wkhtmltox_0.12.1.3-1~xenial_amd64.deb
Install and configure Odoo
We’ll be installing Odoo from the GitHub repository in an isolated Python environment so we have more control over versions and updates.
Before starting the installation, make sure that you switch to the “odoo” user:
sudo su - odoo
To confirm that you are logged in as a user
odoo, use the following command:
Start the installation process by cloning the Odoo source code from the GitHub repository:
git clone https://www.github.com/odoo/odoo --depth 1 --branch 11.0 /opt/odoo/odoo11
- If you want to download and install a different Odoo version, just change the version number after the
- For example, you can download the Odoo source code at will
odoo11You can use your domain name.
virtualenv is a tool for creating isolated Python environments. To install it use:
pip3 install virtualenv
Create a new virtual Python environment for the Odoo installation with:
Activate the environment:
Install any required Python modules:
pip3 install -r odoo11/requirements.txt
Before you beginSection.
Once the installation is complete, disable the environment and switch back to your sudo user using the following commands:
If you plan to install additional modules, it is best to put those modules in a separate directory. To create a new directory for the additional modules, do the following:
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:
sudo nano /etc/odoo11.conf
[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
When you’re done, close and save the file.
my_admin_passwdon something safer and set the
addons_pathif you are using custom modules.
Create a systemd unit file
To run odoo as a service we need to a
odoo11.service unit file in the
Open your text editor and paste the following lines:
sudo nano /etc/systemd/system/odoo11.service
[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 a new unit file has been created and start the Odoo service by running:
sudo systemctl daemon-reload
sudo systemctl start odoo11
Check the service status with the following command:
sudo systemctl status odoo11
The output should look something like this to indicate that the Odoo service is up and running.
● 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
Activate the Odoo service so that it starts automatically when booting:
sudo systemctl enable odoo11
If you want to see the messages logged by the Odoo service, you can use the following command:
sudo journalctl -u odoo11
Test the installation
Open your browser and enter:
If the installation is successful, you will see a screen similar to the following:
At this point you have a working Odoo 11 installation. You can complete the installation by creating a new database and starting working on your project.
That’s it! This tutorial walked you through the installation of Odoo 11 on Ubuntu 16.04 in a virtual Python environment.
To learn how to configure your Odoo with Nginx as a reverse proxy and how to access your Odoo installation via HTTPS, you can read the following post:
Configure Odoo as a reverse proxy with Nginx
You can also read our tutorial on creating automatic daily backups of your Odoo databases.
If you have any problems please leave a comment below.