Install Odoo 12 on CentOS 7


5 min read


In this tutorial, we’ll show you how to install Odoo 12 from source inside a Python virtual environment on a CentOS 7 machine.


Make sure you are logged in as a user with sudo privileges before proceeding with the tutorial.

Install Python 3.6 and Odoo Dependencies

We will install Python 3.6 packages from the Software Collections (SCL) repository.

By enabling SCL you will gain access to the newer versions of programming languages and services which are not available in the core repositories.

Enable the EPEL and SCL repositories with the following command:

sudo yum install epel-release centos-release-scl

Once the repositories are enabled, install Python 3.6 all the tools required to build Odoo dependencies:

sudo yum install rh-python36 git gcc wget nodejs-less libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel

During the installation you will be prompted to accept the GPG keys.

Create Odoo User


sudo useradd -m -U -r -d /opt/odoo12 -s /bin/bash odoo12
You can name the user whatever you like, just make sure you create a PostgreSQL user with the same name.

Install and configure PostgreSQL

At the time of writing this article, the latest version of PostgreSQL available from the CentOS repositories is PostgreSQL version 9.2 which is not officially supported by Odoo.

We’ll install PostgreSQL 10 from the official PostgreSQL repositories.

Start by enabling the PostgreSQL repository:

sudo yum install

Install the PostgreSQL server and create a new PostgreSQL database cluster:

sudo yum install postgresql10-server postgresql10-devel

Once the installation is completed, enable and start the PostgreSQL service:

sudo systemctl enable postgresql-10
sudo systemctl start postgresql-10

Create a PostgreSQL user with the same name as the previously created system user, in our case odoo12:

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

Install Wkhtmltopdf


Download the recommended version with the following wget command:


Once the download is complete, install the rpm package by typing:

sudo yum localinstall wkhtmltox-0.12.1_linux-centos7-amd64.rpm

Install and Configure Odoo 12

Before starting with the installation process, make sure you switch to user “odoo12”:

sudo su - odoo12

Start by cloning the Odoo 12 source code from the Odoo GitHub repository:


Enable software collections so we can access the python 3.6 binaries:

scl enable rh-python36 bash

Create a new Python virtual environment for the Odoo installation with:

cd /opt/odoo12
python3 -m venv venv

Activate the environment:

source venv/bin/activate

Install all required Python modules:

pip3 install -r odoo/requirements.txt
If you encounter any compilation errors during the installation, make sure that you installed all of the required dependencies listed in the Install Python 3.6 and Odoo Dependencies section.

Once the installation is completed deactivate the environment using the following command:


Create a new directory for the custom addons:

mkdir /opt/odoo12/odoo-custom-addons

Switch back to your sudo user:


Next, open your text editor and create the following configuration file:

sudo nano /etc/odoo12.conf
; This is the password that allows database operations:
admin_passwd = superadmin_passwd
db_host = False
db_port = False
db_user = odoo12
db_password = False

Save and close the file.

Do not forget to change the superadmin_passwd to something more secure.

Create a systemd unit file

To run Odoo as a service we will create a unit file.

Open your text editor and create a file named odoo12.service inside the /etc/systemd/system/ directory:

sudo nano /etc/systemd/system/odoo12.service

Paste the following content:

Requires=postgresql-10.service postgresql-10.service

ExecStart=/usr/bin/scl enable rh-python36 -- /opt/odoo12/venv/bin/python3 /opt/odoo12/odoo/odoo-bin -c /etc/odoo12.conf


Save the file and close the editor.

Notify Systemd that we created a new unit file:

sudo systemctl daemon-reload

Start and enable the Odoo service by executing:

sudo systemctl enable odoo12
sudo systemctl start odoo12

You can check the service status with the following command:

sudo systemctl status odoo12
● odoo12.service - Odoo12
   Loaded: loaded (/etc/systemd/system/odoo12.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-10-30 16:35:09 UTC; 6s ago
 Main PID: 24649 (scl)
   CGroup: /system.slice/odoo12.service
           ├─24650 /bin/bash /var/tmp/scldyaa9h


sudo journalctl -u odoo12

Test the Installation



If you can’t access the page then probably your firewall is blocking port 8069.

Use the following commands to open the necessary port:

sudo firewall-cmd --reload


This tutorial walked you through the installation of Odoo 12 on CentOS 7 in a Python virtual environment.


If you hit any problems, leave a comment below.