Odoo is an all-in-one management software that offers a range of business applications that form a complete suite of enterprise management applications targeting companies of all sizes. Odoo is an all-in-one business software including CRM, website/e-commerce, billing, accounting, manufacturing, warehouse - and project management, and inventory.
There are two different versions of Odoo: the Community and Enterprise versions. In this guide, we are going to be installing the Community version as this is freely available to anyone.
Deploying your cloud server
If you have not already registered with Cloudwafer, you should begin by getting signed up. Take a moment to create an account after which you can easily deploy your own cloud servers.
Updating System Packages
It is always recommended that you update the system to the latest packages before beginning any major installations. This is done with the command below:
sudo yum update
Next, we need to enable the EPEL repository by typing:
sudo yum install epel-release
Odoo requires Python 3.5, so we are going to install the packages from the Software Collections (SCL) repository. Enable the SCL repository with the following command:
sudo yum install centos-release-scl
Proceed to install Python 3.5 packages with the command below:
sudo yum install rh-python35
Building Odoo requires some dependencies such as git and pip. Type the command below to install the necessary dependencies:
sudo yum install git gcc wget nodejs-less libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel postgresql-devel
We need to create a new system user and group with the home directory
**/opt/odoo**. This is the user that will run the Odoo service. Note the name of the
newly created user here as it is vital in the next user step. In this guide, the user we are creating is named odoo.
sudo useradd -m -U -r -d /opt/odoo -s /bin/bash odoo
Odoo needs a PostgreSQL server to run properly which we are going to be installing in this step. Type the command below to install and initialize the database:
sudo yum install postgresql-server
sudo postgresql-setup initdb
After initialization, enable and start the PostgreSQL service:
sudo systemctl enable postgresql sudo systemctl start postgresql
We need to create a PostgreSQL user; this username has to be the same has to be the same name as the previously created system user, in our case odoo:
sudo su - postgres -c "createuser -s odoo"
Step Five: Install Wkhtmltopdf
In order to print PDF reports, you will need to install the wkhtmltopdf tool. The recommended version for Odoo is 0.12.1 which is not available in the official CentOS 7 repositories but can be found by visiting the download page. Type the commands below to download and install the tool:
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.1/wkhtmltox-0.12.1_linux-centos7-amd64.rpm sudo yum localinstall wkhtmltox-0.12.1_linux-centos7-amd64.rpm
Step Six: Install and Configure Odoo
Before starting with the installation process, we need to switch to the odoo user that was created earlier.
sudo su - odoo
Next, we are going to install Odoo from the GitHub repository so we can have more control over versions and updates.
git clone https://www.github.com/odoo/odoo --depth 1 --branch 11.0 /opt/odoo/odoo11
Enable software collections so we can access the python 3.5 binaries:
scl enable rh-python35 bash
We will also use virtualenv which is a tool to create isolated Python environments. Create a new virtual environment for our Odoo installation with:
cd /opt/odoo python3 -m venv odoo11-venv
Next, activate the environment created with the command below:
Proceed to install all required Python modules with the command below:
pip3 install -r odoo11/requirements.txt
After completing the installation, deactivate the environment and switch back to your sudo user using the following commands:
deactivate && exit exit
Note: If you want to install custom modules it is advisable to install those modules in a separate directory. To create a new directory for the custom modules run:
sudo mkdir /opt/odoo/custom-addons-for-odoo11 sudo chown odoo: /opt/odoo/custom-addons-for-odoo11
Lastly in this section, we need to create a configuration file:
sudo nano /etc/odoo11.conf [options] ; This is the password that allows database operations: admin_passwd = admin_password db_host = False db_port = False db_user = odoo db_password = False addons_path = /opt/odoo/odoo11/addons ; If you are using custom modules ; addons_path = /opt/odoo/odoo11/addons,/opt/odoo/custom-addons-for-odoo11
Note: Remember to change the adminpasswd to a more secure password and modify the addons_path if you are using custom modules.
Save and close the file.
We need to create a systemd unit file called odoo11.service in order to run odoo as a service unit file in the /etc/systemd/system/ directory with the following contents:
sudo nano /etc/systemd/system/odoo11.service [Unit] Description=Odoo11 Requires=postgresql.service After=network.target postgresql.service [Service] Type=simple SyslogIdentifier=odoo11 PermissionsStartOnly=true User=odoo Group=odoo ExecStart=/usr/bin/scl enable rh-python35 -- /opt/odoo/odoo11-venv/bin/python3 /opt/odoo/odoo11/odoo-bin -c /etc/odoo11.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
Save and close the file.
Next, we need to reload systemd since we just created a new unit file and start the Odoo service by executing:
sudo systemctl daemon-reload sudo systemctl start odoo11
We can now check the service status with the command below:
sudo systemctl status odoo11
If there are no errors, you can enable the Odoo service to be automatically started at boot time with the command below:
sudo systemctl enable odoo11
Odoo, by default, uses the port 8069, therefore you are going to open the port on your firewall (CSF) using the command below:
Navigate to the SECTION:IPv4 Port Settings and add 8069 to the list of ports.
Finally,open your browser and type: your _ domain _ or _ IP _ address:8069
Assuming the installation is successful, you should see something similar to the screenshot below:
You have successfully completed the installation of Odoo 11 on CentOS 7.