How To Install Odoo on CentOS Stream 10
Odoo stands as one of the most powerful and versatile open-source business management software suites available today. It encompasses a wide range of applications including ERP, CRM, e-commerce, inventory management, and more, making it an all-in-one solution for businesses of all sizes. When it comes to hosting Odoo, CentOS Stream 10 offers an excellent platform due to its stability, security features, and long-term support. This comprehensive guide will walk you through the complete process of installing Odoo on CentOS Stream 10, ensuring you have a functional and efficient business management system up and running.
Prerequisites
Before diving into the installation process, ensure your system meets the following requirements:
- A server with CentOS Stream 10 freshly installed
- Minimum 2GB RAM (4GB recommended for production environments)
- At least 2 CPU cores (more recommended for better performance)
- 20GB of free disk space
- Root or sudo privileges on the server
- Basic familiarity with Linux command line operations
- A stable internet connection
- SSH access to your server
- Domain name (optional, but recommended for production setups)
Setting up Odoo requires approximately 30-45 minutes, depending on your server’s performance and internet connection speed. Having all prerequisites in place will ensure a smooth installation process.
Step 1: Update Your System and Install EPEL Repository
The first and crucial step before installing any major software on CentOS Stream 10 is to update your system packages to the latest versions. This ensures compatibility and security.
# Log in as root or use sudo for the following commands
sudo dnf update -y
The DNF package manager in CentOS Stream 10 is the successor to YUM, offering improved dependency resolution and performance. After updating your system, install the EPEL (Extra Packages for Enterprise Linux) repository, which provides additional packages not included in the standard CentOS repositories.
# Install EPEL repository
sudo dnf install epel-release -y
EPEL is essential for the Odoo installation as it contains several dependencies required by Odoo. To verify the successful installation of the EPEL repository, run:
# Verify EPEL repository
sudo dnf repolist
You should see “epel” in the output, confirming that the repository has been added successfully. If you encounter any issues with the repository installation, try clearing the DNF cache with sudo dnf clean all
and then retry the installation.
Step 2: Install Python and Required Dependencies
Odoo requires Python 3.10 or newer. CentOS Stream 10 comes with Python 3.10 by default, but we’ll ensure it’s properly set up and install all necessary dependencies.
# Install development tools and additional packages
sudo dnf groupinstall "Development Tools" -y
sudo dnf install git wget nodejs npm libpng-devel libjpeg-devel python3-devel python3-pip python3-setuptools python3-wheel python3-virtualenv libxml2-devel libxslt-devel openldap-devel libffi-devel openssl-devel zlib-devel -y
Now, let’s install additional libraries needed for Odoo:
# Install additional libraries
sudo dnf install xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 libXrender fontconfig freetype libXext -y
Python’s package manager (pip) will be used to install Python-specific dependencies later. Verify your Python installation with:
# Check Python version
python3 --version
Make sure the output shows Python 3.10 or newer. If for some reason CentOS Stream 10 has an older version, you might need to install Python from source, but this is rarely necessary with Stream 10.
Step 3: Create a Dedicated Odoo User
Running Odoo as the root user poses security risks. Creating a dedicated user specifically for running Odoo is a best practice in Linux system administration. This step enhances security by isolating the application from the system.
# Create odoo user
sudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo
This command creates a system user named “odoo” with a home directory at /opt/odoo
. The -m flag creates the home directory, -U creates a group with the same name, -r creates a system account, and -s sets the login shell to bash.
# Verify user creation
id odoo
The output should display the user ID, group ID, and group memberships for the odoo user. This dedicated user will have just enough permissions to run the Odoo service without unnecessary system access, following the principle of least privilege.
Step 4: Install and Configure PostgreSQL
Odoo uses PostgreSQL as its database management system. Let’s install and configure PostgreSQL:
# Install PostgreSQL
sudo dnf install postgresql postgresql-server postgresql-contrib -y
# Initialize the database
sudo postgresql-setup --initdb
# Start and enable PostgreSQL service
sudo systemctl start postgresql
sudo systemctl enable postgresql
Now we need to create a PostgreSQL user for Odoo:
# Switch to postgres user
sudo -u postgres psql
Once in the PostgreSQL command prompt, execute the following commands:
CREATE USER odoo WITH CREATEDB PASSWORD 'your_secure_password';
\q
Replace ‘your_secure_password’ with a strong, unique password. This creates a PostgreSQL user named “odoo” with permissions to create databases.
For improved security and performance, modify the PostgreSQL configuration:
# Edit PostgreSQL authentication configuration
sudo nano /var/lib/pgsql/data/pg_hba.conf
Find the line that starts with “local” and change “peer” to “md5”. This modification allows password authentication for local connections:
# TYPE DATABASE USER ADDRESS METHOD
local all all md5
Also, you might want to adjust the PostgreSQL performance parameters in postgresql.conf:
# Edit PostgreSQL main configuration
sudo nano /var/lib/pgsql/data/postgresql.conf
Depending on your server’s RAM, you might want to adjust these settings:
shared_buffers = 256MB # Adjust based on your server's RAM
work_mem = 4MB # Increase for better query performance
max_connections = 100 # Adjust based on expected concurrent users
After making these changes, restart PostgreSQL:
sudo systemctl restart postgresql
Test the PostgreSQL user by attempting to log in:
# Test PostgreSQL user
psql -U odoo -h localhost -d postgres
You should be prompted for a password. Enter the one you set earlier. If you can connect successfully, your PostgreSQL setup is correct.
Step 5: Install wkhtmltopdf
The wkhtmltopdf package is essential for Odoo’s reporting functionality, allowing it to generate PDF reports from HTML content. Standard repository packages often miss required functionality, so we’ll download and install the recommended version directly from the wkhtmltopdf website.
# Download wkhtmltopdf
cd /tmp
sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox-0.12.6.1-2.centos8.x86_64.rpm
# Install the package
sudo dnf install ./wkhtmltox-0.12.6.1-2.centos8.x86_64.rpm -y
After installation, verify that wkhtmltopdf works correctly:
# Test wkhtmltopdf
wkhtmltopdf --version
You should see the version information in the output. If you encounter any dependency issues, you can resolve them with:
# Install any missing dependencies
sudo dnf install -y libXrender libXext fontconfig
The correct installation of wkhtmltopdf is crucial for Odoo’s reporting functionality, particularly for generating invoices, quotes, and other business documents.
Step 6: Install Odoo from GitHub
We’ll install Odoo directly from its GitHub repository, which provides the most up-to-date version and flexibility for customization. Let’s switch to the odoo user and set up the installation:
# Switch to odoo user
sudo su - odoo
Now, clone the Odoo repository:
# Clone Odoo repository
git clone https://github.com/odoo/odoo --depth 1 --branch 17.0 /opt/odoo/odoo-server
This command clones only the latest commit of the 17.0 branch (the latest stable version as of writing) to save disk space and download time.
Next, let’s create and configure a Python virtual environment for Odoo:
# Create virtual environment
cd /opt/odoo
python3 -m venv odoo-venv
# Activate the virtual environment
source odoo-venv/bin/activate
# Install Python dependencies
pip install wheel
pip install -r odoo-server/requirements.txt
Using a virtual environment isolates Odoo’s Python dependencies from the system Python installation, preventing potential conflicts. This approach is considered a best practice for Python application deployment.
Now, create directories for custom addons and server logs:
# Create additional directories
mkdir -p /opt/odoo/custom-addons
mkdir -p /opt/odoo/odoo-server/logs
Before we exit the odoo user session, let’s make sure the permissions are correct:
# Set proper permissions
chmod 755 /opt/odoo -R
# Exit odoo user session
exit
The installation from GitHub gives you full access to the Odoo source code, allowing for easier troubleshooting and customization compared to package installations.
Step 7: Configure Odoo Server
Now it’s time to create a configuration file for Odoo. This file will contain all the necessary parameters for Odoo to run properly:
# Create Odoo configuration file
sudo nano /etc/odoo.conf
Add the following content to the file:
[options]
; General Settings
admin_passwd = your_admin_password
db_host = False
db_port = False
db_user = odoo
db_password = your_secure_password
addons_path = /opt/odoo/odoo-server/addons,/opt/odoo/custom-addons
logfile = /opt/odoo/odoo-server/logs/odoo-server.log
logrotate = True
log_level = info
; Process Management
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 600
limit_time_real = 1200
max_cron_threads = 1
workers = 2
; Network Settings
xmlrpc_port = 8069
netrpc_port = 8070
proxy_mode = True
Make sure to replace your_admin_password
with a strong password for the Odoo admin interface and your_secure_password
with the PostgreSQL password you set earlier. The configuration specifies:
- Database connection details
- Addon paths (both standard and custom)
- Log file location and settings
- Resource limits to prevent server overload
- Number of worker processes (adjust based on CPU cores available)
- Network ports and proxy settings
After creating the configuration file, set the appropriate permissions:
# Set proper permissions for the configuration file
sudo chown odoo: /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf
This configuration provides a solid balance between performance, security, and functionality for most Odoo deployments.
Step 8: Create a Systemd Service for Odoo
To run Odoo as a service that starts automatically when your server boots, we’ll create a systemd service file:
# Create systemd service file
sudo nano /etc/systemd/system/odoo.service
Add the following content to the file:
[Unit]
Description=Odoo Open Source ERP and CRM
After=network.target postgresql.service
Requires=postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo-server/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
This service configuration:
- Ensures Odoo starts after the network and PostgreSQL service
- Runs Odoo as the odoo user and group
- Specifies the Python interpreter from the virtual environment
- Uses the configuration file we created earlier
- Automatically restarts Odoo if it crashes
- Sends output to the system journal for easier troubleshooting
Now, enable and start the Odoo service:
# Reload systemd, enable and start Odoo service
sudo systemctl daemon-reload
sudo systemctl enable odoo
sudo systemctl start odoo
Check the status of the service to ensure it’s running correctly:
# Check service status
sudo systemctl status odoo
You should see “active (running)” in the output. If there are any issues, you can check the logs with:
# View service logs
sudo journalctl -u odoo -f
The -f flag allows you to follow the log in real-time, which is helpful for troubleshooting startup issues.
Step 9: Configure Firewall Rules
To allow access to the Odoo web interface, you need to open the appropriate port in the firewall. CentOS Stream 10 uses firewalld by default:
# Open port 8069 for Odoo
sudo firewall-cmd --permanent --add-port=8069/tcp
sudo firewall-cmd --reload
Verify that the port is now open:
# Check firewall settings
sudo firewall-cmd --list-all
You should see port 8069 listed under “ports”. For production environments, it’s a good practice to limit access to specific IP addresses:
# Limit access to specific IP address (optional)
sudo firewall-cmd --permanent --remove-port=8069/tcp
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="your_ip_address/32" port protocol="tcp" port="8069" accept'
sudo firewall-cmd --reload
Replace “your_ip_address” with your actual IP address. This enhances security by restricting access to only trusted IPs.
Step 10: Set Up Nginx as a Reverse Proxy (Optional)
For production environments, using Nginx as a reverse proxy provides several benefits:
- SSL/TLS encryption
- Load balancing
- Improved security
- Better performance for static content
Let’s install and configure Nginx:
# Install Nginx
sudo dnf install nginx -y
# Create Odoo Nginx configuration
sudo nano /etc/nginx/conf.d/odoo.conf
Add the following configuration:
upstream odoo {
server 127.0.0.1:8069;
}
server {
listen 80;
server_name your_domain.com;
# Redirect HTTP to HTTPS
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name your_domain.com;
# SSL parameters (generate these files using certbot)
ssl_certificate /etc/letsencrypt/live/your_domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/your_domain.com/privkey.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
# log files
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;
# proxy headers
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
# increase proxy buffer size
proxy_buffers 16 64k;
proxy_buffer_size 128k;
# general proxy settings
proxy_read_timeout 900s;
proxy_connect_timeout 900s;
proxy_send_timeout 900s;
# Redirect requests to Odoo backend server
location / {
proxy_pass http://odoo;
}
# Cache static files
location ~* /web/static/ {
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo;
}
}
Replace “your_domain.com” with your actual domain name. For SSL, you can use Let’s Encrypt’s Certbot:
# Install certbot
sudo dnf install certbot python3-certbot-nginx -y
# Obtain and configure SSL certificate
sudo certbot --nginx -d your_domain.com
After configuring Nginx, check the configuration for errors and restart the service:
# Test Nginx configuration
sudo nginx -t
# Start and enable Nginx
sudo systemctl start nginx
sudo systemctl enable nginx
Don’t forget to open the HTTP and HTTPS ports in the firewall:
# Open HTTP and HTTPS ports
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
Using Nginx as a reverse proxy significantly enhances the security, performance, and flexibility of your Odoo deployment.
Step 11: Initial Odoo Setup and Database Creation
Now that Odoo is installed and running, it’s time to access the web interface and complete the initial setup:
- Open your web browser and navigate to
http://your_server_ip:8069
(or your domain if you set up Nginx) - You should see the Odoo database creation screen
- Fill in the following details:
- Master Password: The one you set in the odoo.conf file
- Database Name: A name for your company’s database
- Email: Your admin email address
- Password: A secure password for the admin account
- Language: Your preferred language
- Country: Your country
- Click “Create Database” and wait for the process to complete
After database creation, you’ll be redirected to the Odoo dashboard. From here, you can:
- Install applications from the Apps menu
- Configure company information under Settings > Companies
- Set up users and permissions under Settings > Users & Companies > Users
- Configure email servers under Settings > General Settings > Email
- Import or create your initial data (customers, products, etc.)
Take some time to explore the interface and familiarize yourself with Odoo’s features. The modular nature of Odoo allows you to start with just the basics and add more functionality as your needs grow.
Troubleshooting Common Installation Issues
Despite careful installation, issues may arise. Here are solutions to common problems:
Python Dependency Errors
If you encounter errors related to Python dependencies:
# Try installing with pip directly
sudo pip3 install package_name
# Or, if using virtualenv
sudo su - odoo
source odoo-venv/bin/activate
pip install package_name
PostgreSQL Connection Issues
If Odoo can’t connect to PostgreSQL:
# Check if PostgreSQL is running
sudo systemctl status postgresql
# Verify pg_hba.conf settings
sudo nano /var/lib/pgsql/data/pg_hba.conf
# Restart PostgreSQL after changes
sudo systemctl restart postgresql
Permission Problems
If you encounter permission issues:
# Check ownership of directories
ls -la /opt/odoo
# Fix permissions if needed
sudo chown -R odoo:odoo /opt/odoo
sudo chmod -R 755 /opt/odoo
Odoo Service Not Starting
If the Odoo service fails to start:
# Check service status and logs
sudo systemctl status odoo
sudo journalctl -u odoo -f
# Check configuration file syntax
sudo cat /etc/odoo.conf
Memory Issues
If Odoo crashes due to memory constraints:
# Adjust memory parameters in odoo.conf
sudo nano /etc/odoo.conf
# Add swap space if necessary
sudo dd if=/dev/zero of=/swapfile bs=1M count=2048
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Browser Access Problems
If you can’t access Odoo from your browser:
# Verify the firewall settings
sudo firewall-cmd --list-all
# Check if Odoo is listening on the expected port
sudo ss -tulpn | grep 8069
Regular log checking is crucial for troubleshooting. The main logs to monitor are:
- Odoo service logs:
sudo journalctl -u odoo -f
- Odoo application logs:
sudo tail -f /opt/odoo/odoo-server/logs/odoo-server.log
- PostgreSQL logs:
sudo tail -f /var/lib/pgsql/data/log/postgresql-*.log
- Nginx logs (if using):
sudo tail -f /var/log/nginx/odoo.error.log
Congratulations! You have successfully installed Odoo. Thanks for using this tutorial for installing the Odoo business management software on your CentOS Stream 10 system. For additional help or useful information, we recommend you check the official Odoo website.