Odoo 17 is one of the world’s leading open-source ERP and CRM platform — a powerful solution designed to streamline business operations such as accounting, inventory, sales, and HR management.
In this comprehensive guide, you’ll learn how to install Odoo 17 on Ubuntu 22.04, configure it with PostgreSQL, and get your ERP system up and running in no time.
Why Install Odoo 17 on Ubuntu 22.04?
Ubuntu 22.04 LTS provides a secure and stable foundation for running enterprise applications. Combined with Odoo 17’s improved performance and modular architecture, this setup gives you a reliable ERP environment that’s easy to maintain and scale.
🧩 Prerequisites
Before beginning the installation, make sure you have the following:
- A Linux server running Ubuntu 22.04
- At least 2 GB of RAM
- Access to a root account or a sudo-enabled user
Step 1: Update and Upgrade Your System
It’s crucial to start with the latest system updates to prevent dependency conflicts. Run the following commands:
sudo apt-get update -y && sudo apt-get upgrade -y
This ensures all system packages are up to date before proceeding.
Step 2: Install Python and Required Dependencies
Odoo 17 is developed in Python 3, so you’ll need Python and several supporting libraries. Install them using:
sudo apt-get install -y python3-pip python3-dev python3-venv libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev libjpeg-dev libpq-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev
These dependencies are essential for building and running Odoo’s backend modules.
Step 3: Install Node.js, NPM, and CSS Tools
Odoo’s front end relies on Node.js for managing CSS and JavaScript assets. Install it with the following commands:
sudo apt-get install -y npm sudo ln -s /usr/bin/nodejs /usr/bin/node sudo npm install -g less less-plugin-clean-css sudo apt-get install -y node-less
This setup allows Odoo to properly compile its web interface and theme resources.
Step 4: Install Wkhtmltopdf (for PDF Reports)
Odoo uses Wkhtmltopdf to generate PDF documents such as invoices and reports. Install it with:
sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb sudo dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb sudo apt install -f
Once installed, Odoo will be able to export reports in PDF format seamlessly.
Step 5: Install and Enable PostgreSQL
PostgreSQL is the database engine behind Odoo. Install and start the service with:
sudo apt-get install postgresql -y sudo systemctl start postgresql && sudo systemctl enable postgresql
Check that it’s running correctly:
sudo systemctl status postgresql
You should see a message indicating the service is active (running).
Step 6: Create Odoo and PostgreSQL Users
For better security and maintainability, create a dedicated system user for Odoo:
sudo useradd -m -U -r -d /opt/odoo17 -s /bin/bash odoo17
Next, create a PostgreSQL user with the same name to allow Odoo to connect to the database:
sudo su - postgres -c "createuser -s odoo17"
Step 7: Download and Configure Odoo 17
Switch to the new Odoo user:
sudo su - odoo17
Clone the official Odoo 17 source code from GitHub:
git clone https://github.com/odoo/odoo --depth 1 --branch 17.0 /opt/odoo17/odoo17
Then, create a Python virtual environment and install all the required dependencies:
cd /opt/odoo17 python3 -m venv odoo17-venv source odoo17-venv/bin/activate pip install --upgrade pip pip install wheel pip install -r odoo17/requirements.txt deactivate
Next, create custom add-on and log directories:
mkdir /opt/odoo17/odoo17-custom-addons sudo mkdir -p /var/log/odoo17 sudo touch /var/log/odoo17.log sudo chown -R odoo17:odoo17 /opt/odoo17 /var/log/odoo17
Step 8: Configure Odoo Settings
Create and edit the main configuration file for Odoo:
sudo nano /etc/odoo17.conf
Add the following configuration details (replace YourStrongPasswordHere with a secure password):
[options] admin_passwd = YourStrongPasswordHere db_host = False db_port = False db_user = odoo17 db_password = False xmlrpc_port = 8069 logfile = /var/log/odoo17/odoo17.log addons_path = /opt/odoo17/odoo17/addons,/opt/odoo17/odoo17-custom-addons
Save and close the file.
Step 9: Set Up Odoo as a Systemd Service
To simplify management and ensure Odoo runs automatically at startup, create a systemd unit file:
sudo nano /etc/systemd/system/odoo17.service
Insert the following content:
[Unit] Description=Odoo 17 ERP Service After=network.target postgresql@14-main.service [Service] Type=simple SyslogIdentifier=odoo17 PermissionsStartOnly=true User=odoo17 Group=odoo17 ExecStart=/opt/odoo17/odoo17-venv/bin/python3 /opt/odoo17/odoo17/odoo-bin -c /etc/odoo17.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
Apply the new service and start Odoo:
sudo systemctl daemon-reload sudo systemctl start odoo17 sudo systemctl enable odoo17
Verify that Odoo is active:
sudo systemctl status odoo17
If everything is configured correctly, you’ll see Odoo 17 running successfully.
Step 10: Access Odoo 17 via Web Browser
Once the service is up and running, open your browser and go to:
http://<your-server-ip>:8069
You’ll be greeted by the Odoo 17 setup screen, where you can create your first database and start exploring the system.
Conclusion
Installing Odoo 17 on Ubuntu 22.04 provides a powerful, flexible foundation for managing business operations across accounting, inventory, sales, HR, and more. While newer versions of Odoo are now available, version 17 continues to deliver excellent stability, broad community support, and compatibility with thousands of business modules — making it a strong choice for production environments.
By following this guide, you’ve successfully configured Python, PostgreSQL, Wkhtmltopdf, and Odoo’s core components to create a fully functional ERP system. You can now access your Odoo instance, add modules, and start customizing workflows to fit your organization’s needs.
Whether you’re deploying Odoo 17 for a small business or integrating it within a larger enterprise setup, this installation provides a secure and scalable base to build upon. As a next step, consider enabling HTTPS with Nginx, setting up automated backups, or connecting Odoo to third-party applications for even greater functionality.
