How to install Odoo 12 with PostgreSQL 11 on CentOS 7

The Community version of Odoo is an open-source version, while the Enterprise version adds proprietary features and services to the Community edition. We shall focus on the open-source version installation.

Odoo is a business software that comes packed with CRM, e-commerce, billing, accounting, project management, manufacturing, warehouse, and inventory apps. The Community version is an open-source version, while the Enterprise version adds proprietary features and services to the Community edition.

At FOSS Linux, we are focused on open-source apps, so in this tutorial, we are going to install and configure the Oddo community version on CentOS.

Installing Odoo 12 on CentOS

We shall execute commands using the root user.

1. Update System

yum update

Update Server
Update Server

The server will ask to update or no. Type “y” and hit enter. It will get some time to update the system.

Update Completed
Update Completed

2. Configure Needed Repositories

Enable Epel repository:

yum install epel-release

Add EPEL Repository
Add EPEL Repository

Enable the Software Collections (SCL) repository:

yum install centos-release-scl

Enable SCL Repository

Enable SCL Repository

3. Install Python 3.6 and Dependencies

yum install rh-python36

Install Python 3.6
Install Python 3.6

Install needed dependencies.

yum install bzip2-devel freetype-devel nodejs-less libxslt-devel openldap-devel libjpeg-devel gcc

Install Dependencies
Install Dependencies

4. Create Odoo User

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

Create Odoo User
Create Odoo User

5. Install and configure PostgreSQL

Check repositories from the official site and install the Postgres repository for Centos 7 64bit.

rpm -Uvh

Configure PostgreSQL Repository
Configure PostgreSQL Repository

Now Install PostgreSQL 11 server.

yum install postgresql11-server

Install PostgreSQL 11
Install PostgreSQL 11

Initialize PGDATA

Initialize the database using the below command. It should create a data directory and other configuration files on the system.

/usr/pgsql-11/bin/postgresql-11-setup initdb

Initialize PGDATA
Initialize PGDATA

Now, check PostgreSQL Service Status.

systemctl status postgresql-11.service

PostgreSQL Service Status
PostgreSQL Service Status

If service is not started. Run the following command to start service:

systemctl start postgresql-11.service

Enable service on the system boot.

systemctl enable postgresql-11.service

Enable Service OnBoot
Enable Service OnBoot

Need to Check and Verify PostgreSQL Installation.

su - postgres -c "psql"

Check Installation
Check Installation

If you want, you can create a password too.

 \password postgres

Configure PostgreSQL Password.
Configure PostgreSQL Password

Create a PostgreSQL user.

su - postgres -c "createuser -s odoousr"

Create PostgreSQL User
Create PostgreSQL User

6. Install Wkhtmltopdf

It is an open-source tool that Odoo uses to make HTML in PDF formats so that it can print PDF reports.


Download Package
Download Package

“wget” is not available. need to install it first

yum install wget -y

Install the downloaded package using below command:

yum localinstall wkhtmltox-0.12.5-1.centos7.x86_64.rpm

Install wkhtmltopdf Package
Install wkhtmltopdf Package

7. Install and configure Odoo 12

Git is not installed on your system Install git first.

 yum install git -y

Change user to odoo user:

su - odoousr

Now we are going to clone odoo 12 from its repository. We are going to download it to the “/opt/odoo/odoo12” directory.

git clone --depth 1 --branch 12.0 /opt/odoo/odoo12

Git Clone Odoo12
Git Clone Odoo12

To enable python36, run the following command:

scl enable rh-python36 bash

8. Create a new virtual environment

Go to odoo directory:

cd /opt/odoo

Run the below command to create an environment.

python3 -m venv odoo12-venv

Activate the environment:

source odoo12-venv/bin/activate

Create Virtual Environment
Create Virtual Environment

Upgrade pip:

pip install --upgrade pip

Upgrade Pip
Upgrade Pip

Install the Wheel library, followed by all the required Python modules.

pip3 install wheel
pip3 install -r odoo12/requirements.txt

Install Required Python Modules
Install Required Python Modules

After installation is complete, Deactivate the virtual environment and return to the root user.

Return to root
Return to root

9. Other configurations for Odoo12

Create a directory for custom modules.

 mkdir /opt/odoo/odoo12-custom-addons
chown odoousr: /opt/odoo/odoo12-custom-addons

Folder For Custom Modules
Folder For Custom Modules

Create a configuration file for the Odoo12.

vim /etc/odoo12.conf

If vim is not available, you should install it first, or you can use any editor of your choice.

yum install vim

Add the following lines to file:

; This is the password that allows database operations:
admin_passwd = Foss@343fd<?Linux
db_host = False
db_port = False
db_user = odoousr
db_password = False
addons_path = /opt/odoo/odoo12/addons,/opt/odoo/odoo12-custom-addons
logfile = /var/log/odoo12/odoo.log


Save, and exit. Then create a log folder and grant permission to it.

mkdir -p /var/log/odoo12
chown -R odoousr: /var/log/odoo12

10. Manually start odoo12

Now start service and check whether it is working correctly. Change the user and then start command.

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

Start Service
Start Service

Check Odoo12 port is up and running. Then open another terminal and run below command:

netstat -tunlp | grep 8069

Odoo12 Port

11. Configure firewall

Check firewall status.

systemctl status firewalld

Firewall Status
Firewall Status

If the service has not started, start it using the following command:

systemctl start firewalld

Add firewall rules and reload firewall:

firewall-cmd --zone=public --permanent --add-service=http
firewall-cmd --zone=public --permanent --add-port=8069/tcp
systemctl reload firewalld

Firewall Rules
Firewall Rules

12. Browse Application

http://Ip or domain name:8069

You will get the Start page.

Start Page
Start Page

If you get a “Service Unavailable” message, temporary change Selinux mode.

setenforce 0

13. Configure Odoo12 run as a Service

Create a systemd file and add the following content to the file:

vim /etc/systemd/system/odoo12.service
Requires=postgresql-11.service postgresql-11.service

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


Save, and exit.

Reload systemctl daemon.

systemctl daemon-reload

14. Now stop previously started odoo12

Check process.

ps -aux | grep odoo

Odoo Process

Odoo ProcessKill process.

kill -9 28416 28417 28420

Make sure to replace process IDs with yours.

15. Now start odoo12  service

systemctl start odoo12

Check status.

systemctl status odoo12

Odoo Service Status
Odoo Service Status

Monitor the log file using the following command:

tail -f /var/log/odoo12/odoo.log

Check status and enable Odoo service on system boot.

systemctl enable odoo12

16. Browse the web site and continue

http://Ip Or Domain name:8069

Add a Master password, database name, and other details.

Odoo DB Creation
Odoo DB Creation

Then click “create database” (Here I added demo data too). You should be redirected to the welcome page.

Welcome Page
Welcome Page

After sign out from the above page, you should go to the login page.

Login Page
Login Page

That’s all about the installation of the latest Odoo 12 on Centos 7. I hope you enjoyed the tutorial.

Hey! I'm Darshana, a Linux / DevOps Engineer and also a contributor to FOSS Linux. I enjoy working on various kind of Linux distributions and cloud technologies. During my free time, I love to swim and hike across nature trails. Linux is my love and I'm here to share all my learnings with all of you! Hope you enjoyed reading my article.


Please enter your comment!
Please enter your name here





Buyers who wish to go for a machine that is based on Linux often show interest in Chromebooks due to the form factor and extended battery life capabilities. Although ChromeOS power these machines, users can still miss out on a more genuine Linux experience. For those who happen to agree, the new Lemur Pro by System76 might get some heads turning.
Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.

The 10 Best Open-Source Photoshop Alternatives

We all know how much Photoshop is loved by designers all over the globe, all thanks to its multitude of features and excellent user interface. With that being said, not everyone would be able to afford its monthly subscription plan that costs a whopping $20.99, which could make individuals who are just getting into this field take a step back and think about other available options.

How to dual-boot Ubuntu and Fedora on your PC

Every Linux distribution has its capabilities and preferences as per the user requirements. That brings forth the need to run different distros on one laptop. For example, a CyberSecurity enthusiast might prefer to use Ubuntu for development and Kali Linux for penetration testing.

5 Best Application Launchers for Ubuntu

Ubuntu is one of the most used Linux distributions worldwide. It is also the reason why it has the maximum number of available programs for itself. Today we are going to talk about one category of those programs, the application launchers.

Installing multiple Linux distros on a USB drive

A bootable Linux USB drive, which also referred to as a Live USB drive, is a drive containing files that enable a computer to boot into a specific Linux distro. It is most commonly used to test-drive various Linux distros before installing on the computer for use as a daily driver.