How to Install Odoo 20 on Ubuntu 24.04 LTS
How to Install Odoo 20 on Ubuntu 24.04 LTS
If you want to install Odoo 20 on Ubuntu 24.04 LTS, this step-by-step guide will show you the complete installation process using the official source code.Odoo 20 is the latest version of the popular open-source ERP platform, offering a complete suite of business applications, including Accounting, CRM, Sales, Inventory, Manufacturing, and HR.
In this tutorial,We’ll install the required dependencies, configure PostgreSQL, create a Python virtual environment, and set up Odoo as a Systemd service following the recommended installation method.
Whether you’re setting up Odoo for development, testing, or a future production deployment, this guide will help you install Odoo 20 successfully on Ubuntu 24.04 LTS.
Let’s get started.
Prerequisites to Install Odoo 20 on Ubuntu
Before you begin, make sure your system meets the following requirements:
- At least 4-5 GB of available disk space
- Ubuntu 24.04 LTS (64-bit)
- A user account with sudo privileges (or root access)
- PostgreSQL 16 or later
- Python 3.12 or later
- At least 4 GB of RAM (8 GB recommended for production)
Quick Installation of Odoo 20 on Ubuntu (Optional)
If you want to automate the installation process, you can use our Odoo 20 Installation Script available on GitHub. The script automates most of the installation steps, allowing you to set up Odoo more quickly while reducing manual configuration.
GitHub Repository:
https://github.com/banastech/odoo-installation-script
If you prefer to install Odoo manually or want to understand each step of the process, follow the step-by-step installation guide below.
Step-by-Step Installation Odoo 20 on Ubuntu Guide
Step 1: Update the System
Before installing Odoo 20, update your Ubuntu system to ensure all installed packages are up to date. This helps prevent compatibility issues and ensures you’re working with the latest security updates.
sudo apt update && sudo apt upgrade -y
Once the update is complete, proceed to install the required dependencies.
Step 2: Install Required Dependencies
Odoo requires several system packages, development libraries, and Python tools to install and run correctly. Install all the required dependencies using the following command.
sudo apt install -y git python3-pip python3-venv python3-dev \
build-essential wget curl gcc g++ make \
libxml2-dev libxslt1-dev libzip-dev zlib1g-dev \
libsasl2-dev libldap2-dev libjpeg-dev libpq-dev \
libffi-dev libssl-dev liblcms2-dev \
libblas-dev libatlas-base-dev npm xfonts-75dpi \
xfonts-base fontconfig
Depending on your internet connection, this process may take a few minutes.
Step 3: Install PostgreSQL and Create a PostgreSQL User
PostgreSQL is the default database management system used by Odoo to store application and business data. Install PostgreSQL and its additional utilities by running the following command.
sudo apt install postgresql postgresql-contrib -y
After the installation is complete, verify that the PostgreSQL service is running.
sudo systemctl status postgresql
Create a new PostgreSQL user named odoo20.
sudo -u postgres createuser --createdb --no-createrole --no-superuser odoo20
This user will be used by Odoo to create and manage its databases.
Step 4: Create an Odoo System User
Running Odoo under a dedicated Linux user is a recommended security practice. It keeps application files organized and limits system access.
Create the Odoo system user.
sudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo20
Step 5: Install wkhtmltopdf
Odoo uses wkhtmltopdf to generate PDF reports such as invoices, quotations, purchase orders, and other printable documents.
Install it using:
sudo apt install wkhtmltopdf -y
After installation, Odoo will be able to generate PDF reports without additional configuration.
Step 6: Download Odoo 20 Source Code
Download the latest Odoo 20 source code from the official GitHub repository.
sudo su - odoo20
Clone Odoo 20 from official GitHub repository:
git clone https://github.com/odoo/odoo --depth 1 --branch 20.0 --single-branch odoo20
This command downloads only the latest branch history, reducing download time and disk usage.
Step 7: Create a Python Virtual Environment
Using a Python virtual environment keeps Odoo’s Python packages isolated from the rest of the operating system. This simplifies dependency management and prevents package conflicts.
Create a virtual environment.
cd /opt/odoo
python3 -m venv venv-20
Activate it.
source venv-20/bin/activate
Step 8: Install Python Dependencies
Upgrade pip and install all the Python packages required by Odoo 20.
cd odoo20
pip install --upgrade pip wheel setuptools
pip install -r requirements.txt
This process may take several minutes depending on your internet connection.
Step 9: Create the Log Directory
Create a directory to store Odoo log files.
sudo mkdir -p /var/log/odoo
Assign the correct ownership.
sudo chown -R odoo20:odoo20 /var/log/odoo
Step 10: Create the Odoo Configuration File
The Odoo configuration file stores important settings such as the database user, addons path, log file location, and other application parameters.
Create the configuration file.
sudo nano /etc/odoo20.conf
Add the following configuration.
[options]
admin_passwd = ChangeThisToAStrongPassword
db_host = False
db_port = False
db_user = odoo20
db_password = False
addons_path = /opt/odoo/odoo20/addons
logfile = /var/log/odoo/odoo20.log
Save the file by pressing Ctrl + O, Enter, and then exit the editor with Ctrl + X.
Note: Replace ChangeThisToAStrongPassword with a strong password of your choice. This password is used to manage Odoo databases (create, restore, duplicate, and delete databases), so do not leave it as the default value.
Optional: Secure the Configuration File
For improved security, restrict access to the Odoo configuration file so that only the Odoo user and group can read it.
sudo chown odoo20:odoo20 /etc/odoo20.conf
sudo chmod 640 /etc/odoo20.conf
This helps protect sensitive configuration settings, such as the database user and the Odoo master password, from unauthorized access.
Step 11: Create the Systemd Service
Creating a Systemd service allows Odoo to start automatically when the server boots and makes it easier to manage.
Create the service file.
sudo nano /etc/systemd/system/odoo20.service
Add the following configuration.
[Unit]
Description=Odoo 20 ERP
After=network.target postgresql.service
[Service]
Type=simple
User=odoo20
Group=odoo20
WorkingDirectory=/opt/odoo/odoo20
ExecStart=/opt/odoo/venv-20/bin/python3 /opt/odoo/odoo20/odoo-bin -c /etc/odoo20.conf
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
Save the file by pressing Ctrl + O, Enter, and then exit the editor with Ctrl + X.
Step 12: Reload Systemd
Reload the Systemd daemon so it recognizes the new service.
sudo systemctl daemon-reload
Step 13: Enable and Start the Odoo Service
Enable the Odoo service to start automatically at boot and start it immediately.
sudo systemctl enable --now odoo20.service
Step 14: Verify the Installation
Verify that the Odoo service is running.
sudo systemctl status odoo20.service
If the service status displays active (running), Odoo has been installed successfully.
Step 15: Access Odoo 20
Open your web browser and visit:
http://YOUR_SERVER_IP:8069
The Odoo database setup page will appear. Create your first database to begin using Odoo 20.
To monitor Odoo logs in real time for troubleshooting or activity monitoring, run:
tail -f /var/log/odoo/odoo20.log
Support
Installing Odoo 20 on Ubuntu is straightforward when you follow the steps in this guide carefully. If you encounter any issues during installation, review the service status and log files to identify the cause before proceeding with troubleshooting.
If you need assistance with Odoo 20 installation, migration, customization, performance optimization, or server deployment, feel free to Contact Us.
We provide professional Odoo development, customization, integration, migration, hosting, and ongoing support services for Odoo Community and Enterprise editions.