Deploying Odoo on your own server gives you full control over your data, performance and security. If your infrastructure is built on the Red Hat family, sooner or later you will ask how to properly install Odoo on CentOS or RHEL. In this guide, we walk through the entire process: from preparing the system, through PostgreSQL and the Python environment, to the systemd service and the firewall.
Before you start configuring your own server, you can see how the system works and try it out in practice.
Prerequisites
This guide applies to RHEL 9-compatible systems: Red Hat Enterprise Linux, AlmaLinux, Rocky Linux and CentOS Stream 9. Classic CentOS 7 and 8 are no longer supported, so they should not be used in production. On newer systems (e.g., RHEL 10), the default Python version and package names may differ, so adapt the commands to your distribution. In the examples, we install the 19.0 branch. Before installing, check the official Odoo release information, and if a newer stable version is available, replace the branch number in the git clone command and verify the requirements in the documentation.
- a server with access to an account with sudo privileges,
- at least 4 GB of RAM and 2 CPU cores (more for a production environment),
- the Python version required by the given Odoo version (for Odoo 19, 3.10 or newer),
- a PostgreSQL version supported by the Odoo documentation (we use version 16 in the example),
- a domain name, if you plan to access Odoo over HTTPS.
Step 1: Update the System and Install Dependencies
Start by updating packages, enabling the CRB (CodeReady Builder) repository and installing the tools needed to build Python libraries. On RHEL, you can enable the CRB repository with the command sudo subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms, while on AlmaLinux and Rocky Linux, the dnf config-manager command below is enough.
sudo dnf update -y
sudo dnf config-manager --set-enabled crb
sudo dnf install -y git gcc redhat-rpm-config python3.11 python3.11-devel \
libxml2-devel libxslt-devel openldap-devel cyrus-sasl-devel \
libjpeg-turbo-devel zlib-devel openssl-devel libffi-devel libpq-devel
Step 2: Install and Configure PostgreSQL
Odoo stores all of its data in PostgreSQL. Enable the module with the newer database version, initialize the cluster and start the service.
sudo dnf module enable -y postgresql:16
sudo dnf install -y postgresql-server postgresql-contrib
sudo postgresql-setup --initdb
sudo systemctl enable --now postgresql
Next, create a database user named odoo. It only needs the permission to create databases; do not grant superuser privileges:
sudo -u postgres createuser --createdb --no-superuser --no-createrole odoo
Why do the system user and the database user have the same name?
By default, PostgreSQL on RHEL uses peer authentication through a Unix socket. If the odoo system user has a matching role in the database, Odoo connects without storing a password in the configuration file. This is a simple and secure solution for a single-server installation.
Step 3: System User and Downloading the Odoo Code
sudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo
sudo -u odoo git clone https://github.com/odoo/odoo --depth 1 --branch 19.0 /opt/odoo/odoo
sudo mkdir -p /opt/odoo/custom-addons /var/log/odoo /etc/odoo
sudo chown -R odoo:odoo /opt/odoo /var/log/odoo
Step 4: Python Virtual Environment
An isolated virtual environment helps you avoid conflicts with system packages and makes future updates easier.
sudo -u odoo python3.11 -m venv /opt/odoo/venv
sudo -u odoo /opt/odoo/venv/bin/pip install --upgrade pip wheel
sudo -u odoo /opt/odoo/venv/bin/pip install -r /opt/odoo/odoo/requirements.txt
If the installation of a package fails with a compilation error, the most common cause is a missing development library from step 1 or the CRB repository not being enabled.
Step 5: wkhtmltopdf for Generating PDF Reports
For invoices, quotations and other documents to print correctly, Odoo needs wkhtmltopdf version 0.12.6.1 with patched Qt:
sudo dnf install -y https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox-0.12.6.1-3.almalinux9.x86_64.rpm
wkhtmltopdf --version
Step 6: Odoo Configuration File
Create the file /etc/odoo/odoo.conf with the following content:
[options]
admin_passwd = YOUR_STRONG_MASTER_PASSWORD
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo/addons,/opt/odoo/custom-addons
logfile = /var/log/odoo/odoo.log
Set the permissions: sudo chown odoo:odoo /etc/odoo/odoo.conf && sudo chmod 640 /etc/odoo/odoo.conf. The admin_passwd parameter protects the database manager, so set a long, unique password here. When you later put a reverse proxy in front of Odoo, also add proxy_mode = True. You can read more about securing the database manager in the article Odoo Database Manager: How It Works and How to Secure It. For details on writing logs, see the guide How to Configure File Logging in Odoo.
Step 7: systemd Service
Thanks to a systemd unit, Odoo will start automatically after the server restarts. Create the file /etc/systemd/system/odoo.service:
[Unit]
Description=Odoo
After=network.target postgresql.service
Wants=postgresql.service
[Service]
Type=simple
User=odoo
Group=odoo
ExecStart=/opt/odoo/venv/bin/python /opt/odoo/odoo/odoo-bin -c /etc/odoo/odoo.conf
Restart=on-failure
[Install]
WantedBy=multi-user.target
Then reload the configuration and start the service:
sudo systemctl daemon-reload
sudo systemctl enable --now odoo
sudo systemctl status odoo
If the service does not start, check the logs with the command sudo journalctl -u odoo -n 50 and the file /var/log/odoo/odoo.log.
A production setup that covers SELinux, a reverse proxy, HTTPS and backups can be demanding. If you would rather leave it in the hands of specialists, get in touch with us.
Step 8: Firewall and SELinux
By default, Odoo listens on port 8069. On RHEL, the firewalld firewall is active, so you need to open the port for the initial tests:
sudo firewall-cmd --permanent --add-port=8069/tcp
sudo firewall-cmd --reload
In production, do not expose port 8069 publicly. Instead, make Odoo available through a reverse proxy with HTTPS (ports 80 and 443). Do not disable SELinux. If the service does not start, check for blocks with the command sudo ausearch -m avc -ts recent and add the appropriate rules. When Nginx sits in front of Odoo, also enable sudo setsebool -P httpd_can_network_connect 1. Once Odoo is running correctly, go to http://server-address:8069 and create your first database. If your browser cannot connect to the server, this article will help: Odoo Connection Refused Error: Causes and Step-by-Step Fixes.
What Next After the Installation?
Once you have managed to install Odoo on CentOS or RHEL, take care of the next elements of a production environment:
- Reverse proxy and HTTPS – instead of opening port 8069, use Nginx with an SSL certificate. With heavier traffic, the following will come in handy: Odoo Load Balancer (Nginx): Step-by-Step Configuration.
- Workers – multiprocessing mode (the
workersparameter) improves handling of many users. It also requires support for port 8072 for long-polling connections (live chat, notifications), which we describe in the article How to Configure Odoo with Multiple Workers?. - Cache and sessions – Odoo does not support Redis natively, but some deployments use it through additional modules. See How to Configure Redis for Odoo.
- Performance – you will find more tips in the article How to Optimize Odoo Performance? Proven Methods.
- Backups – regular database dumps (pg_dump) and a copy of the filestore directory, preferably stored outside the production server.
If you do not want to administer the server yourself, you can also use ready-made hosting. Read How to Install Odoo.sh: Step-by-Step Guide. And when you eventually migrate data between versions, the following will be useful: Odoo Database Migration: How to Fix Errors and Issues.
Before you deploy the system in production, it is worth seeing how its modules will work in your company.
FAQ – Frequently Asked Questions
Can I install Odoo on CentOS 7 or CentOS 8?
Technically it is possible, but both systems have reached end of support and no longer receive security patches. For new deployments, use AlmaLinux, Rocky Linux, RHEL 9 or CentOS Stream 9.
Which Python and PostgreSQL versions should I choose?
Always check the requirements in the current documentation for your Odoo version. Odoo 19 requires Python 3.10 or newer, and on RHEL 9 it is convenient to use the python3.11 package. The PostgreSQL database should be a version supported by the documentation, and the postgresql:16 module meets this requirement.
Why is Odoo not accessible from outside after installation?
The most common causes are port 8069 being blocked in firewalld, SELinux rules or security groups at your cloud provider. Check the service status with the command systemctl status odoo, the logs in /var/log/odoo/odoo.log and the open ports in the firewall.
Can I leave port 8069 open in production?
This is not recommended because traffic on this port is not encrypted. In production, configure Nginx with an SSL certificate, open ports 80 and 443, and keep port 8069 accessible only locally.
Summary
Installing Odoo on CentOS or RHEL comes down to a few logical steps: preparing the system, PostgreSQL, the Python environment, wkhtmltopdf, configuration and the systemd service. This approach gives you a stable, easy-to-maintain environment, ready for further optimization. Do you need help with deployment, migration or performance tuning? The KK Innovations team is happy to support you at every stage. Write to us and let's discuss your project.