You are on page 1of 9

  Learn

News Terminal Tuts APPS DISTRO NewsLinux Live USB


Terminal Tuts APPS DISTRO Learn Linux Live USB

Home  CentOS

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.

CENTOS  Updated: October 2, 2019

doo is a business so ware that comes packed with CRM, e-commerce, billing, accoun ng, STAY CONNECTED
O project management, manufacturing, warehouse, and inventory apps. The Community
version is an open-source version, while the Enterprise version adds proprietary features and
23,343 LIKE
services to the Community edi on.
381 FOLLOW
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. 16 SUBSCRIBE

Installing Odoo 12 on CentOS


We shall execute commands using the root user. LATEST ARTICLES

1. Update System

yum update
Learn Linux Learn Linux

CentOS vs. Fedora: Key How to check the OS and


Differences Linux Version

Downloads Beginner's Guide

The 5 Best Free and Open- How to get the Size of a


Source PDF Editors Directory in Linux

Update Server

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

Downloads Beginner's Guide

The 10 Best Free and Open- Linux Vs. Windows: 10 Key


Source CAD Software Differences to Know

Load more 

MUST READ

System76 Lemur Pro Review

Update Completed

2. Configure Needed Repositories


Enable Epel repository:
 News Terminal Tuts APPS DISTRO Learn Linux Live USB

yum install epel-release


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.

Pop!_OS 20.04 Review: Professional Linux


Distribution Ever Made

Add EPEL Repository

Enable the So ware Collec ons (SCL) repository:

yum install centos-release-scl

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
Enable SCL Repository 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,
3. Install Python 3.6 and Dependencies and a ride through video.

yum install rh-python36  

FEATURED

Install Python 3.6

Test drive a Linux distro online 6 Best Linux Distributions for


Install needed dependencies. before you hate it Beginners

yum install bzip2-devel freetype-devel nodejs-less libxslt-devel openldap-dev

5 Best Video Players for Linux The 10 Best Open-Source


Photoshop Alternatives

Install Dependencies

4. Create Odoo User

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

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 https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-

Configure PostgreSQL Repository


Now Install PostgreSQL 11 server.
 News Terminal Tuts APPS DISTRO Learn Linux Live USB

yum install postgresql11-server

Install PostgreSQL 11

Ini alize PGDATA

Ini alize the database using the below command. It should create a data directory and other
configura on files on the system.

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

Initialize PGDATA

Now, check PostgreSQL Service Status.

systemctl status postgresql-11.service

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

Need to Check and Verify PostgreSQL Installa on.

su - postgres -c "psql"

Check Installation

If you want, you can create a password too.

\password postgres

Configure PostgreSQL Password

Create a PostgreSQL user.


su - postgres -c "createuser -s odoousr"
 News Terminal Tuts APPS DISTRO Learn Linux Live USB

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.

wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos7

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

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 https://www.github.com/odoo/odoo --depth 1 --branch 12.0 /opt/odoo/

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:
 News Terminal Tuts APPS DISTRO Learn Linux Live USB

cd /opt/odoo

Run the below command to create an environment.

python3 -m venv odoo12-venv

Ac vate the environment:

source odoo12-venv/bin/activate

Create Virtual Environment

Upgrade pip:

pip install --upgrade pip

Upgrade Pip

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

pip3 install wheel

pip3 install -r odoo12/requirements.txt


 News Terminal Tuts APPS DISTRO Learn Linux Live USB

Install Required Python Modules

A er installa on is complete, Deac vate the virtual environment and return to the root user.

Return to root

9. Other configura ons 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

Create a configura on 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:

[options]
; 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
 News Terminal Tuts APPS DISTRO Learn Linux Live USB

Configurations

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/odo

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

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
12. Browse Applica on
 News Terminal Tuts APPS DISTRO Learn Linux Live USB

http://Ip or domain name:8069

You will get the 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

[Unit]
Description=Odoo12
Requires=postgresql-11.service
After=network.target postgresql-11.service

[Service]
Type=simple
SyslogIdentifier=odoo12
PermissionsStartOnly=true
User=odoousr
Group=odoousr
ExecStart=/usr/bin/scl enable rh-python36 -- /opt/odoo/odoo12-venv/bin/python
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

Save, and exit.

Reload systemctl daemon.

systemctl daemon-reload

14. Now stop previously started odoo12

Check process.

ps -aux | grep odoo


 News Terminal Tuts APPS DISTRO Learn Linux Live USB

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

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 con nue

http://Ip Or Domain name:8069

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

Odoo DB Creation

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

You might also like