Install Odoo 8 (OpenERP) in CentOS & Red Hat Enterprise Linux

»»»Install Odoo 8 (OpenERP) in CentOS & Red Hat Enterprise Linux
Odoo, previously known as OpenERP, is an open source traditional ERP (Enterprise Resource Planning) business apps which also comes with many additional modules that help to manage the tasks such as building e-commerce websites, point of sales (POS), customer relationship management (CRM), quotations, project management, billing, invoicing, accounting, inventory management, purchasing, mailing lists, lead automation, survey, forum, live chat, instant messaging, human resource management including leaves, appraisal and recruitment, business intelligence, and other apps to boost productivity and increase sales.

So you want to install Odoo for your company or business? Follow the tutorial to install Odoo 8, the latest version of Odoo on CentOS 7, which should work also in related distributions such as Red Hat Enterprise Linux (RHEL) and Scientific Linux (possibly with slight change in command i.e. systemctl vs service etc).

Installing PostgreSQL

Unlike most other web apps which are using MySQL or MariaDB, Odoo (and OpenERP) uses PostgreSQL database system. Install PostgreSQL using the following command:

yum install postgresql postgresql-server postgresql-libs

After installing the PostgreSQL, initialize the database with the following command:

postgresql-setup initdb

Make sure that the PostgreSQL service is enabled on boot and start the PostgreSQL server if it’s not running:

systemctl enable postgresql
systemctl start postgresql

A user named “postgres” with blank password (no password) is created by default as system user and database user. System user postgres is locked and disabled by default and thus does not accept login except su from root. To secure the system, change the password for database user with the following commands (you must be root to be able to su to postgres user):

# su - postgres
$ psql
postgres=# \password postgres
Enter new password:
Enter it again:
postgres=# \q
$ exit
Tip
If you have no access to root, use the following commands to set the postgres database user password.

$ sudo -u postgres psql
postgres=# \password postgres

Install EPEL (Extra Packages for Enterprise Linux)

Odoo (or OpenERP) depends on Phython runtime and many other packages that are not included in default standard repository. As such, add the Extra Packages for Enterprise Linux (or EPEL) repository support so that Odoo can get whatever dependencies it required.

yum install epel-release

Add Odoo 8 Repository

Create a file named odoo.repo in /etc/yum.repos.d/ directory, with the following content:

[odoo-nightly]
name=Odoo Nightly repository
baseurl=http://nightly.odoo.com/8.0/nightly/rpm/
enabled=1
gpgcheck=1
gpgkey=https://nightly.odoo.com/odoo.key
Note
Alternatively, you can use yum-config-manage to automatically add the Odoo repo:

yum-config-manager --add-repo = https://nightly.odoo.com/8.0/nightly/rpm/odoo.repo

Or, you can download the odoo.repo directly:

wget https://nightly.odoo.com/8.0/nightly/rpm/odoo.repo

Install Odoo and Dependencies Automatically

Start the Odoo installation process with the following command. Yum is smart enough to include all required dependencies, including Python packages, at the same time.

yum install odoo

Install Odoo (OpenERP)

What the installation did was add a local user account and local group account named “odoo”, which own most Odoo files. By default, the local user account is disabled and locked so that no login is possible, except su from root.

In addition, a user account named “odoo” is also created in PostgreSQL database.

Additionally, the Odoo configuration file is created as in /etc/openerp-server.conf or /etc/odoo/openerp-server.conf, which saves the database connection details (No amendment is necessary unless your PostgreSQL DBMS is hosted remotely, has a different port. By default, PostgreSQL allows ident or peer authentication for connection from localhost, which uses client’s operating system user name from kernel or an ident server, and using it as the allowed database user name), and a systemd unit file for Odoo is placed in /usr/lib/systemd/system/odoo.service to allow automatic start of Odoo after server is booted.

Enable Odoo to automatically start the service on system startup and immediately run the Odoo service with following commands:

systemctl enable odoo
systemctl start odoo

Open Odoo Port in Firewall

Odoo uses port 8069. Use the following commands to open up the port if you’re accessing remotely:

firewall-cmd --zone=pubic --add-port=8069/tcp --permanent  
firewall-cmd --reload 

Change PostgreSQL template0 / template1 Character Encoding to UTF8

Odoo 8 is using UTF-8 as character encoding. If you’re not setting UTF-8 as your locale and didn’t specify UTF-8 when initiating PostgreSQL database, chance is PostgreSQL database system and its template0 or template1 standard system databases which new databases are based on may be using SQL_ASCII Latin1 encoding, and Odoo will return an error during its initial setup.

To change the encoding of PostgreSQL, login as root (postgres requires root to su into) and perform the following:

# su - postgres
$ psql
postgres=# update pg_database set encoding = 6, datcollate = 'en_US.UTF8', datctype = 'en_US.UTF8' where datname = 'template0';
postgres=# update pg_database set encoding = 6, datcollate = 'en_US.UTF8', datctype = 'en_US.UTF8' where datname = 'template1';
postgres=# \q
$ exit

Restart the PostgreSQL if necessary:

systemctl restart postgresql
Tip
/var/lib/pgsql/data/pg_hba.conf is the file which controls access to PostgreSQL databases. By default, only connections from localhost are allowed. If you want to allow remote access to PostgreSQL databases, such as in the case of setting up dedicated database server, add the following line to pg_hba.conf configuration file:

host    all             all             0.0.0.0/0            md5

Access and Configure Odoo (OpenERP)

Access the Odoo at the URL: http://host-IP-address:8069/.

Odoo First Launch

On your first visit, you will arrive at a Database Manager and you need to create a new database and set the password for “admin” account. Once set up, you can log in to the Odoo to install modules and start using the ERP system with user name “admin” and the password you set when creating the database.

By | 2016-12-09T08:39:14+00:00 December 9th, 2016|Categories: Enterprise Solutions|Tags: , , , , , |5 Comments

About the Author:

LK is a technology writer for Tech Journey with background of system and network administrator. He has be documenting his experiences in digital and technology world for over 15 years.Connect with LK through Tech Journey on Facebook, Twitter or Google+.
  • Kyle

    Thank you for the guide, but I tried to install Odoo and failed. Perhaps, I am not technically skilled to complete such an operation. Anyway, it is always good to have an alternative such as fully managed support. In my case, I am customer at https://rosehosting.com and I asked their support to install Odoo for me, which they did. Thanks again, I am sure the guide works but it is over my head.

  • Ugo Souza

    worked for me (odoo 9) Thanks!

    • ravi kumar

      Hi guys,
      Actually I am new to using odoo 9, want to install on my inmotion vps server.
      Operating system is centos 6.
      After finding many solutions no exact solution found that how to install odoo 9 on my server for online use.

      Can you please guide me?
      I will be more than Thankful to you.

      Thanks

  • Was a user of odoo. Changed our product to http://eduflex.co.in

  • Salman

    I am using an apache server in centos with WHM, do i need to remove maria-db to install odoo?
    because if i remove maira-db then how will i use mysql or mysqli.
    Please help in this matter.
    Thanks,

Pin It on Pinterest

Share This

Share This

Share this post with your friends!