Odoo (formerly known as OpenERP) is a suite of business management software that helps in managing businesses and organizations with CMS.
Odoo comes with a lot of tools required to manage your business, including, CRM, e-commerce, billing, accounting, manufacturing, warehouse, project management, and inventory management. It is a dynamic, customizable, flexible, user-friendly, scalable, modularity and up to date technology.
In this tutorial, we'll show you how to install Odoo 14 on CentOS 8.
- A server running on CentOS 8.
- A root password set up on your cloud server.
Before starting, you'll need to install some Python dependencies. You can install all of them with the following command:
# dnf install python3 python3-devel git gcc git redhat-rpm-config libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel
Once all dependencies are installed, you'll also need to install wkhtmltox to render HTML into PDF. You can install it with the following command:
# dnf install https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos8.x86_64.rpm
Once the installation has been completed, you can proceed to the next step.
Install and SetUp PostgreSQL
Odoo uses PostgreSQL as a database backend, so PostgreSQL must be installed in your system. If you don't have it installed, you can do it with the following command:
# dnf install @postgresql:12
Once the PostgreSQL is installed, initialize the database with the following command:
# postgresql-setup initdb
You should see the following output:
WARNING: using obsoleted argument syntax, try --help WARNING: arguments transformed to: postgresql-setup --initdb --unit postgresql * Initializing database in '/var/lib/pgsql/data' * Initialized, logs are in /var/lib/pgsql/initdb_postgresql.log
Next, start the PostgreSQL service and enable it to start at system reboot with the following command:
# systemctl enable --now postgresql
Next, create a user for Odoo with the following command:
# su - postgres -c "createuser -s odoo14"
Install Odoo 14
Before starting, you'll need to create a separate user to run Odoo 14. You can create it with the following command:
# useradd -m -U -r -d /opt/odoo14 -s /bin/bash odoo14
Odoo user must match with PostgreSQL database user.
Next, switch the user to odoo14 and download the Odoo 14 from the Git repository:
# su - odoo14
# git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 /opt/odoo14/odoo
Once the download is completed, change the directory to Odoo14 and create a Python virtual environment with the following command:
# cd /opt/odoo14
# python3 -m venv venv
Next, activate the virtual environment with the following command:
# source venv/bin/activate
Next, install the required Python dependencies with the following command:
# pip3 install -r odoo/requirements.txt
Once all the dependencies are installed, deactivate from the virtual environment with the following command:
Next, create a directory for custom addons:
Last, log out from the Odoo14 user with the following command:
Set Up Odoo14
In this step, you'll need to create a configuration file for Odoo14. You can do it with the following command:
# nano /etc/odoo14.conf
Add the following lines:
admin_passwd = admin-password
db_host = False
db_port = False
db_user = odoo14
db_password = False
addons_path = /opt/odoo14/odoo/addons, /opt/odoo14/odoo-custom-addons
Save and close the file when you are finished.
You can use "admin_passwd" to login to the Odoo14 web interface.
Create a Systemd Service File for Odoo14
Now you'll need to create a systemd unit file to manage the Odoo14 service. You can do it with the following command:
# nano /etc/systemd/system/odoo14.service
Add the following lines:
[Unit] Description=Odoo14 Requires=postgresql.service After=network.target postgresql.service [Service] Type=simple SyslogIdentifier=odoo14 PermissionsStartOnly=true User=odoo14 Group=odoo14 ExecStart=/opt/odoo14/venv/bin/python3 /opt/odoo14/odoo/odoo-bin -c /etc/odoo14.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
Save and close the file then reload the systemd daemon to apply the changes:
# systemctl daemon-reload
Next, start the Odoo14 service and enable it to start at system reboot:
# systemctl enable --now odoo14
You can verify the Odoo14 status with the following command:
# systemctl status odoo14
You should get the following output:
● odoo14.service - Odoo14 Loaded: loaded (/etc/systemd/system/odoo14.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2021-02-04 00:44:36 EST; 5s ago Main PID: 45125 (python3) Tasks: 4 (limit: 25014) Memory: 60.9M CGroup: /system.slice/odoo14.service └─45125 /opt/odoo14/venv/bin/python3 /opt/odoo14/odoo/odoo-bin -c /etc/odoo14.conf Feb 04 00:44:36 centos8 systemd: Started Odoo14. Feb 04 00:44:37 centos8 odoo14: /opt/odoo14/venv/lib64/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 whee> Feb 04 00:44:37 centos8 odoo14: """) Feb 04 00:44:37 centos8 odoo14: 2021-02-04 05:44:37,761 45125 INFO ? odoo: Odoo version 14.0 Feb 04 00:44:37 centos8 odoo14: 2021-02-04 05:44:37,762 45125 INFO ? odoo: Using configuration file at /etc/odoo14.conf Feb 04 00:44:37 centos8 odoo14: 2021-02-04 05:44:37,762 45125 INFO ? odoo: addons paths: ['/opt/odoo14/odoo/odoo/addons', '/opt/odoo14/> Feb 04 00:44:37 centos8 odoo14: 2021-02-04 05:44:37,762 45125 INFO ? odoo: database: [email protected]:default Feb 04 00:44:38 centos8 odoo14: 2021-02-04 05:44:38,057 45125 INFO ? odoo.addons.base.models.ir_actions_report: Will use the Wkhtmltopd> Feb 04 00:44:38 centos8 odoo14: 2021-02-04 05:44:38,437 45125 INFO ? odoo.service.server: HTTP service (werkzeug) running on centos8:80>
Set Up Firewall
At this point, Odoo14 is installed and listening on port 8069. Now, you'll need to allow port 8069 through a firewall. You can allow it with the following command:
# firewall-cmd --permanent --zone=public --add-port=8069/tcp
Next, reload the firewalld to apply the changes:
# firewall-cmd --reload
Access Odoo14 Web UI
Now, open your web browser and access the Odoo14 web interface using the URL http://your-server-ip:8069. You will be redirected to the following page:
Provide your master admin password, email, password and click on the "Create database" button. You will be redirected to the Odoo14 dashboard as shown below:
Congratulations! You have successfully installed and set up Odoo14 on CentOS 8.
You can now use Odoo14 in the production environment and start managing your business using Odoo's powerful features.