Odoo is one of the most popular open-source ERP systems. This guide walks you through installing Odoo 17 on a fresh Ubuntu 22.04 server from scratch.
Pre-requisites
Ubuntu 22.04 LTS
Python 3.10+
PostgreSQL 14+
Node.js 18+
wkhtmltopdf 0.12.6
STEP 1 Update System Packages
sudo apt update && sudo apt upgrade -y
STEP 2 Install Python Dependencies
Odoo 17 requires Python 3.10 or higher. Install Python and the required build tools.
sudo apt install -y python3 python3-pip python3-dev python3-venv
sudo apt install -y build-essential libxml2-dev libxslt1-dev
sudo apt install -y libevent-dev libsasl2-dev libldap2-dev
sudo apt install -y libpq-dev libjpeg-dev zlib1g-dev libfreetype6-dev
STEP 3 Install PostgreSQL
Unlike ERPNext which uses MariaDB, Odoo uses PostgreSQL as its database. PostgreSQL is a powerful open-source relational database system.
sudo apt install -y postgresql postgresql-client
sudo systemctl start postgresql
sudo systemctl enable postgresql
Create a database user for Odoo. Replace ‘odoo_password’ with a strong password.
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo17
exit
STEP 4 Create Odoo System User
It’s best practice to run Odoo as a separate system user for security.
sudo useradd -m -d /opt/odoo17 -U -r -s /bin/bash odoo17
STEP 5 Install wkhtmltopdf
Odoo uses wkhtmltopdf for generating PDF reports. Install the specific version that works best with Odoo.
sudo apt install -y wkhtmltopdf
STEP 6 Install Node.js and npm
sudo apt install -y nodejs npm
sudo npm install -g rtlcss
STEP 7 Download Odoo 17
Switch to the odoo user and clone the Odoo 17 repository from GitHub.
sudo su - odoo17
git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 /opt/odoo17/odoo
STEP 8 Set Up Python Virtual Environment
python3 -m venv /opt/odoo17/odoo-venv
source /opt/odoo17/odoo-venv/bin/activate
pip install wheel
pip install -r /opt/odoo17/odoo/requirements.txt
deactivate
STEP 9 Create Custom Addons Directory
mkdir /opt/odoo17/odoo-custom-addons
exit
STEP 10 Configure Odoo
Create the Odoo configuration file.
sudo nano /etc/odoo17.conf
Add this configuration:
[options]
admin_passwd = your_master_password
db_host = False
db_port = False
db_user = odoo17
db_password = odoo_password
addons_path = /opt/odoo17/odoo/addons,/opt/odoo17/odoo-custom-addons
xmlrpc_port = 8069
STEP 11 Create Systemd Service
Create a service file so Odoo starts automatically on boot.
sudo nano /etc/systemd/system/odoo17.service
[Unit]
Description=Odoo 17
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo17
PermissionsStartOnly=true
User=odoo17
Group=odoo17
ExecStart=/opt/odoo17/odoo-venv/bin/python3 /opt/odoo17/odoo/odoo-bin -c /etc/odoo17.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
STEP 12 Start Odoo
sudo systemctl daemon-reload
sudo systemctl start odoo17
sudo systemctl enable odoo17
sudo systemctl status odoo17
Odoo is now running. Open your browser and go to:
http://your-server-ip:8069
You’ll see the Odoo database creation page. Create your first database and start using Odoo.
Comments
Join the discussion. Got a question, found an issue, or want to share your experience?