how-to-install-odoo-19-on-ubuntu-24-04-lts

How to Install Odoo 19 on Ubuntu 24.04 LTS

Installing Odoo 19 on Ubuntu 24.04 LTS is a great way to set up a powerful, open-source ERP system on a stable and secure Linux environment. Whether you’re a developer, business owner, or system administrator, this step-by-step guide will walk you through the installation process, ensuring that your Odoo instance runs smoothly on the latest Ubuntu release.

Step 1: Log in to the Ubuntu Server via SSH

To begin, log in to your server using SSH. This step allows you to access your Ubuntu server remotely:

				
					Connect to your server using SSH:
ssh username@IP_Address -p Port_number
Example:
ssh root@127.0.0.1 -p 22

				
			

Step 2: Update Your Server

Keeping your server updated is crucial for security and performance. Run the following commands to update and upgrade your system:

				
					sudo apt-get update -y
sudo apt-get upgrade -y
				
			

By ensuring your server is up-to-date, you reduce vulnerabilities and ensure compatibility with the latest packages.

Step 3: Secure Your Server

To enhance your server’s security, install Fail2Ban, a tool that helps prevent SSH brute force attacks:

				
					Install fail2ban to prevent SSH attacks:
sudo apt-get install openssh-server fail2ban -y
Start and enable Fail2Ban:
sudo systemctl start fail2ban
sudo systemctl enable fail2ban
Verify Fail2Ban is running:
sudo systemctl status fail2ban

				
			

Step 4: Install Required Packages

Odoo relies on several dependencies to function properly. Install these packages using the following command:

				
					sudo apt-get install python3-pip python3-dev libxml2-dev libxslt1-dev libssl-dev libsasl2-dev libldap2-dev build-essential libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev
				
			

These dependencies are essential for Odoo’s operation and compatibility with your system.

Step 5: Install PostgreSQL

PostgreSQL is the database management system used by Odoo.  
Install PostgreSQL and create a user for Odoo:

Remember to set a strong password for the PostgreSQL user.

				
					sudo apt-get install postgresql
sudo su - postgres
createuser --createdb --username postgres --no-createrole --superuser --pwprompt odoo19
exit

				
			

Step 6: Create a System User for Odoo

Create a dedicated system user for running Odoo:

				
					sudo adduser --system --home=/opt/odoo19 --group odoo19

				
			

This step helps isolate Odoo’s environment from other processes on your server.

Step 7: Clone Odoo 19 from GitHub

Clone the Odoo 19 repository to your server:

				
					sudo su - odoo19 -s /bin/bash
git clone https://www.github.com/odoo/odoo --depth 1 --branch 19.0 --single-branch .
exit

				
			

This ensures that your system has the latest version of Odoo 19.

Step 8: Install Python Packages

Create and activate a Python virtual environment for Odoo 19:

				
					sudo apt install -y python3-venv
sudo python3 -m venv /opt/odoo19/venv
cd /opt/odoo19/
source venv/bin/activate
pip install -r requirements.txt

				
			

Install wkhtmltopdf:

				
					sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb

sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb

sudo apt install -f
 
xfonts-75dpi sudo apt install -f

deactivate

				
			

Step 9:Create Odoo Configuration File

Create the Odoo configuration file /etc/odoo19.conf:

				
					sudo nano /etc/odoo19.conf

				
			
				
					Add the following content:

[options]
   ; This is the password that allows database operations:
   ; admin_passwd = admin
   db_host = localhost
   db_port = 5432
   db_user = odoo19
   db_password = 123456
   addons_path = /opt/odoo19/addons
   default_productivity_apps = True
   logfile = /var/log/odoo19/odoo.log

				
			

Set File Permissions:

Change the ownership and permissions of the configuration file:

				
					sudo chown odoo19: /etc/odoo19.conf
sudo chmod 640 /etc/odoo19.conf

				
			

Create a Log Directory:

Create a directory for storing Odoo logs:

				
					sudo mkdir /var/log/odoo19
sudo chown odoo19:root /var/log/odoo19

				
			

Step 10: Create the Service File

Create a new systemd service file for Odoo:

				
					sudo nano /etc/systemd/system/odoo19.service

				
			

Add the following configuration:

				
					[Unit]
Description=odoo19
Documentation=http://www.odoo.com

[Service]
# Ubuntu/Debian convention:
Type=simple
User=odoo19
ExecStart=/usr/bin/python3 /opt/odoo19/odoo-bin -c /etc/odoo19.conf

[Install]
WantedBy=default.target

				
			

Set Permissions for the Service File:

Secure the service file:

				
					sudo chmod 755 /etc/systemd/system/odoo19.service
sudo chown root: /etc/systemd/system/odoo19.service

				
			

Step 11: Start Odoo Service

Start the Odoo service:

				
					sudo systemctl start odoo19.service

				
			

Step 12: Enable Odoo Service at Boot

Enable Odoo to start automatically on boot:

				
					sudo systemctl enable odoo19.service
				
			

Step 13: Access Odoo in Your Browser

Finally, open your web browser and navigate to: http://<your_domain_or_IP_address>:8069 

Picture of Alfred Joshi

Alfred Joshi

I’m Alfred Joshi, a Linux System Administrator passionate about system optimization, security, and automation. Here, I share insights and tips on Linux and open-source technologies.

Get a free quote