How To Install Odoo 11 In CentOS7.
In this tutorial, we’ll walk you through how to install Odoo 11 using Git source and Python virtual environment on a CentOS 7 machine.
Before you begin
Log in to you CentOS machine as a sudo user and update the system to the latest packages:
Enable the EPEL repository by typing:
We will install Python 3.5 packages from the Software Collections (SCL) repository.
By enabling SCL you will gain access to the newer versions of programming languages and services which are not available in the core repositories. Enable the SCL repository with the following command:
Install Python 3.5 packages, with the following command:
Finally install git, pip and all the tools required to build Odoo dependencies:
Create Odoo user
Create a new system user and group with home directory /opt/odoo that will run the Odoo service:
Install and configure PostgreSQL
Install the PostgreSQL server and create a new PostgreSQL database cluster:
Once the installation is completed, enable and start the PostgreSQL service:
Create a PostgreSQL user with the same name as the previously created system user, in our case odoo:
The wkhtmltox package provides a set of open-source command line tools which can render HTML into PDF and various image formats. In order to print PDF reports, you will need the wkhtmltopdf tool. The recommended version for Odoo is 0.12.1 which is not available in the official CentOS 7 repositories.
To download and install the recommended version run the following commands:
Install and configure Odoo 11
We will install Odoo from the GitHub repository so we can have more control over versions and updates. We will also use virtualenv which is a tool to create isolated Python environments.
Before starting with the installation process, make sure you [switch to the user] “odoo”:
To confirm that you are logged-in as odoo user you can use the following command:
Now we can start with the installation process, first clone the odoo from the GitHub repository:
Enable software collections so we can access the python 3.5 binaries:
Create a new virtual environment for our Odoo installation with:
activate the environment:
and install all required Python modules:
If you encounter any compilation errors during the installation, make sure that you installed all of the required dependencies listed in the Before you begin section.
Once the installation is completed deactivate the environment and switch back to your sudo user using the following commands:
If you plan to install custom modules it is best to install those modules in a separate directory. To create a new directory for the custom modules run:
Next, we need to create a configuration file:
Do not forget to change the superadmin_passwd to something more secure and adjust the addons_path if you’re using custom modules.
Create a systemd unit file
To run odoo as a service we will create a odoo11.service unit file in the /etc/systemd/system/ directory with the following contents:
Notify systemd that we have created a new unit file and start the Odoo service by executing:
You can check the service status with the following command:
and if there are no errors you can enable the Odoo service to be automatically started at boot time:
If you want to see the messages logged by the Odoo service you can use the command below:
Test the Installation
Open your browser and type: http://<your_domain_or_IP_address>:8069
This tutorial walked you through the installation of Odoo 11 on CentOS 7 in a Python virtual environment.