Here is the ultimate, master-level blueprint for deploying a side-by-side Odoo 19 Enterprise and Community environment on Ubuntu 24.04.
This guideĀ assumes you are operating as the system user odoo.
Phase 1: The Foundation (System, Database, & wkhtmltopdf)
1. Install Core Dependencies
We start by installing the compilers, Python environment tools, and PostgreSQL. (Note: You will be prompted to press Y to confirm installations since the -y flag is omitted).
Bash
sudo apt update sudo apt install git python3-venv python3-pip build-essential wget python3-dev \ python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev \ python3-setuptools libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libtiff5-dev \ libjpeg8-dev libopenjp2-7-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev \ postgresql nginx curl
Test: Run psql --version and python3 --version to ensure they installed correctly.
2. Install Node.js & RTL Support
Odoo requires Node.js for right-to-left language support (RTL) and compiling certain web assets.
Bash
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt install nodejs sudo npm install -g rtlcss
Test: Run node --version.
3. Install wkhtmltopdf (The Critical PDF Engine)
Odoo requires a specifically patched version of wkhtmltopdf to render PDF headers and footers (like on invoices). Do not use the default Ubuntu repository version.
Bash
cd /opt sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb sudo apt install ./wkhtmltox_0.12.6.1-3.jammy_amd64.deb
Test: Run wkhtmltopdf --version. It must say (with patched qt).
4. Configure PostgreSQL User
Create a database user named odoo and assign a password.
Bash
sudo -u postgres createuser -d -R -S odoo sudo -u postgres psql -c "ALTER USER odoo WITH PASSWORD 'odoo_db_password';"
Phase 2: Folder Architecture & Virtual Environment
1. Create the Master Directory Structure
This keeps your core engine, custom modules, and infrastructure perfectly isolated.
Bash
mkdir -p ~/odoo-dev/{conf,logs,backups,certs,modules/community/19.0,modules/enterprise/19.0+e}
2. Clone the Odoo 19 Source Code
Bash
cd ~/odoo-dev git clone https://github.com/odoo/odoo.git --depth 1 --branch 19.0 odoo19
(At this point, you would also clone or extract your proprietary Odoo Enterprise code into ~/odoo-dev/modules/enterprise/19.0+e/odoo).
3. Create the Virtual Environment
We build a single, unified Python environment to power both editions.
Bash
cd ~/odoo-dev/odoo19 python3 -m venv venv source venv/bin/activate # Upgrade pip and install dependencies pip install --upgrade pip setuptools wheel pip install -r requirements.txt # If Enterprise code is present, install its specific dependencies too: # pip install -r ~/odoo-dev/modules/enterprise/19.0+e/odoo/requirements.txt deactivate
Phase 3: Configuration & Systemd
1. The Enterprise Configuration
Bash
nano ~/odoo-dev/conf/odoo19.conf
[options] ; --- Database settings --- admin_passwd = super_secure_master_password db_host = 127.0.0.1 db_port = 5432 db_user = odoo db_password = odoo_db_password ; --- Addons Path --- addons_path = /home/odoo/odoo-dev/odoo19/addons,/home/odoo/odoo-dev/modules/enterprise/19.0+e/odoo/addons,/home/odoo/odoo-dev/modules/community/19.0 ; --- Logging Settings --- logfile = /home/odoo/odoo-dev/logs/odoo19-server.log log_level = info ; --- Security & Proxy Settings --- proxy_mode = True http_interface = 127.0.0.1 http_port = 8069 gevent_port = 8072
2. The Community Configuration
Bash
nano ~/odoo-dev/conf/odoo19-ce.conf
(Notice the omitted Enterprise path and the shifted ports).
[options] ; --- Database settings --- admin_passwd = super_secure_master_password db_host = 127.0.0.1 db_port = 5432 db_user = odoo db_password = odoo_db_password ; --- Addons Path (ENTERPRISE REMOVED) --- addons_path = /home/odoo/odoo-dev/odoo19/addons,/home/odoo/odoo-dev/modules/community/19.0 ; --- Logging Settings --- logfile = /home/odoo/odoo-dev/logs/odoo19-ce-server.log log_level = info ; --- Security & Proxy Settings --- proxy_mode = True http_interface = 127.0.0.1 http_port = 8169 gevent_port = 8172
3. Create Systemd Services
Create the background service for Enterprise:
Bash
sudo nano /etc/systemd/system/odoo19.service
[Unit] Description=Odoo 19 Enterprise Server Requires=postgresql.service After=network.target postgresql.service [Service] Type=simple SyslogIdentifier=odoo19 PermissionsStartOnly=true User=odoo Group=odoo ExecStart=/home/odoo/odoo-dev/odoo19/venv/bin/python3 /home/odoo/odoo-dev/odoo19/odoo-bin -c /home/odoo/odoo-dev/conf/odoo19.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
(Repeat the above for Community by creating /etc/systemd/system/odoo19-ce.service, changing the Description, SyslogIdentifier, and pointing ExecStart to odoo19-ce.conf).
Bash
sudo systemctl daemon-reload sudo systemctl enable --now odoo19 odoo19-ce
Test: Run sudo systemctl status odoo19 to ensure it says "Active (running)".
Phase 4: Local SSL, DNS, & Nginx
1. Generate Local SSL Certificates (mkcert)
Bash
sudo apt install mkcert libnss3-tools mkcert -install cd ~/odoo-dev/certs mkcert odoo-ee.local odoo-ce.local
2. Local DNS Mapping
Trick your machine into resolving your custom local domains.
Bash
sudo nano /etc/hosts
Modify the localhost line:
Plaintext
127.0.0.1 localhost odoo-ee.local odoo-ce.local
3. Increase Global Nginx Upload Limit
Bash
sudo nano /etc/nginx/nginx.conf
Inside the http { block, add:
Nginx
client_max_body_size 512M;
4. Nginx Server Blocks
Create the routing for Enterprise:
Bash
sudo nano /etc/nginx/sites-available/odoo19.conf
Nginx
upstream odoo19 { server 127.0.0.1:8069; }
upstream odoo19chat { server 127.0.0.1:8072; }
server {
listen 80;
server_name odoo-ee.local;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name odoo-ee.local;
ssl_certificate /home/odoo/odoo-dev/certs/odoo-ee.local+1.pem;
ssl_certificate_key /home/odoo/odoo-dev/certs/odoo-ee.local+1-key.pem;
proxy_set_header Host $host;
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;
access_log /var/log/nginx/odoo19.access.log;
error_log /var/log/nginx/odoo19.error.log;
location /websocket {
proxy_pass http://odoo19chat;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
proxy_redirect off;
proxy_pass http://odoo19;
}
location ~* /web/static/ {
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo19;
}
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;
}
(Repeat for Community by creating /etc/nginx/sites-available/odoo19-ce.conf, changing the upstream ports to 8169/8172, and the server_name to odoo-ce.local).
Bash
sudo ln -s /etc/nginx/sites-available/odoo19.conf /etc/nginx/sites-enabled/ sudo ln -s /etc/nginx/sites-available/odoo19-ce.conf /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl restart nginx
Test: Open https://odoo-ee.local in your browser. It should load securely.
Phase 5: Real-Time Log Monitoring (Frontail)
1. Install Frontail
Bash
sudo npm install -g frontail
2. Systemd Services
Create the Enterprise log viewer (sudo nano /etc/systemd/system/frontail.service):
[Unit] Description=Frontail Log Viewer for Odoo EE After=network.target [Service] Type=simple User=odoo ExecStart=/usr/bin/env frontail --ui-highlight /home/odoo/odoo-dev/logs/odoo19-server.log Restart=always [Install] WantedBy=multi-user.target
(Create /etc/systemd/system/frontail-ce.service for Community, adding -p 9002 to the ExecStart command and pointing to the CE log).
Bash
sudo systemctl daemon-reload sudo systemctl enable --now frontail frontail-ce
Test: Visit http://localhost:9001 and http://localhost:9002.
Phase 6: Automated Backups
1. Create the Backup Script
Bash
nano ~/odoo-dev/backup_odoo.sh
Bash
#!/bin/bash
# --- Configuration Variables ---
BACKUP_DIR="/home/odoo/odoo-dev/backups"
ADMIN_PASSWORD="super_secure_master_password"
DAYS_TO_KEEP=7
# Define all databases you want to back up
DATABASES=("odoo19_enterprise" "odoo19_community")
# --- Backup Loop ---
for DB in "${DATABASES[@]}"
do
echo "Starting backup for: ${DB}..."
curl -X POST \
-F "master_pwd=${ADMIN_PASSWORD}" \
-F "name=${DB}" \
-F "backup_format=zip" \
-o ${BACKUP_DIR}/${DB}.$(date +%F).zip \
http://localhost:8069/web/database/backup
# Clean Up Old Backups
find ${BACKUP_DIR} -type f -mtime +${DAYS_TO_KEEP} -name "${DB}.*.zip" -delete
echo "Backup completed and cleaned for: ${DB}."
done
2. Make Executable & Schedule
Bash
chmod +x ~/odoo-dev/backup_odoo.sh crontab -e
Add to the bottom:
Code snippet
30 1 * * * /home/odoo/odoo-dev/backup_odoo.sh
Test: Run ~/odoo-dev/backup_odoo.sh and verify the .zip files appear in ~/odoo-dev/backups.
š Final Step: Initialization
To safely load rich demo data and correctly initialize your environments, navigate to https://odoo-ee.local and https://odoo-ce.local in your browser. Use the Database Manager UI to create your databases (odoo19_enterprise and odoo19_community), ensuring you check the "Demo Data" box.
Your infrastructure is now complete, automated, and ready for development.