System Architecture and Component Integration

Odoo 18 operates on a multi-tier architecture that separates presentation, application, and data layers. The core framework uses Python 3.11 with specific library dependencies that Fedora 39 provides through its native package manager. PostgreSQL serves as the primary database engine, storing all business data, user configurations, and application states. This separation ensures transactional integrity while supporting horizontal scaling strategies.

The web interface leverages QWeb templating engine combined with JavaScript frameworks for dynamic content rendering. Nginx functions as a reverse proxy, handling client requests and serving static assets without engaging the Python application server. This architecture optimizes resource utilization by separating static and dynamic content delivery. The system employs worker processes that handle concurrent user requests through multiprocessing.

Component communication follows strict protocol patterns. Python modules interact with PostgreSQL via psycopg2 adapter, implementing connection pooling for database operations. The framework uses ORM methods that translate Python objects into SQL queries, maintaining data consistency across transactions. All external requests pass through Nginx, which applies SSL termination and rate limiting before forwarding to Odoo workers.

Data flows through defined pipelines that transform user inputs into persistent records. Browser requests reach Nginx on port 80 or 443, then route to Odoo’s XML-RPC or JSON-RPC endpoints. The application server processes requests through controller methods that validate parameters and execute business logic. Successful operations commit changes to PostgreSQL, while failures trigger rollback procedures that maintain database consistency.

Prerequisites and System Preparation

Fedora 39 requires specific preparation before Odoo installation. Begin with a comprehensive system update to ensure all security patches and performance improvements apply. The process demands administrative privileges, so verify your sudo access before proceeding. System preparation establishes the foundation for all subsequent installation steps and prevents dependency conflicts.

Execute these commands to update your system and install essential packages:

sudo dnf update -y
sudo dnf install -y python3 python3-devel git gcc redhat-rpm-config openssl-devel libxml2-devel libxslt-devel

These packages provide the development tools necessary for compiling Python extensions and managing Odoo dependencies. The python3-devel package contains header files required for building Python modules with C extensions. Development tools ensure the system can compile various Python packages from source code.

Create a dedicated system user account for Odoo operations. This security measure confines the application to a restricted environment, limiting potential damage from security breaches. Isolated user accounts represent standard security practice for production deployments. Implement the user creation with these commands:

sudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo

The command creates a user named ‘odoo’ with a home directory at /opt/odoo. The ‘-r’ flag designates this as a system account, while ‘-U’ simultaneously creates a matching group. This user will own all Odoo processes and files, maintaining proper permission structures.

Verify the Python 3 version matches Fedora 39’s expected release. The system should report Python 3.11 or newer, which provides the necessary features for Odoo 18. Check the version with python3 --version and confirm the output. This validation prevents runtime errors caused by version incompatibilities that could disrupt business operations.

PostgreSQL Database Configuration

Odoo requires a robust database backend, and PostgreSQL delivers enterprise-grade reliability. Install PostgreSQL and its development libraries using Fedora’s package manager. The development libraries enable Python database connectors to compile and function correctly. Database configuration occurs before Odoo installation to ensure immediate availability.

Execute the installation command:

sudo dnf install -y postgresql postgresql-server postgresql-devel postgresql-contrib

Initialize the database cluster with sudo postgresql-setup --initdb --unit postgresql. This command creates the necessary data structures and configuration files in /var/lib/pgsql/data. Start the database service with sudo systemctl enable --now postgresql. The service must remain active throughout the Odoo installation and operation.

Create a dedicated database user for Odoo operations. This practice separates application data from administrative accounts, enhancing security. Access the PostgreSQL prompt with sudo -u postgres psql and execute these commands:

CREATE USER odoo WITH CREATEDB PASSWORD 'secure_password';
ALTER USER odoo CREATEDB;

Replace ‘secure_password’ with a strong, unique passphrase that meets security standards. The CREATEDB privilege permits Odoo to generate new databases for multi-tenant deployments or testing environments. This capability supports operational flexibility while maintaining security boundaries.

Configure PostgreSQL connection settings for enhanced performance and security. Edit /var/lib/pgsql/data/postgresql.conf to modify key parameters. Set max_connections = 80 to accommodate Odoo worker processes and database operations. Adjust shared_buffers to 25% of available system memory for optimal caching performance. These adjustments ensure the database handles Odoo’s workload efficiently.

Python Environment and Dependencies

Odoo 18 operates within a controlled Python environment that manages dependency versions. Python virtual environments prevent conflicts between system packages and application requirements. This isolation ensures Odoo’s specific library versions don’t interfere with system utilities or other applications. The approach maintains system stability while accommodating Odoo’s precise dependencies.

Create a virtual environment in the Odoo user’s home directory. Switch to the odoo user account with sudo su - odoo and execute these commands:

python3 -m venv odoo-venv
source odoo-venv/bin/activate

The virtual environment activates, modifying your shell prompt to indicate the active context. All subsequent Python package installations will occur within this isolated space, separate from the system’s Python distribution. This containment strategy simplifies dependency management and future upgrades.

Install Wheel package before other dependencies to ensure proper binary package handling. The command pip install wheel optimizes installation of Python packages with compiled components. This step accelerates subsequent package installations and prevents common build errors. Wheel support is particularly important for numerical computing libraries Odoo utilizes.

Install Odoo’s core dependencies using pip within the activated virtual environment:

pip install psycopg2-binary lxml libsass python-dateutil polib passlib werkzeug psutil html2text docutils pillow mock jinja2 pyyaml

These packages provide database connectivity, XML processing, Sass compilation, and various utility functions Odoo requires. The psycopg2-binary package offers a precompiled PostgreSQL adapter, eliminating compilation requirements during installation. Each dependency addresses specific functional areas within the Odoo framework.

Additional packages require installation for specialized Odoo features. Reporting capabilities need pip install pyldap vobject pyopenssl for advanced authentication and data exchange formats. Electronic payment processing requires pip install num2words ofxparse for currency handling and financial data interpretation. These specialized packages extend Odoo’s core functionality for enterprise use cases.

Verify the installation completeness with pip list | grep odoo. Although Odoo itself isn’t installed via pip yet, this command confirms all prerequisite packages installed correctly. A successful dependency installation shows no error messages and prepares the environment for Odoo framework deployment.

Odoo 18 Source Code Installation

Obtain the Odoo 18 source code from the official repository. The Git version control system manages code retrieval and future updates. Source code installation provides full control over the deployment and enables customization opportunities. This method supports production environments that require specific modifications or extensions.

As the odoo user, clone the repository into the home directory:

git clone https://github.com/odoo/odoo.git --branch 18.0 --depth 1 /opt/odoo/odoo-18

The --branch 18.0 parameter ensures you retrieve the stable version branch for Odoo 18. The --depth 1 option creates a shallow clone with only the latest revision, conserving disk space and download time. The target directory organizes the code for clear version management.

Install Odoo’s Python requirements using the project’s specification file. Navigate to the source directory with cd /opt/odoo/odoo-18 and execute:

pip install -r requirements.txt

This command processes the requirements.txt file included in the Odoo source, installing all framework dependencies with compatible versions. The file contains precise version specifications that prevent conflicts between packages. This automated approach ensures dependency consistency across deployments.

Create the Odoo configuration file that controls application behavior. The configuration file dictates database connections, server ports, file paths, and security settings. Create /opt/odoo/odoo-18.conf with these essential parameters:

[options]
admin_passwd = super_admin_password
db_host = localhost
db_port = 5432
db_user = odoo
db_password = secure_password
addons_path = /opt/odoo/odoo-18/addons
data_dir = /var/lib/odoo
xmlrpc_port = 8069

The admin_passwd secures the database management interface with a master password. The addons_path directs Odoo to core modules, while data_dir specifies storage for attachments and session data. These parameters establish the basic operational framework.

Verify the installation by testing Odoo’s ability to start. Execute python3 /opt/odoo/odoo-18/odoo-bin --config /opt/odoo/odoo-18.conf --save --stop-after-init. This command initializes the Odoo system without starting the server, validating all configurations and dependencies. Successful execution produces no error messages and creates the session data directory.

Systemd Service Configuration

Production deployments require reliable service management that systemd provides. The systemd service manager ensures Odoo starts automatically upon system boot and restarts after failures. This approach maintains application availability without manual intervention. Service configuration standardizes the operational environment across deployments.

Create the service configuration file at /etc/systemd/system/odoo.service with root privileges. The file contains service definitions that control process execution, user context, and resource management. Use this template for optimal operation:

[Unit]
Description=Odoo 18 ERP System
Documentation=https://www.odoo.com/documentation/18.0/
After=postgresql.target

[Service]
Type=simple
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo-18/odoo-bin --config /opt/odoo/odoo-18.conf
KillMode=mixed
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

The service definition specifies the odoo user context for security containment. The Restart parameters ensure automatic recovery from process failures, while the After directive maintains proper startup sequencing after PostgreSQL availability.

Reload systemd to recognize the new service configuration. Execute sudo systemctl daemon-reload to refresh the systemd manager configuration. This command makes the new service definition available for management without restarting the system. Service reloading is essential after any configuration changes.

Enable the Odoo service to start automatically at system boot with sudo systemctl enable odoo. This command creates the necessary symbolic links in systemd’s target directories. Automatic startup ensures business continuity following system maintenance or unexpected reboots. The enable operation doesn’t immediately start the service.

Start the Odoo service with sudo systemctl start odoo and verify its status using sudo systemctl status odoo. The status command displays active process information, recent log entries, and service health. Successful service activation shows ‘active (running)’ status and confirms proper integration with systemd’s process management.

Nginx Reverse Proxy Configuration

Nginx functions as a reverse proxy that handles client connections and serves static content. This architecture improves performance by offloading static resource delivery from the Python application server. Reverse proxy configuration also enables SSL termination and security header implementation. The setup enhances both security and performance characteristics.

Install Nginx using Fedora’s package manager with sudo dnf install -y nginx. The installation includes the web server binary, default configuration structures, and systemd integration. Nginx operates on port 80 by default, but will configure for SSL termination in subsequent steps. The web server handles external requests before they reach Odoo.

Create a dedicated Nginx configuration file for Odoo at /etc/nginx/conf.d/odoo.conf. The file contains server blocks that define request handling rules and upstream connections. Use this configuration template:

upstream odoo {
    server 127.0.0.1:8069;
}

server {
    listen 80;
    server_name your_domain.com;
    
    location / {
        proxy_pass http://odoo;
        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;
    }
    
    location /web/static/ {
        alias /opt/odoo/odoo-18/odoo/addons/web/static/;
        expires 1y;
        add_header Cache-Control public;
    }
}

The upstream block defines the connection to Odoo’s application server, while the server block configures virtual host settings. The static file location directive improves performance by serving CSS, JavaScript, and images directly from disk with long cache expiration.

Test the Nginx configuration syntax with sudo nginx -t. This validation check identifies syntax errors or misconfigured directives before applying changes. Successful testing displays a message confirming the configuration file syntax is correct. This preventive measure avoids service interruptions from configuration errors.

Restart Nginx to apply the new configuration with sudo systemctl restart nginx. Verify the service status with sudo systemctl status nginx to confirm proper operation. The restart operation loads the new Odoo configuration while maintaining existing connections through graceful process management. Nginx now proxies requests to Odoo while serving static content directly.

SSL Certificate Implementation with Let’s Encrypt

Production environments require encrypted connections to protect sensitive business data. Let’s Encrypt provides free SSL certificates through an automated validation process. Certificate installation enables HTTPS connections that encrypt data between clients and your Odoo instance. This security measure is essential for any internet-facing deployment.

Install Certbot, the Let’s Encrypt client, and the Nginx plugin using Fedora’s package manager. The command sudo dnf install -y certbot python3-certbot-nginx installs both the core certificate management tool and Nginx integration components. The Nginx plugin automates certificate installation and configuration updates, simplifying the process.

Obtain and install the SSL certificate with a single command:

sudo certbot --nginx -d your_domain.com

Replace ‘your_domain.com’ with your actual domain name that points to the server’s IP address. Certbot performs domain validation by creating temporary files that the Let’s Encrypt authority verifies. Successful validation results in certificate issuance and automatic Nginx configuration updates.

Certbot modifies the Nginx configuration to include SSL settings and redirect HTTP traffic to HTTPS. The updated configuration includes modern security practices like strong cipher suites and HTTP/2 support. Verify the changes by examining /etc/nginx/conf.d/odoo.conf, which now contains additional SSL-related directives.

Configure automatic certificate renewal to maintain continuous SSL protection. Let’s Encrypt certificates expire after 90 days, requiring regular renewal. Test the renewal process with sudo certbot renew --dry-run. This command verifies the renewal mechanism works without actually obtaining new certificates.

Set up a cron job for automated renewal by adding this line to the root user’s crontab:

0 12 * * * /usr/bin/certbot renew --quiet

The cron job executes daily at noon, attempting renewal for certificates approaching expiration. The --quiet flag suppresses output unless action is required. Automated renewal ensures uninterrupted SSL protection without manual intervention.

Update Odoo’s configuration to recognize the reverse proxy setup. Modify /opt/odoo/odoo-18.conf to include these parameters:

proxy_mode = True
x_forwarded_for = True

These directives ensure Odoo generates correct URLs using the HTTPS protocol and client IP addresses from the X-Forwarded-For header. Without these settings, Odoo might redirect to HTTP or log incorrect client addresses, disrupting functionality.

Security Hardening and Access Controls

Odoo deployments require rigorous security measures to protect business data. Security hardening begins with file permission management that restricts access to configuration and data files. Proper permission structures prevent unauthorized users from reading sensitive information or modifying application behavior. These controls form the foundation of deployment security.

Set strict ownership and permissions on Odoo directories with these commands:

sudo chown -R odoo:odoo /opt/odoo/
sudo chmod 755 /opt/odoo/
sudo chmod 640 /opt/odoo/odoo-18.conf

The configuration file receives restricted permissions that prevent world read access, protecting database credentials and security settings. The odoo user maintains exclusive write access to application code and data directories, limiting potential attack surfaces.

Configure PostgreSQL to accept only local connections by modifying /var/lib/pgsql/data/pg_hba.conf. Ensure the authentication methods for local connections use md5 or peer authentication:

host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5

These settings restrict database access to local processes while requiring password authentication. Network exposure elimination prevents external attacks targeting the database service directly. This layer of security complements the application-level protections.

Implement fail2ban to protect against brute force attacks on the authentication system. Install with sudo dnf install -y fail2ban and create /etc/fail2ban/jail.d/odoo.conf:

[odoo]
enabled = true
port = 8069,443
protocol = tcp
filter = odoo
logpath = /var/log/odoo/odoo-server.log
maxretry = 5
bantime = 3600

Fail2ban monitors authentication logs and automatically blocks IP addresses that exhibit malicious behavior. The service reduces the risk of credential stuffing attacks that target weak user passwords.

Regular security updates maintain protection against newly discovered vulnerabilities. Configure automatic security updates with sudo dnf install -y dnf-automatic and enable the timer with sudo systemctl enable --now dnf-automatic.timer. Automated updates ensure timely patching without constant manual intervention, closing security gaps rapidly.

Performance Optimization and Monitoring

Odoo performance depends on proper resource allocation and configuration tuning. The multi-process architecture utilizes multiple CPU cores through worker processes that handle concurrent requests. Worker configuration balances resource usage against response time requirements. Optimal settings maximize throughput without exhausting system resources.

Adjust Odoo’s worker configuration in /opt/odoo/odoo-18.conf based on available system resources:

workers = 4
limit_memory_soft = 1073741824
limit_memory_hard = 2147483648
limit_request = 8192
limit_time_cpu = 60
limit_time_real = 120

The workers parameter should equal (CPU cores * 2) + 1, with 4 workers suitable for dual-core systems. Memory limits prevent worker processes from consuming excessive RAM, while time limits abort requests that exceed reasonable execution durations. These settings prevent resource exhaustion under heavy loads.

PostgreSQL performance tuning significantly impacts overall system responsiveness. Modify /var/lib/pgsql/data/postgresql.conf to include these optimizations:

shared_buffers = 1GB
effective_cache_size = 3GB
work_mem = 16MB
maintenance_work_mem = 256MB

These values assume a system with 4GB of available RAM. shared_buffers controls how much memory PostgreSQL allocates for caching, while effective_cache_size helps the query planner make better decisions. Adjust these values proportionally for systems with different memory capacities.

Implement caching for static assets through Nginx configuration to reduce application server load. Extend the /etc/nginx/conf.d/odoo.conf static files location with additional directives:

location /web/static/ {
    alias /opt/odoo/odoo-18/odoo/addons/web/static/;
    expires 1y;
    add_header Cache-Control public;
    add_header ETag "";
    break;
}

The configuration instructs browsers to cache static resources for one year, significantly reducing repeat requests for CSS, JavaScript, and image files. The ETag header removal prevents conditional requests that still require server processing.

Set up comprehensive monitoring to track system health and performance metrics. Install and configure Prometheus node exporter with sudo dnf install -y prometheus-node_exporter. The exporter provides system-level metrics including CPU utilization, memory consumption, and disk I/O. Regular monitoring identifies performance degradation before it impacts users.