Odoo is the most widely used open-source all-in-one business software suite. It integrates CRM, e-commerce, billing, accounting, manufacturing, warehouse management, project management, and inventory in a single platform with a consistent interface.
The official Odoo APT repository is the fastest installation path, but source installation inside a Python virtual environment gives you version control, the ability to run multiple Odoo versions side by side on the same server, and isolated Python dependency management. This guide covers how to install Odoo on Ubuntu 18.04 using the source method with Nginx configured as an SSL termination proxy.
<strong>Prerequisite:</strong> You need sudo access, Nginx installed, and an SSL certificate for your domain.
Install build dependencies:
bashsudo apt update && sudo apt upgradesudo apt install git python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less
Create a dedicated system user. Odoo must never run as root. The -r flag creates a system account, -m creates the home directory, and -d specifies its path:
bashsudo useradd -m -d /opt/odoo12 -U -r -s /bin/bash odoo12
Install PostgreSQL and create the database user. Odoo uses PostgreSQL peer authentication by default: the PostgreSQL username must match the Linux username running the Odoo process:
bashsudo apt install postgresqlsudo su - postgres -c "createuser -s odoo12"
Install Wkhtmltopdf 0.12.5. Odoo 12 needs Wkhtmltopdf 0.12.x for PDF report generation. The version in the Ubuntu 18.04 repositories is incompatible, so download it directly:
bashwget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.debsudo apt install ./wkhtmltox_0.12.5-1.bionic_amd64.deb
Switch to the odoo12 user and clone the source:
bashsudo su - odoo12git clone https://www.github.com/odoo/odoo --depth 1 --branch 12.0 /opt/odoo12/odoo
--depth 1 fetches only the latest commit, not the full git history, keeping the download much smaller.
Create the virtual environment, install dependencies, then exit the user session:
bashcd /opt/odoo12python3 -m venv odoo-venvsource odoo-venv/bin/activatepip3 install wheel && pip3 install -r odoo/requirements.txtdeactivatemkdir /opt/odoo12/odoo-custom-addonsexit
Copy the sample config and edit it:
bashsudo cp /opt/odoo12/odoo/debian/odoo.conf /etc/odoo12.confsudo nano /etc/odoo12.conf
Set a strong admin_passwd, confirm db_user = odoo12, and add /opt/odoo12/odoo-custom-addons to addons_path.
Create /etc/systemd/system/odoo12.service. Key directives: Requires=postgresql.service prevents Odoo from starting before PostgreSQL is ready; User=odoo12 runs the process as the unprivileged system user; ExecStart points to the virtual environment’s Python binary at /opt/odoo12/odoo-venv/bin/python3.
bashsudo systemctl daemon-reloadsudo systemctl start odoo12sudo systemctl enable odoo12
Verify at http://your_ip:8069.
Enable proxy mode by adding proxy_mode = True to /etc/odoo12.conf, then restart Odoo.
Configure Nginx with two upstream blocks: odoo on port 8069 for web requests and odoochat on port 8072 for longpolling and live chat. The server blocks handle HTTP to HTTPS redirect, WWW to non-WWW redirect, proxy headers (X-Forwarded-Host, X-Forwarded-For, X-Forwarded-Proto, X-Real-IP), static file caching at 90 minutes server-side and 10 days browser-side, and Gzip compression for CSS, JavaScript, and XML. Restart Nginx after saving.
Restrict Odoo to localhost. Add these lines to /etc/odoo12.conf to prevent direct external access on port 8069:
inixmlrpc_interface = 127.0.0.1netrpc_interface = 127.0.0.1
Enable multiprocessing. Worker-based processing is required for production stability. Calculate workers using: theoretical maximum = (CPU cores × 2) + 1; practical count = concurrent users ÷ 6. For a 4-core server with 30 concurrent users, use 5 workers plus 1 cron thread. Add to /etc/odoo12.conf:
iniworkers = 5max_cron_threads = 1limit_memory_hard = 2684354560limit_memory_soft = 2147483648limit_time_cpu = 600limit_time_real = 1200
Restart Odoo: sudo systemctl restart odoo12. Your Odoo 12 instance is now accessible at https://example.com.
Odoo 12 is now installed and production-ready on Ubuntu 18.04. Schedule regular database backups and monitor service logs with sudo journalctl -u odoo12 to catch issues early. Leave a comment below if you run into any problems.
MariaDB is an open-source, multi-threaded relational database management system and a fully backward-compatible replacement for MySQL.…
Odoo 11 is an open-source all-in-one business software platform covering CRM, e-commerce, billing, accounting, manufacturing,…
phpMyAdmin is a free, open-source PHP application for managing MySQL and MariaDB servers through a browser.…
phpMyAdmin is a free, open-source PHP application that provides a browser-based interface for managing MySQL and…
Zabbix is a mature open-source infrastructure monitoring platform that collects metrics from network devices, servers, virtual…
Gradle is a powerful open-source build automation tool used primarily for Java, Kotlin, Groovy, and Android…