How To Install odoo

How To Install odoo

SHORT INTRODUCTION

There are many ways to install Odoo, or not install it at all, depending on the intended use case. These texts attempt to explain most of the input options.

Step 1: Update the system & Install the Extra Package (EPEL)in your system

$ sudo yum update -y
$ sudo yum install epel-release

Step 2: Install Python 3.5 packages and Odoo dependencies

Execute the following command to install Python 3.5 –

$ sudo yum install centos-release-scl
$ sudo yum install rh-python35
$ sudo yum install git gcc wget nodejs-less libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel

Step 3 : Create Odoo user

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

Step 4 : Install and configure PostgreSQL

$ sudo yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm -y
$sudo yum install postgresql96 postgresql96-server postgresql96-contrib postgresql96-libs -y

Initialize your database, start & enable postgresql services:

$ sudo /usr/pgsql-9.6/bin/postgresql96-setup
$sudo systemctl start postgresql-9.6.service
$sudo systemctl enable postgresql-9.6.serviceinitdb

Next, you need to create a PostgreSQL user who uses the same name as the user you are creating already for Odoo:

$ sudo su - postgres -c "createuser -s odoo"

Step 5 : Install Wkhtmltopdf

$ sudo cd /opt/
$ sudo wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm
$ sudo yum localinstall wkhtmltox-0.12.5-1.centos7.x86_64.rpm

Step 6 : Install and configure Odoo 12

$ sudo su - odoo

Clone the Odoo from the GitHub repository, enable and create a new virtual environment

$sudo git clone https://www.github.com/odoo/odoo --depth 1 --branch 12.0 /opt/odoo/odoo12
$sudo scl enable rh-python35 bash
$sudo cd /opt/odoo
$sudo python3 -m venv odoo12-venv

activate the virtual environment:

$sudo source odoo12-venv/bin/activate
$sudo pip install --upgrade pip
$sudo pip3 install wheel

Run the following command to install all the required Python modules you can deactivate the virtual environment:

$sudo install -r odoo12/requirements.txt
$sudo deactivate && exit
exit

Create a new directory and change the owner to odoo with the following commands Next step is to create a configuration file for the Odoo:

$sudo mkdir /opt/odoo/odoo12-custom-addons
$sudo chown odoo: /opt/odoo/odoo12-custom-addons
$sudo vi /etc/odoo.conf

paste the following lines in the configuration file:

[options]
; This is the password that allows database operations:
admin_passwd = master_password
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo12/addons
; You can enable log file with uncommenting the next line
; logfile = /var/log/odoo12/odoo.log
; If you are using custom modules
; addons_path = /opt/odoo/odoo12/addons,/opt/odoo/odoo12-custom-addons

Please do not forget to change the master_password with a new strong password.

Step 7: Create A Systemd Unit File​

In the next step, we will create a service unit file so we can run Odoo as a service.

Open your text editor :

$sudo vi /etc/systemd/system/odoo12.service

and paste the configuration below:

[Unit]
Description=Odoo12
Requires=postgresql-9.6.service
After=network.target postgresql-9.6.service
[Service]
Type=simple
SyslogIdentifier=odoo12
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/usr/bin/scl enable rh-python35 -- /opt/odoo/odoo12-venv/bin/python3 /opt/odoo/odoo12/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target

You need to reload the daemon so he can take the new unit that we created in systemd.

$sudo systemctl daemon-reload
$sudo systemctl start odoo12
$sudo systemctl status odoo12
$sudo systemctl enable odoo12

Step 8: Test The Installation​

Now when you have Odoo running on your server it is time to open your favorite browser and navigate to http://<your_server_IP_address>:8069

Similar Posts