Odoo is a group of business management software tools that include features for billing, accounting, eCommerce, CRM, warehouse, project management, and inventory management. It is designed for small and medium businesses and is available in the cloud or on-premise. It is user-friendly, scalable, customizable, flexible, and helps you manage businesses and organizations with a CMS.

In this post, we will show you how to install Odoo 14 in Rocky Linux 8.

Step 1 – Install Python packages and Odoo Dependencies

Before starting, install the EPEL repository using the following command:

dnf install epel-release -y

Once EPEL is installed, run the following command to install Python and Odoo dependencies:

dnf install python3 python3-devel git gcc git redhat-rpm-config libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel -y

Next, install the wkhtmltox to render HTML into a PDF using the following command:

dnf install https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos8.x86_64.rpm

Step 2 – Install PostgreSQL

Odoo uses PostgreSQL as a database backend. You can install it using the following command:

dnf install @postgresql:12

After installing PostgreSQL, initialize the PostgreSQL database with the following command:

postgresql-setup initdb

Sample 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:

systemctl enable --now postgresql

Next, create a user for Odoo with the following command:

su - postgres -c "createuser -s odoo14"

Step 3 – Install Odoo 14

First, add an odoo user to run the Odoo service:

useradd -m -U -r -d /opt/odoo14 -s /bin/bash odoo14

Next, log in with the odoo user and download Odoo version 14 using the following command:

su - odoo14
git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 /opt/odoo14/odoo

Next, change the directory to /opt/odoo14 and create a Python virtual environment:

cd /opt/odoo14
python3 -m venv odooenv

Next, activate the virtual environment:

source odooenv/bin/activate

Next, install the required dependencies using the following command:

pip3 install -r odoo/requirements.txt

Next, deactivate the virtual environment with the following command:

deactivate

Next, create an addons directory and exit from the odoo user with the following command:

mkdir /opt/odoo14/odoo-custom-addons
exit

Next, create an Odoo configuration file using the following command:

nano /etc/odoo14.conf

Add the following lines:

[options]
admin_passwd = secure-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.

Step 4 – Create an Odoo Service File

Next, you will need to create a service file to manage the Odoo service. You can create it using the following command:

nano /etc/systemd/system/odoo.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/odooenv/bin/python3 /opt/odoo14/odoo/odoo-bin -c /etc/odoo14.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

Save the file, then reload the systemd daemon with the following command:

systemctl daemon-reload

Next, start the enable the Odoo service using the following command:

systemctl enable --now odoo

You can check the status of the Odoo service using the following command:

systemctl status odoo

Sample output:

● odoo.service - Odoo14
   Loaded: loaded (/etc/systemd/system/odoo.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2021-09-14 09:52:11 UTC; 6s ago
 Main PID: 37537 (python3)
    Tasks: 4 (limit: 23695)
   Memory: 90.6M
   CGroup: /system.slice/odoo.service
           └─37537 /opt/odoo14/odooenv/bin/python3 /opt/odoo14/odoo/odoo-bin -c /etc/odoo14.conf

Sep 14 09:52:11 RockyLinux8 systemd[1]: Started Odoo14.
Sep 14 09:52:13 RockyLinux8 odoo14[37537]: /opt/odoo14/odooenv/lib64/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycop>
Sep 14 09:52:13 RockyLinux8 odoo14[37537]:   """)
Sep 14 09:52:13 RockyLinux8 odoo14[37537]: 2021-09-14 09:52:13,333 37537 INFO ? odoo: Odoo version 14.0
Sep 14 09:52:13 RockyLinux8 odoo14[37537]: 2021-09-14 09:52:13,334 37537 INFO ? odoo: Using configuration file at /etc/odoo14.conf
Sep 14 09:52:13 RockyLinux8 odoo14[37537]: 2021-09-14 09:52:13,334 37537 INFO ? odoo: addons paths: ['/opt/odoo14/odoo/odoo/addons', '/opt/odo>
Sep 14 09:52:13 RockyLinux8 odoo14[37537]: 2021-09-14 09:52:13,334 37537 INFO ? odoo: database: odoo14@default:default
Sep 14 09:52:13 RockyLinux8 odoo14[37537]: 2021-09-14 09:52:13,824 37537 INFO ? odoo.addons.base.models.ir_actions_report: Will use the Wkhtml>
Sep 14 09:52:14 RockyLinux8 odoo14[37537]: 2021-09-14 09:52:14,234 37537 INFO ? odoo.service.server: HTTP service (werkzeug) running on RockyL>

Step 5 – Configure Firewall

If you are using firewalls, then you will need to allow Odoo port 8069 through the firewall. You can allow it using the following command:

firewall-cmd --permanent --add-port=8069

Next, reload the firewalld to apply the changes:

firewall-cmd --reload

Step 6 – Access Odoo 14 Web UI

At this point, Odoo 14 is started and listening on port 8069. You can check it using the following command:

ss -antpl | grep 8069

Sample output:

LISTEN 0      128          0.0.0.0:8069      0.0.0.0:*    users:(("python3",pid=37537,fd=3)) 

You can now access it using the URL http://your-server-ip:8069. You should see the following page:
Odoo 14 login 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:
Odoo 14 dashboard page

Conclusion

That’s it for now. You have successfully installed Odoo 14 on Rocky Linux 8. You can now start managing your business using the Odoo ERP. Get started on dedicated hosting from Atlantic.Net.