Odoo is one of the most powerful open-source ERP systems used worldwide for business automation. Installing Odoo on a Linux server provides better performance, stability, and security compared to other operating systems.
In this tutorial, you will learn how to install Odoo 15 on Ubuntu 20.04 using a secure and production-ready method. This guide is suitable for beginners, developers, and system administrators.
System Requirements
Before starting, make sure your server meets these requirements:
-
Ubuntu 20.04 installed
-
Minimum 2 GB RAM (4 GB recommended)
-
2 CPU cores
-
20 GB storage
-
Root or sudo access
Step 1: Update Ubuntu System
Updating the system ensures you install the latest packages and security updates.
Run the following command:
sudo apt update && sudo apt upgrade –yStep 2: Install Required Dependencies
Odoo requires several system packages including Python libraries and development tools.
sudo 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 libjpeg-dev zlib1g-dev libpq-dev yThese dependencies help Odoo run smoothly and support PDF reports, images, and database operations.
Step 3: Install PostgreSQL Database
sudo apt install postgresql –yStart PostgreSQL service:
sudo systemctl start postgresql sudo systemctl enable postgresqCreate PostgreSQL User for Odoo
Switch to PostgreSQL user:
sudo su - postgresCreate database user:
createuser --createdb --username postgres --no-createrole --no-superuser odoo15Exit PostgreSQL user:
exitStep 4: Create Odoo System User
For security reasons, it is recommended to run Odoo using a dedicated system user.
sudo useradd -m -d /opt/odoo15 -U -r -s /bin/bash odoo15Step 5: Install wkhtmltopdf
Odoo uses wkhtmltopdf to generate PDF reports.
Download and install:
sudo apt install wkhtmltopdf -yStep 6: Download Odoo 15 Source Code
Switch to Odoo user:
sudo su - odoo15Clone Odoo repository:
git clone https://www.github.com/odoo/odoo --depth 1 --branch 15.0Step 7: Create Python Virtual Environment
Using a virtual environment keeps dependencies isolated.
python3 -m venv odoo-venv source odoo-venv/bin/activateInstall Python packages:
pip install wheelpip install -r requirements.txt
Deactivate environment:
deactivateStep 8: Create Odoo Configuration File
Create Config File:
[Copy text = “sudo nano /etc/odoo15.conf”]
Add the following configuration
[options]
admin_passwd = admin_password_here
db_host = False
db_port = False
db_user = odoo15
db_password = False
addons_path = /opt/odoo15/addons logfile = /var/log/odoo15.log
Create log directory:
sudo mkdir /var/log/odoo15 sudo chown odoo15:root /var/log/odoo15Step 10: Create System Service
Creating a service allows Odoo to run automatically in the background.
Create service file:
sudo nano /etc/systemd/system/odoo15.serviceAdd:
[Unit]
Description=Odoo15
After=network.target postgresql.service
[Service]
Type=simple
User=odoo15
ExecStart=/opt/odoo15/odoo-venv/bin/python3 /opt/odoo15/odoo-bin -c /etc/odoo15.conf
[Install]
WantedBy=multi-user.target
Step 11: Start Odoo Service:
sudo systemctl daemon-reloadStart Odoo:
sudo systemctl start odoo15Enable auto start:
sudo systemctl enable odoo15Step 12: Access Odoo Web Interface
You will see the Odoo database creation screen.
Create a database and start using Odoo.
Step 13: Configure Firewall (Optional but Recommended)
sudo ufw allow 8069/tcp sudo ufw enableStep 14: Verify Installation
Check Odoo service status:
sudo systemctl status odoo15Check logs:
sudo tail -f /var/log/odoo15.log

