✅ Ubuntu 24.04 LTS - Fully supported and optimized ✅ Odoo 18.0 - Complete configuration with all necessary dependencies ✅ PostgreSQL 16 - Optimized installation and configuration for better performance
Installation of Odoo 18.0 with Python virtual environment on Ubuntu 24.04
- Python virtual environment
- Odoo 18.0
- PostgreSQL 16
- Ability to install multiple Odoo instances on the same server
- Pre-configured configuration file
- Support for Nginx and SSL with Certbot
- UFW firewall configuration
Simple configuration to install Odoo 18.0 with a virtual environment on Ubuntu 24.04
Main settings:
################################################################################
OE_USER="odoo"
OE_HOME="/$OE_USER"
OE_HOME_EXT="/$OE_USER/${OE_USER}-server"
# Default port where this Odoo instance will run
INSTALL_WKHTMLTOPDF="True"
OE_PORT="8069"
# Odoo version to install
OE_VERSION="18.0"
# Set to True to install the Odoo Enterprise version
IS_ENTERPRISE="False"
# Install PostgreSQL V16 instead of the default version
INSTALL_POSTGRESQL="True"
INSTALL_POSTGRESQL_SIXTEEN="True"
# Set to True to install Nginx
INSTALL_NGINX="False"
# Superadmin password - if GENERATE_RANDOM_PASSWORD is set to "True" a random password will be generated
OE_SUPERADMIN="admin"
GENERATE_RANDOM_PASSWORD="True"
OE_CONFIG="${OE_USER}-server"
# Default longpolling port
LONGPOLLING_PORT="8072"
# Set to "True" to install certbot and enable SSL
ENABLE_SSL="False"
# Website name if using Nginx
WEBSITE_NAME="example.com"
GIT_USERNAME="crottolo"
GIT_PASSWORD="your-password-of-github"
################################################################################The script uses a single REPOS array as the source of truth for all repositories. Each entry has the format "name|url" and is automatically:
- Cloned into
$OE_HOME/custom/<name> - Appended to the
addons_pathin the Odoo config file
## Configure GitHub repositories (single source of truth)
### Public and private repositories
##### GIT_USERNAME is your GitHub username for private repositories
##### GIT_PASSWORD is your GitHub Personal Access Token for private repositories
REPOS=(
# --- Public OCA + community ---
"free_addons_odoo|https://github.com/singleflo/free_addons_odoo"
"design-themes|https://github.com/odoo/design-themes"
"web|https://github.com/OCA/web"
"social|https://github.com/OCA/social"
"website|https://github.com/OCA/website"
"partner-contact|https://github.com/OCA/partner-contact"
"mail|https://github.com/OCA/mail"
# --- Singleflo platform baseline (PRIVATE) ---
"commons_odoo|https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/singleflo/commons_odoo"
"web_widgets_odoo|https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/singleflo/web_widgets_odoo"
"crm_odoo|https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/singleflo/crm_odoo"
"finance_odoo|https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/singleflo/finance_odoo"
)The 4 *_odoo private repos provide the cross-cutting baseline for any Singleflo Odoo 18 instance:
| Repository | Content |
|---|---|
commons_odoo |
Shared utilities: fiscalcode_calc, partner_docs, docx_report, privacy_consent, lead_counter_lost, hr_employee_firstname, appointment_link_custom, mail_plugin_fix, product_cost_security, api_doc |
web_widgets_odoo |
UI widgets: web_domain_field, web_widget_image_dragdrop, web_ribbon_env, web_timer_widget, whatsapp_phone_widget, responsive_client, recording_audio_widget |
crm_odoo |
Lead/contact integrations: api_crm_lead, multi_mail_sales_team, fb_odoo_lead, google_contact_integration |
finance_odoo |
Italian fiscal, billing, payroll: l10n_it_edi_preview_xml, preinvoice_base, sale_installment, payroll_paghe, product_catalog_generator_app |
Note: customer-specific repos (e.g.
apple3_odoo,craftusa_odoo,pacini_odoo,hetica_odoo,dlike_odoo,aiutotelefoni_odoo,tassisto_odoo) and thedashboards_odoo(licensed KS Dashboard Ninja) are NOT in the default install — clone them manually on instances that need them.
- Ubuntu 24.04
- 2vCPU and 1GB RAM (minimum)
- 8GB disk space
This script will work on Ubuntu 24.04, uses PostgreSQL as a database, so it's advisable to run it on a server with at least 1GB of memory. No swap is required. It will install Odoo 18.0 with a Python virtual environment in the home directory of the specified system user.
# Root user is required
wget https://github.com/crottolo/odoo_auto_install/refs/heads/18.0/install_odoo_ent.sh
chmod +x install_odoo_ent.sh
./install_odoo_ent.shWhen the installation is complete, you will see the following message:
-----------------------------------------------------------
Done! The Odoo server is up and running. Specifications:
Port: 8069
User service: odoo
Configuration file location: /etc/odoo-server.conf
Logfile location: /var/log/odoo
User PostgreSQL: odoo
Code location: /odoo
Addons folder: odoo/odoo-server/addons/
Password superadmin (database): dwer324fsdgdfgdg
Start Odoo service: sudo systemctl start odoo.service
Stop Odoo service: sudo systemctl stop odoo.service
Restart Odoo service: sudo systemctl restart odoo.service
-----------------------------------------------------------During the process, a user with sudo privileges is created, e.g., odoo, and the configuration is separate from the root user.
To view the list of packages installed in the virtual environment:
sudo su - odoo
source /odoo/odoo-venv/bin/activate
pip list
# To install a new package
pip install "package-name-to-install"
deactivateroot@odoo_server:~# sudo su odoo
odoo@odoo_server:/root$ cd
odoo@odoo_server:~$ ls
custom odoo-server odoo-venv
odoo@odoo_server:~$ source odoo-venv/bin/activate
(odoo-venv) odoo@odoo_server:~$ pip install pandas
Collecting pandas
Downloading pandas-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.3/12.3 MB 47.6 MB/s eta 0:00:00
Requirement already satisfied: pytz>=2020.1 in ./odoo-venv/lib/python3.10/site-packages (from pandas) (2023.3.post1)
Collecting tzdata>=2022.1
Downloading tzdata-2023.3-py2.py3-none-any.whl (341 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 341.8/341.8 KB 125.2 MB/s eta 0:00:00
Collecting numpy>=1.22.4
Downloading numpy-1.26.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.2/18.2 MB 54.6 MB/s eta 0:00:00
Collecting python-dateutil>=2.8.2
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 KB 109.6 MB/s eta 0:00:00
Requirement already satisfied: six>=1.5 in ./odoo-venv/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)
Installing collected packages: tzdata, python-dateutil, numpy, pandas
Attempting uninstall: python-dateutil
Found existing installation: python-dateutil 2.8.1
Uninstalling python-dateutil-2.8.1:
Successfully uninstalled python-dateutil-2.8.1
Successfully installed numpy-1.26.0 pandas-2.1.1 python-dateutil-2.8.2 tzdata-2023.3
(odoo-venv) odoo@odoo_server:~$ deactivate
odoo@odoo_server:~$ It's important to activate the virtual environment before installing packages and then deactivate it. You can see the confirmation of the virtual environment activation in the prompt: (odoo-venv) odoo@odoo_server: pip install pandas and the deactivation in the prompt: (odoo@odoo_server:~$)
After installing the package, you can deactivate the virtual environment:
(odoo-venv) odoo@odoo_server:~$ deactivate
odoo@odoo_server:~$ curl ifconfig.mehttp://ip-address:8069/web/database/managerThe script supports automatic installation and configuration of Nginx. If you set INSTALL_NGINX="True", the Nginx web server will be installed and configured to work with Odoo.
If you also set ENABLE_SSL="True" and provide a valid domain name in WEBSITE_NAME, Certbot will be installed to automatically configure SSL/HTTPS.
If you prefer to use Nginx Proxy Manager on a separate server, here are some recommended configurations:
Forward hostname / ip: internal server IP address
Forward port: 8069
Websockets Support: true
Custom locations: "/"
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# Add Headers for odoo proxy mode
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;
proxy_redirect off;Custom locations: "/websocket"
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# Add Headers for odoo proxy mode
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;Advanced: "Custom nginx configuration"
# common gzip
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 500M;
sendfile on;
send_timeout 600s;
keepalive_timeout 300;To improve PDF generation with wkhtmltopdf, you can install additional fonts:
apt install ttf-mscorefonts-installer
wget -q -O - https://gist.githubusercontent.com/Blastoise/b74e06f739610c4a867cf94b27637a56/raw/96926e732a38d3da860624114990121d71c08ea1/tahoma.sh | bash
wget https://gist.githubusercontent.com/maxwelleite/913b6775e4e408daa904566eb375b090/raw/ttf-ms-tahoma-installer.sh -q -O - | sudo bashThe updated script for Odoo 18.0 includes several improvements:
- Support for Ubuntu 24.04 - Optimized for the latest LTS version of Ubuntu
- PostgreSQL 16 - Support for the latest version of PostgreSQL
- Systemd instead of init.d - Use of the modern service management system
- UFW Configuration - Automatic firewall configuration
- Dependency Simplification - No longer necessary to force specific versions of pyopenssl and cryptography
- Configuration Improvements - More complete and optimized configuration file
You have successfully installed Odoo 18.0 with a Python virtual environment on Ubuntu 24.04. This configuration allows you to run multiple instances on the same server and offers a ready-to-use configuration for rapid deployment.
If you found this script useful, consider giving it a "like" on its GitHub repository. For more content like this, subscribe and "like" the CrottoCode YouTube channel.
- GitHub Repository: odoo_auto_install
- YouTube Channel: CrottoCode
Your support helps create more useful content. Thank you!
✅ Ubuntu 24.04 LTS - Completamente supportato e ottimizzato ✅ Odoo 18.0 - Configurazione completa con tutte le dipendenze necessarie ✅ PostgreSQL 16 - Installazione e configurazione ottimizzata per prestazioni migliori
Installazione di Odoo 18.0 con ambiente virtuale su Ubuntu 24.04
- Ambiente virtuale Python
- Odoo 18.0
- PostgreSQL 16
- Possibilità di installare più istanze di Odoo sullo stesso server
- File di configurazione preimpostato
- Supporto per Nginx e SSL con Certbot
- Configurazione del firewall UFW
Configurazione semplice per installare Odoo 18.0 con ambiente virtuale su Ubuntu 24.04
Impostazioni principali:
################################################################################
OE_USER="odoo"
OE_HOME="/$OE_USER"
OE_HOME_EXT="/$OE_USER/${OE_USER}-server"
# Porta predefinita su cui questa istanza di Odoo verrà eseguita
INSTALL_WKHTMLTOPDF="True"
OE_PORT="8069"
# Versione di Odoo da installare
OE_VERSION="18.0"
# Impostare su True per installare la versione enterprise di Odoo
IS_ENTERPRISE="False"
# Installa PostgreSQL V16 invece della versione predefinita
INSTALL_POSTGRESQL="True"
INSTALL_POSTGRESQL_SIXTEEN="True"
# Impostare su True per installare Nginx
INSTALL_NGINX="False"
# Password superadmin - se GENERATE_RANDOM_PASSWORD è impostato su "True" verrà generata automaticamente
OE_SUPERADMIN="admin"
GENERATE_RANDOM_PASSWORD="True"
OE_CONFIG="${OE_USER}-server"
# Porta longpolling predefinita
LONGPOLLING_PORT="8072"
# Impostare su "True" per installare certbot e abilitare SSL
ENABLE_SSL="False"
# Nome del sito web se si utilizza Nginx
WEBSITE_NAME="example.com"
GIT_USERNAME="crottolo"
GIT_PASSWORD="your-password-of-github"
################################################################################Lo script usa un unico array REPOS come single source of truth per tutte le repo. Ogni voce ha formato "nome|url" e viene automaticamente:
- Clonata in
$OE_HOME/custom/<nome> - Aggiunta all'
addons_pathdel file di configurazione Odoo
## Configurazione repository GitHub (single source of truth)
### Repository pubblici e privati
##### GIT_USERNAME è il tuo nome utente GitHub per repository privati
##### GIT_PASSWORD è il tuo GitHub Personal Access Token per repository privati
REPOS=(
# --- Public OCA + community ---
"free_addons_odoo|https://github.com/singleflo/free_addons_odoo"
"design-themes|https://github.com/odoo/design-themes"
"web|https://github.com/OCA/web"
"social|https://github.com/OCA/social"
"website|https://github.com/OCA/website"
"partner-contact|https://github.com/OCA/partner-contact"
"mail|https://github.com/OCA/mail"
# --- Singleflo platform baseline (PRIVATE) ---
"commons_odoo|https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/singleflo/commons_odoo"
"web_widgets_odoo|https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/singleflo/web_widgets_odoo"
"crm_odoo|https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/singleflo/crm_odoo"
"finance_odoo|https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/singleflo/finance_odoo"
)I 4 *_odoo privati forniscono la baseline trasversale per qualsiasi istanza Odoo 18 Singleflo:
| Repository | Contenuto |
|---|---|
commons_odoo |
Utility condivise: fiscalcode_calc, partner_docs, docx_report, privacy_consent, lead_counter_lost, hr_employee_firstname, appointment_link_custom, mail_plugin_fix, product_cost_security, api_doc |
web_widgets_odoo |
Widget UI: web_domain_field, web_widget_image_dragdrop, web_ribbon_env, web_timer_widget, whatsapp_phone_widget, responsive_client, recording_audio_widget |
crm_odoo |
Integrazioni lead/contatti: api_crm_lead, multi_mail_sales_team, fb_odoo_lead, google_contact_integration |
finance_odoo |
Fiscale IT, fatturazione, paghe: l10n_it_edi_preview_xml, preinvoice_base, sale_installment, payroll_paghe, product_catalog_generator_app |
Nota: le repo customer-specifiche (es.
apple3_odoo,craftusa_odoo,pacini_odoo,hetica_odoo,dlike_odoo,aiutotelefoni_odoo,tassisto_odoo) edashboards_odoo(KS Dashboard Ninja con licenza a pagamento) NON sono nell'installazione di default — vanno clonate manualmente nelle istanze che le richiedono.
- Ubuntu 24.04
- 2vCPU e 1GB RAM (minimo)
- 8GB di spazio su disco
Questo script funzionerà su Ubuntu 24.04, utilizza PostgreSQL come database, quindi è consigliabile eseguirlo su un server con almeno 1GB di memoria. Non è necessaria la swap. Installerà Odoo 18.0 con ambiente virtuale nella directory home dell'utente di sistema specificato.
# È richiesto l'utente root
wget https://github.com/crottolo/odoo_auto_install/refs/heads/18.0/install_odoo_ent.sh
chmod +x install_odoo_ent.sh
./install_odoo_ent.shAl termine dell'installazione, vedrai il seguente messaggio:
-----------------------------------------------------------
Done! The Odoo server is up and running. Specifications:
Port: 8069
User service: odoo
Configuraton file location: /etc/odoo-server.conf
Logfile location: /var/log/odoo
User PostgreSQL: odoo
Code location: /odoo
Addons folder: odoo/odoo-server/addons/
Password superadmin (database): dwer324fsdgdfgdg
Start Odoo service: sudo systemctl start odoo.service
Stop Odoo service: sudo systemctl stop odoo.service
Restart Odoo service: sudo systemctl restart odoo.service
-----------------------------------------------------------Durante il processo viene creato un utente con privilegi sudo, ad esempio odoo, e la configurazione è separata dall'utente root.
Per visualizzare l'elenco dei pacchetti installati nell'ambiente virtuale:
sudo su - odoo
source /odoo/odoo-venv/bin/activate
pip list
# Per installare un nuovo pacchetto
pip install "nome-pacchetto-da-installare"
deactivateroot@odoo_server:~# sudo su odoo
odoo@odoo_server:/root$ cd
odoo@odoo_server:~$ ls
custom odoo-server odoo-venv
odoo@odoo_server:~$ source odoo-venv/bin/activate
(odoo-venv) odoo@odoo_server:~$ pip install pandas
Collecting pandas
Downloading pandas-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.3/12.3 MB 47.6 MB/s eta 0:00:00
Requirement already satisfied: pytz>=2020.1 in ./odoo-venv/lib/python3.10/site-packages (from pandas) (2023.3.post1)
Collecting tzdata>=2022.1
Downloading tzdata-2023.3-py2.py3-none-any.whl (341 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 341.8/341.8 KB 125.2 MB/s eta 0:00:00
Collecting numpy>=1.22.4
Downloading numpy-1.26.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.2/18.2 MB 54.6 MB/s eta 0:00:00
Collecting python-dateutil>=2.8.2
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 KB 109.6 MB/s eta 0:00:00
Requirement already satisfied: six>=1.5 in ./odoo-venv/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)
Installing collected packages: tzdata, python-dateutil, numpy, pandas
Attempting uninstall: python-dateutil
Found existing installation: python-dateutil 2.8.1
Uninstalling python-dateutil-2.8.1:
Successfully uninstalled python-dateutil-2.8.1
Successfully installed numpy-1.26.0 pandas-2.1.1 python-dateutil-2.8.2 tzdata-2023.3
(odoo-venv) odoo@odoo_server:~$ deactivate
odoo@odoo_server:~$ È importante attivare l'ambiente virtuale prima di installare i pacchetti e poi disattivarlo. Puoi vedere la conferma dell'attivazione dell'ambiente virtuale nel prompt: (odoo-venv) odoo@odoo_server: pip install pandas e la disattivazione nel prompt: (odoo@odoo_server:~$)
Dopo l'installazione del pacchetto, puoi disattivare l'ambiente virtuale:
(odoo-venv) odoo@odoo_server:~$ deactivate
odoo@odoo_server:~$ curl ifconfig.mehttp://indirizzo-ip:8069/web/database/managerLo script supporta l'installazione e la configurazione automatica di Nginx. Se hai impostato INSTALL_NGINX="True", il server web Nginx verrà installato e configurato per funzionare con Odoo.
Se hai anche impostato ENABLE_SSL="True" e fornito un nome di dominio valido in WEBSITE_NAME, verrà installato Certbot per configurare automaticamente SSL/HTTPS.
Se preferisci utilizzare Nginx Proxy Manager su un server separato, ecco alcune configurazioni consigliate:
Forward hostname / ip: indirizzo IP del server interno
Forward port: 8069
Websockets Support: true
Custom locations: "/"
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# Add Headers for odoo proxy mode
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;
proxy_redirect off;Custom locations: "/websocket"
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# Add Headers for odoo proxy mode
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;Advanced: "Custom nginx configuration"
# common gzip
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 500M;
sendfile on;
send_timeout 600s;
keepalive_timeout 300;Per migliorare la generazione di PDF con wkhtmltopdf, puoi installare font aggiuntivi:
apt install ttf-mscorefonts-installer
wget -q -O - https://gist.githubusercontent.com/Blastoise/b74e06f739610c4a867cf94b27637a56/raw/96926e732a38d3da860624114990121d71c08ea1/tahoma.sh | bash
wget https://gist.githubusercontent.com/maxwelleite/913b6775e4e408daa904566eb375b090/raw/ttf-ms-tahoma-installer.sh -q -O - | sudo bashLa versione aggiornata dello script per Odoo 18.0 include diverse migliorie:
- Supporto per Ubuntu 24.04 - Ottimizzato per l'ultima versione LTS di Ubuntu
- PostgreSQL 16 - Supporto per la versione più recente di PostgreSQL
- Systemd invece di init.d - Utilizzo del sistema moderno di gestione dei servizi
- Configurazione UFW - Configurazione automatica del firewall
- Semplificazione delle dipendenze - Non è più necessario forzare versioni specifiche di pyopenssl e cryptography
- Miglioramenti alla configurazione - File di configurazione più completo e ottimizzato
Hai installato con successo Odoo 18.0 con un ambiente virtuale Python su Ubuntu 24.04. Questa configurazione ti permette di eseguire più istanze sullo stesso server e offre una configurazione pronta all'uso per una rapida implementazione.
Se hai trovato utile questo script, considera di dargli un "like" sul suo repository GitHub. Per altri contenuti come questo, iscriviti e metti "mi piace" al canale YouTube CrottoCode.
- Repository GitHub: odoo_auto_install
- Canale YouTube: CrottoCode
Il tuo supporto aiuta a creare altri contenuti utili. Grazie!