The installation of Odoo on Centos also involves installing PostgreSQL Database Server during the installation process.
Here ar Ibmi Media, as part of our Server Management Services, we regularly help our customers to install Software on their Server.
In this context, we shall look into how to install Odoo on CentOS.
How to install Odoo on CentOS?
Odoo is a very efficient business Software for running business applications from one web console.
To install Odoo on CentOS, you need to go through some set of procedure such as;
i. Adding EPEL Repository.
ii. PostgreSQL Database Server Installation.
iii. Odoo Installation
Now let us go through the whole process individually.
Adding EPEL Repository
The first step in getting Odoo installed is to add EPEL repository. Enable EPEL via the steps outlines here.
As soon as EPEL is enabled, put SELinux in permissive mode with the commands below;
sudo setenforce 0
sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config
Now you should update the system with the command below;
sudo yum -y update
PostgreSQL Database Server Installation
To install PostgreSQL Database Server, first add PostgreSQL Yum Repository with the command below;
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
PostgreSQL Yum Repository helps in the integration of the system patch management and also provides automatic updates for all supported versions of PostgreSQL.
To install PostgreSQL 12 with the YUM repository, make an installation of PostgreSQL client and server packages with the commands below;
sudo yum -y install epel-release yum-utils
sudo yum-config-manager --enable pgdg12
sudo yum install postgresql12-server postgresql12
Next, you should initialize the database service with the command below;
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
Now start the database server service with the command below;
sudo systemctl enable --now postgresql-12
Setting PostgreSQL admin user’s password
To set up PostgreSQL admin user password with the commands below;
sudo su - postgres
psql -c "alter user postgres with password 'StrongPassword'"
How to enable remote access for PostgreSQL?
Remote access can be enabled via the configuration file located at /var/lib/pgsql/12/data/postgresql.conf. You have to set the listen address to your Server IP affress or "*" for all interfaces as shown below;
listen_addresses = 'IP_address'
Additionally make some modifications in the /var/lib/pgsql/12/data/pg_hba.conf file so that it looks like this;
# Accept from anywhere
host all all 0.0.0.0/0 md5
# Accept from trusted subnet
host all all Subnet_address md5
After saving the modified file, do a restart of the database service with the command below;
sudo systemctl restart postgresql-12
To establist connection to the remote database, use the syntax below as per your case;
psql -U <dbuser> -h <serverip> -p 5432 <dbname>
Start by adding Odoo Yum repository to the Server system with the following commands;
sudo yum -y install yum-utils
sudo yum-config-manager --add-repo=http://nightly.odoo.com/13.0/nightly/rpm/odoo.repo
Now you can update the system packages and proceed with Odoo installation with the following commands;
sudo yum makecache fast
sudo yum install odoo
After the installation process, start the Odoo systemd service and set it at boot time with the following commands;
sudo systemctl enable odoo
sudo systemctl start odoo
Once started, the Odoo service will bind to TCP port 8069. To make this work, ensure that the port is allowed on the firewall.
How to use Odoo?
To access Odoo, user your server ip address and port on your browser as shown below;
The default password is "admin". You can set the name of the database, email address of the admin user and the password for the admin user.
To install other Odoo applications, simply use the Apps menu on the Odoo interface.