Deployment Overview of Odoo on Server¶
Prerequisites and Basic Requirements¶
The deployment targets Debian or Ubuntu-based Linux distributions. The system requires root privileges to install packages, configure repositories, and manage services. The following components are required for the application to function correctly: - Operating System: Debian or Ubuntu (including Ubuntu 24.04). - Python 3 and pip3 package manager. - Network access to download the Odoo GPG key, repository packages, and wkhtmltopdf binaries. - Ports 80 and 443 must be open for the Nginx reverse proxy and SSL termination.
File and Directory Structure¶
The deployment establishes specific directories for configuration files, certificates, and application data: - /usr/share/keyrings/odoo-archive-keyring.gpg: Stores the GPG key used to verify Odoo packages. - /etc/apt/sources.list.d/odoo.list: Contains the repository definition for Odoo version 18.0 nightly builds. - /root/nginx/: The directory containing the Docker Compose configuration for the reverse proxy. - /root/nginx/compose.yml: The Docker Compose file defining the Nginx and Certbot services. - /data/nginx/nginx-certbot.env: Environment file for Nginx configuration variables. - /data/nginx/user_conf.d/: Directory for custom Nginx configuration snippets. - /etc/letsencrypt/: Mount point for SSL certificates managed by Certbot.
Application Installation Process¶
The Odoo application is installed via the official APT repository for version 18.0 nightly builds. The installation process involves adding the repository key, configuring the source list, and installing the odoo package.
The following dependencies are installed to support PDF generation and report rendering: - libssl3: Required for SSL/TLS support. - wkhtmltopdf: Used for converting HTML reports to PDF. The installation includes specific Qt5 libraries (libqt5core5a, libqt5gui5, libqt5network5, libqt5printsupport5, libqt5svg5, libqt5webkit5, libqt5widgets5) and xvfb for virtual framebuffer support. - python3-pip: Required for managing Python dependencies.
On Ubuntu systems (excluding 24.04), additional Python packages xlwt and num2words are installed to support XLS export and textual amount rendering. On Ubuntu 24.04, these dependencies are included by default in the Odoo package.
Docker Containers and Their Deployment¶
A reverse proxy and SSL management system is deployed using Docker Compose. The configuration is located in /root/nginx/compose.yml.
The deployment utilizes the jonasal/nginx-certbot:latest image. The service is configured with the following parameters: - Restart Policy: unless-stopped. - Environment: The CERTBOT_EMAIL is set to [email protected]. - Network Mode: host. - Volumes: - nginx_secrets: An external volume mounted to /etc/letsencrypt for storing SSL certificates. - /data/nginx/user_conf.d: Mounted to /etc/nginx/user_conf.d for custom Nginx configurations.
To start the proxy services, the docker compose up -d command is executed from the /root/nginx directory.
Proxy Servers¶
The Nginx container acts as a reverse proxy and handles SSL certificate management via Certbot. - Image: jonasal/nginx-certbot:latest. - SSL Configuration: Certbot is configured to automatically obtain and renew SSL certificates. - Custom Domains: Custom server configurations can be added to the /data/nginx/user_conf.d directory, which is mounted into the container. - Environment Variables: Configuration is passed via the /data/nginx/nginx-certbot.env file.
Starting, Stopping, and Updating¶
The Odoo application runs as a system service managed by the operating system's service manager. The Docker-based proxy services are managed via Docker Compose.
To manage the Nginx and Certbot containers: - Start services: docker compose up -d (executed from /root/nginx). - Stop services: docker compose down (executed from /root/nginx). - Update services: Pull the latest image and restart the containers using docker compose pull followed by docker compose up -d.
The Odoo service itself is managed through standard system service commands (e.g., systemctl start odoo, systemctl stop odoo, systemctl restart odoo), as it is installed as a native package.