Skip to content

Deployment Overview of Odoo on Server

Prerequisites and Basic Requirements

The following prerequisites must be met before the system is operational:

  • Operating System: Compatible Debian or Ubuntu distributions (tested on Ubuntu 24.04, Debian, and legacy Ubuntu versions).

  • Privileges: Root or sudo access is required for package installation, repository configuration, and service management.

  • Domain Configuration: The server must be reachable via the hostkey.in domain.

  • Network Access: Port 80 must be open on the firewall to allow external access and SSL certificate validation.

Access URL

The application is accessible via the Fully Qualified Domain Name (FQDN) on the hostkey.in domain. The standard format for the URL is:

odooServer ID.hostkey.in:80

Where Server ID is the unique identifier assigned to the host instance. The external path is set to /.

File and Directory Structure

The system is organized into specific directories for configuration, data storage, and proxy management:

  • Odoo Repository Configuration: /etc/apt/sources.list.d/odoo.list

  • GPG Keyring: /usr/share/keyrings/odoo-archive-keyring.gpg

  • Docker Compose Directory: /root/nginx

  • Docker Compose File: /root/nginx/compose.yml

  • Nginx Configuration Data: /data/nginx

  • SSL Secrets Volume: Mapped to /etc/letsencrypt inside the proxy container.

Application Installation Process

The Odoo application is installed version 18.0 from the official nightly repository. The installation process involves the following steps:

  1. Repository Setup:

    • Download the GPG key from https://nightly.odoo.com/odoo.key.

    • Import the key to /usr/share/keyrings/odoo-archive-keyring.gpg.

    • Add the nightly repository to the sources list at /etc/apt/sources.list.d/odoo.list with the URL https://nightly.odoo.com/18.0/nightly/deb.

  2. Package Installation:

    • Install python3-pip to ensure Python package management is available.

    • Install the odoo package via apt.

    • Install libssl3 to ensure SSL library compatibility.

  3. Additional Python Dependencies:

    • For older Ubuntu versions, the following Python libraries are installed manually:

    • xlwt (for XLS export).

    • num2words (for textual amount rendering).

    • These packages are included by default in the Odoo package for Ubuntu 24.04.

  4. PDF Generation Tools:

    • Download and install wkhtmltopdf (version 0.12.5).

    • Install required Qt dependencies: libqt5core5a, libqt5gui5, libqt5network5, libqt5printsupport5, libqt5svg5, libqt5webkit5, libqt5widgets5, and xvfb.

Proxy Servers

Traffic to the application is managed by a Docker-based Nginx proxy with integrated Certbot for SSL certificates.

  • Image: jonasal/nginx-certbot:latest

  • Network Mode: Host

  • Configuration Environment:

  • Email: [email protected] (used for Let's Encrypt notifications).

  • Environment File: /data/nginx/nginx-certbot.env

  • Volume Mounts:

  • nginx_secrets (external volume) mapped to /etc/letsencrypt for SSL certificate storage.

  • /data/nginx/user_conf.d mapped to /etc/nginx/user_conf.d for custom user configurations.

Docker Containers and Their Deployment

The proxy server runs within a Docker container managed by Docker Compose. The deployment script performs the following actions:

  1. Ensures Docker is installed on the host.

  2. Generates the compose.yml file in the /root/nginx directory.

  3. Starts the services using the command:

    docker compose up -d
    
    This command is executed within the /root/nginx directory. The container is configured to restart unless-stopped.

Databases

The provided configuration focuses on the application and proxy layer. The default Odoo package installation includes a PostgreSQL backend. No custom database connection strings or external database servers are defined in the current configuration files; the Odoo service uses the default system PostgreSQL instance installed via the odoo package.

Available Ports for Connection

The following ports are configured for external and internal access:

Direction Port Protocol Purpose
External 80 TCP HTTP/HTTPS (Nginx Proxy)
Internal 8067 TCP Odoo Application (Backend)

External traffic is received on port 80 and forwarded to the Odoo application running internally on port 8067.

Starting, Stopping, and Updating

Managing the Nginx Proxy Container

The proxy service is managed via Docker Compose in the /root/nginx directory.

  • Start Services:

    cd /root/nginx
    docker compose up -d
    

  • Stop Services:

    cd /root/nginx
    docker compose down
    

  • Restart Services:

    cd /root/nginx
    docker compose restart
    

  • Update the Container Image: To pull the latest image and restart the container:

    cd /root/nginx
    docker compose pull
    docker compose up -d
    

Managing the Odoo System Service

The Odoo application runs as a native system service managed by systemd.

  • Start Odoo:

    systemctl start odoo
    

  • Stop Odoo:

    systemctl stop odoo
    

  • Restart Odoo:

    systemctl restart odoo
    

  • Check Status:

    systemctl status odoo
    

Permission Settings

The Docker Compose file is generated with the following ownership and permissions:

  • Owner: root

  • Group: root

  • File Mode: 0644 for the compose.yml file and the /root/nginx directory.

The Odoo application files and database permissions are managed automatically by the apt package manager during installation.

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×