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
sudoaccess is required for package installation, repository configuration, and service management. -
Domain Configuration: The server must be reachable via the
hostkey.indomain. -
Network Access: Port
80must 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/letsencryptinside 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:
-
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.listwith the URLhttps://nightly.odoo.com/18.0/nightly/deb.
-
-
Package Installation:
-
Install
python3-pipto ensure Python package management is available. -
Install the
odoopackage viaapt. -
Install
libssl3to ensure SSL library compatibility.
-
-
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.
-
-
PDF Generation Tools:
-
Download and install
wkhtmltopdf(version0.12.5). -
Install required Qt dependencies:
libqt5core5a,libqt5gui5,libqt5network5,libqt5printsupport5,libqt5svg5,libqt5webkit5,libqt5widgets5, andxvfb.
-
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/letsencryptfor SSL certificate storage. -
/data/nginx/user_conf.dmapped to/etc/nginx/user_conf.dfor 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:
-
Ensures Docker is installed on the host.
-
Generates the
compose.ymlfile in the/root/nginxdirectory. -
Starts the services using the command:
This command is executed within the/root/nginxdirectory. The container is configured to restartunless-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:
-
Stop Services:
-
Restart Services:
-
Update the Container Image: To pull the latest image and restart the container:
Managing the Odoo System Service¶
The Odoo application runs as a native system service managed by systemd.
-
Start Odoo:
-
Stop Odoo:
-
Restart Odoo:
-
Check Status:
Permission Settings¶
The Docker Compose file is generated with the following ownership and permissions:
-
Owner:
root -
Group:
root -
File Mode:
0644for thecompose.ymlfile and the/root/nginxdirectory.
The Odoo application files and database permissions are managed automatically by the apt package manager during installation.