Set up Odoo 12 on CentOS 7

Odoo is the most well-liked all-in-one enterprise software program on the earth. It affords a spread of enterprise purposes together with CRM, web site, e-Commerce, billing, accounting, manufacturing, warehouse, mission administration, stock and rather more, all seamlessly built-in.

On this tutorial, we’ll present you the way to set up Odoo 12 from supply inside a Python digital atmosphere on a CentOS 7 machine.

Conditions

Be sure you are logged in as a consumer with sudo privileges earlier than continuing with the tutorial.

Set up Python 3.6 and Odoo Dependencies

We’ll set up Python 3.6 packages from the Software program Collections (SCL) repository.

By enabling SCL you’ll acquire entry to the newer variations of programming languages and companies which aren’t obtainable within the core repositories.

Allow the EPEL and SCL repositories with the next command:

sudo yum set up epel-release centos-release-scl

As soon as the repositories are enabled, set up Python 3.6 all of the instruments required to construct Odoo dependencies:

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

Throughout the set up you’ll be prompted to just accept the GPG keys.

Create Odoo Consumer

Create a brand new system consumer and group with dwelling listing /decide/odoo that can run the Odoo service:

sudo useradd -m -U -r -d /decide/odoo12 -s /bin/bash odoo12

You possibly can title the consumer no matter you want, simply ensure you create a PostgreSQL consumer with the identical title.

Set up and configure PostgreSQL

On the time of writing this text, the most recent model of PostgreSQL obtainable from the CentOS repositories is PostgreSQL model 9.2 which isn’t formally supported by Odoo.

We’ll set up PostgreSQL 10 from the official PostgreSQL repositories.

Begin by enabling the PostgreSQL repository:

sudo yum set up https://obtain.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm

Set up the PostgreSQL server and create a brand new PostgreSQL database cluster:

sudo yum set up postgresql10-server postgresql10-devel
sudo /usr/pgsql-10/bin/postgresql-10-setup initdb

As soon as the set up is accomplished, allow and begin the PostgreSQL service:

sudo systemctl allow postgresql-10
sudo systemctl begin postgresql-10

Create a PostgreSQL consumer with the identical title because the beforehand created system consumer, in our case odoo12:

sudo su – postgres -c “createuser -s odoo12”

Set up Wkhtmltopdf

The wkhtmltox bundle gives a set of open supply command line instruments which may render HTML into PDF and numerous picture codecs. So as to print PDF experiences, you will want the wkhtmltopdf software. The advisable model for Odoo is 0.12.1 which isn’t obtainable within the official CentOS 7 repositories.

Obtain the advisable model with the next wget command:

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/obtain/0.12.1/wkhtmltox-0.12.1_linux-centos7-amd64.rpm

As soon as the obtain is full, set up the rpm bundle by typing:

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

Set up and Configure Odoo 12

Earlier than beginning with the set up course of, ensure you swap to odoo12 consumer.

Begin by cloning the Odoo 12 supply code from the Odoo GitHub repository:

git clone https://www.github.com/odoo/odoo –depth 1 –branch 12.0 /decide/odoo12/odoo

Allow software program collections so we will entry the python 3.6 binaries:

scl allow rh-python36 bash

Create a brand new Python digital atmosphere for the Odoo set up with:

cd /decide/odoo12
python3 -m venv venv

Activate the atmosphere:

Set up all required Python modules:

pip3 set up -r odoo/necessities.txt

In the event you encounter any compilation errors throughout the set up, just be sure you put in all the required dependencies listed within the Set up Python 3.6 and Odoo Dependencies part.

As soon as the set up is accomplished deactivate the atmosphere utilizing the next command:

Create a brand new listing for the {custom} addons:

mkdir /decide/odoo12/odoo-custom-addons

Change again to your sudo consumer:

Subsequent, open your textual content editor and create the next configuration file:

sudo nano /and so on/odoo12.conf

/and so on/odoo12.conf

[options]
; That is the password that enables database operations:
admin_passwd = superadmin_passwd
db_host = False
db_port = False
db_user = odoo12
db_password = False
addons_path = /decide/odoo12/odoo/addons, /decide/odoo12/odoo-custom-addons

Save and shut the file.

Don’t forget to alter the superadmin_passwd to one thing safer.

Create a systemd unit file

To run Odoo as a service we are going to create a unit file.

Open your textual content editor and create a file named odoo12.service contained in the /and so on/systemd/system/ listing:

sudo nano /and so on/systemd/system/odoo12.service

Paste the next content material:

/and so on/systemd/system/odoo12.service

[Unit]
Description=Odoo12
Requires=postgresql-10.service
After=community.goal postgresql-10.service

[Service]
Sort=easy
SyslogIdentifier=odoo12
PermissionsStartOnly=true
Consumer=odoo12
Group=odoo12
ExecStart=/usr/bin/scl allow rh-python36 — /decide/odoo12/venv/bin/python3 /decide/odoo12/odoo/odoo-bin -c /and so on/odoo12.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.goal

Save the file and shut the editor.

Notify Systemd that we created a brand new unit file:

sudo systemctl daemon-reload

Begin and allow the Odoo service by executing:

sudo systemctl allow odoo12
sudo systemctl begin odoo12

You possibly can test the service standing with the next command:

sudo systemctl standing odoo12● odoo12.service – Odoo12
Loaded: loaded (/and so on/systemd/system/odoo12.service; disabled; vendor preset: disabled)
Lively: lively (operating) since Tue 2018-10-30 16:35:09 UTC; 6s in the past
Important PID: 24649 (scl)
CGroup: /system.slice/odoo12.service
├─24649 /usr/bin/scl allow rh-python36 — /decide/odoo12/venv/bin/python3 /decide/odoo12/odoo/odoo-bin -c /and so on/odoo12.conf
├─24650 /bin/bash /var/tmp/scldyaa9h
└─24653 /decide/odoo12/venv/bin/python3 /decide/odoo12/odoo/odoo-bin -c /and so on/odoo12.conf

If you wish to see the messages logged by the Odoo service you should use the command beneath:

sudo journalctl -u odoo12

Check the Set up

Open your browser and sort: http://<your_domain_or_IP_address>:8069

Assuming the set up is profitable, a display screen just like the next will seem:

In the event you can’t entry the web page then most likely your firewall is obstructing port 8069.

Use the next instructions to open the required port:

sudo firewall-cmd –permanent –zone=public –add-port=8069/tcp
sudo firewall-cmd –reload

Conclusion

This tutorial walked you thru the set up of Odoo 12 on CentOS 7 in a Python digital atmosphere.

You may additionally wish to test our tutorial about the way to create automated each day backups of your Odoo databases.

In the event you hit any issues, depart a remark beneath.

Supply

Germany Devoted Server

Leave a Reply