How To Install Odoo on Ubuntu 24.04 LTS
In this tutorial, we will show you how to install Odoo on Ubuntu 24.04 LTS. Odoo is a powerful open-source ERP (Enterprise Resource Planning) software that offers a wide range of business management features, including CRM, accounting, inventory management, and more. With its user-friendly interface and modular design, Odoo has become a popular choice for businesses of all sizes looking to streamline their operations and boost productivity.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the Odoo open source ERP and CRM on Ubuntu 24.04 (Noble Numbat). You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.
Prerequisites
- A server running one of the following operating systems: Ubuntu and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- Python version 3.11 (Odoo 17 does not support Python 3.12).
- An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies.
- An Ubuntu 24.04 system with root access or a user with sudo privileges.
Install Odoo on Ubuntu 24.04
Step 1. Preparing Your System.
To begin, it’s crucial to update your system packages to their latest versions. This ensures that you have access to the most recent security patches and bug fixes. Open your terminal and run the following command:
sudo apt update sudo apt upgrade
This command will update the package list and upgrade all installed packages to their latest versions.
Step 2. Installing Dependencies.
Odoo requires several dependencies to function properly. To install these dependencies, run the following command:
sudo apt install build-essential wget git python3.11-dev python3.11-venv libfreetype-dev libxml2-dev libzip-dev libsasl2-dev node-less libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libldap2-dev libtiff5-dev libopenjp2-7-dev libcap-dev
Step 3. Create a System User for Odoo.
To enhance security, it’s recommended to run Odoo under a dedicated system user. This helps isolate Odoo from other processes and limits potential damage in case of a security breach. To create a new system user for Odoo, run the following command:
sudo adduser --system --group --home /opt/odoo odoo
This command creates a new user named “odoo
” with a home directory located at /opt/odoo
.
Step 4. Installing PostgreSQL.
Odoo uses PostgreSQL as its database backend. To install PostgreSQL, run the following command:
sudo apt install postgresql
After installing PostgreSQL, create a PostgreSQL user matching the system user you created earlier:
sudo -u postgres createuser -s odoo
This command creates a PostgreSQL user named “odoo
” with superuser privileges.
Step 5. Installing wkhtmltopdf.
wkhtmltopdf is a utility that Odoo uses for generating PDF reports. To install wkhtmltopdf, run the following command:
sudo apt install wkhtmltopdf
Step 6. Download and Install Odoo.
Now that we have all the prerequisites in place, let’s download and install Odoo. We’ll clone the Odoo repository from GitHub using the following command:
sudo -H -u odoo git clone https://github.com/odoo/odoo /opt/odoo --depth 1 --branch 17.0 --single-branch
This command clones the Odoo repository into the /opt/odoo
directory, using the “odoo
” user. The --depth 1
option ensures that only the latest commit is fetched, while --branch 17.0
and –-single-branch
options specify that we want to clone only the 17.0 branch.
Next, create a Python virtual environment for Odoo and activate it:
python3 -m venv /opt/odoo/odoo-venv source /opt/odoo/odoo-venv/bin/activate
These commands create a new Python virtual environment located at /opt/odoo/odoo-venv
and activate it. Using a virtual environment helps keep Odoo’s Python dependencies isolated from other Python packages installed on your system.
With the virtual environment activated, install Odoo’s Python dependencies:
pip install -r /opt/odoo/odoo/requirements.txt
This command installs all the necessary Python packages listed in the requirements.txt
file.
Step 7: Configure Odoo.
To configure Odoo, create a new configuration file named odoo.conf
:
sudo nano /etc/odoo.conf
Add the following lines to the configuration file:
[options] ; This is the password that allows database operations: admin_passwd = your_admin_password db_host = False db_port = False db_user = odoo db_password = False addons_path = /opt/odoo/odoo/addons,/opt/odoo/odoo/odoo/addons
Replace your_admin_password
with a strong password for the Odoo administrator account. The addons_path
setting specifies the locations where Odoo will look for addon modules.
Save the file and exit the text editor.
Step 8. Setup Odoo as a Systemd Service.
To ensure that Odoo starts automatically on system boot and can be easily managed using systemd
, create a new systemd
service file:
sudo nano /etc/systemd/system/odoo.service
Add the following content to the file:
[Unit] Description=Odoo After=postgresql.service [Service] Type=simple SyslogIdentifier=odoo PermissionsStartOnly=true User=odoo Group=odoo ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
This service file defines how systemd should manage the Odoo service. It specifies the user and group under which Odoo should run, the command to start Odoo, and the configuration file to use. Save the file and exit the text editor.
Then, reload the systemd configuration:
sudo systemctl daemon-reload
Enable the Odoo service to start automatically on system boot:
sudo systemctl enable odoo
Finally, start the Odoo service:
sudo systemctl start odoo
Step 9. Testing the Installation.
To verify that your Odoo installation is working correctly, open a web browser and navigate to http://localhost:8069.
You should see the Odoo login page.
If you encounter any issues, check the Odoo service status using the following command:
sudo systemctl status odoo
This command will display the current status of the Odoo service and any error messages that may help you troubleshoot the issue.
Congratulations! You have successfully installed Odoo. Thanks for using this tutorial for installing the Odoo open source ERP and CRM on the Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the official Odoo website.