Enable Dark Mode!
how-to-install-odoo-19-on-ubuntu-24-lts-server.jpg
By: Abhijith CK

How to Install Odoo 19 on Ubuntu 24 LTS Server

Technical Odoo 19 Odoo Enterprises Odoo Community

The newly launched Odoo 19 introduces a wide range of functional and technical improvements. With this release, Odoo continues its focus on enhancing usability and simplifying business workflows.

Step 1: Log in to the Ubuntu Server

Before starting the installation, make sure you’re logged in to your Ubuntu 24.04 server. If you’re working on a remote machine, connect via SSH. If you have direct access, you can log in locally from the server itself.

Depending on your environment, there are several ways to access your Ubuntu 24.04 server. Below are three commonly used methods:

1. Logging in with a Username and IP Address (Default Port)

If your server is configured with the standard SSH port (22) and doesn’t require any custom authentication, you can connect with:

ssh username@server_ip

username : your server’s login name.

server_ip : the IP address assigned to your server.

2. Logging in with a Specific Port

If your server is configured with an SSH port other than the default (22), you’ll need to include the port number in your connection command:

ssh -p port_number username@server_ip
  • port_number: the SSH port configured on your server.
  • username: your server’s login name.
  • server_ip: the IP address assigned to your server.

3. Logging in with a PEM Key

If your server is set up to require a PEM key for authentication, connect using the following command:

ssh -i /path/to/your/key.pem username@server_ip
  • /path/to/your/key.pem: Specify the complete path where your PEM key file is stored.
  • username: The login name you use for your server.
  • server_ip: The IP address assigned to your server.

Select the login method that matches your setup. Once connected, you can move forward with the Odoo 19 installation process.

Step 2: Update the Server

Before installing Odoo 19, make sure your Ubuntu 24.04 server is fully updated. Keeping your system up to date ensures you have the latest security patches and software improvements.

The following command refreshes your system’s package index, making sure Ubuntu is aware of the most recent versions available:

sudo apt-get update

Use the following command to update all currently installed packages on your server to their latest available versions:

sudo apt-get upgrade

The update process may take some time, depending on how many packages need upgrading. Once it’s done, your server will be up to date and ready for the upcoming installation steps.

Step 3: Secure the Server

Protecting your server from unauthorized access is an essential step before moving forward. Implement the following measures to strengthen your Ubuntu 24.04 server’s security:

To enable remote management, you’ll need the OpenSSH Server package. It allows your server to accept SSH connections securely. Install it with:

sudo apt-get install openssh-server

Fail2Ban is a security tool that defends your server against brute-force attempts. It works by monitoring authentication logs for repeated failed login attempts and temporarily blocking the offending IP addresses. Install it with:

sudo apt-get install fail2ban

After installation, start the Fail2Ban service and enable it to start automatically on boot.

sudo systemctl start fail2ban
sudo systemctl enable fail2ban

To confirm that Fail2Ban is active and functioning, run the following command:

sudo systemctl status fail2ban

Implementing these security measures will help safeguard your server against common threats and unauthorized access. Once your server is properly secured, you’re ready to continue with the Odoo 19 installation.

Step 4: Install Packages and Libraries

Before installing Odoo 19, you need to install several essential packages and libraries to ensure the system functions properly. Follow these commands:

Pip is the official package manager for Python and is necessary for installing and managing Python libraries. Install it with the following command:

sudo apt-get install -y python3-pip

Odoo requires several development libraries and dependencies to build and run properly. Install them with the following command:

sudo apt-get install -y python3-dev 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

Node.js is needed for certain frontend tasks in Odoo, and NPM is its package manager. Install them on your server with the following commands:

sudo apt-get install -y npm

In some cases, Node.js is installed under the name nodejs, while certain applications expect the command node. To ensure compatibility, create a symbolic link with the following command:

sudo ln -s /usr/bin/nodejs /usr/bin/node

Odoo uses Less as a CSS pre-processor, and the Clean-CSS plugin helps minify CSS files for better performance. Install both with the following command:

sudo npm install -g less less-plugin-clean-css

The node-less package integrates the Less CSS pre-processor with Node.js, allowing Odoo to compile CSS correctly. Install it using:

sudo apt-get install -y node-less

Following these steps installs all the required packages and libraries needed for Odoo 19. Once completed, your server will have all the prerequisites in place, ready for the next stage of the installation process.

Step 5: Set Up the Database Server

Odoo 19 uses PostgreSQL to manage its database. Follow these steps to install and set up PostgreSQL on your Ubuntu 24.04 server:

To set up the PostgreSQL database server on Ubuntu 24.04, run the following command:

sudo apt-get install -y postgresql

PostgreSQL manages databases under its own system user. Switch to this user to create a dedicated database user for Odoo:

sudo su - postgres

PostgreSQL operates under a separate system user account. To create a dedicated database user for Odoo, first switch to the PostgreSQL user:

createuser --createdb --username postgres --no-createrole --superuser --pwprompt odoo19
  • createdb: allows the user to create new databases.
  • username postgres: specifies that the PostgreSQL superuser will execute the command.
  • no-createrole: prevents the user from creating additional roles.
  • superuser: grants the user full superuser privileges.
  • pwprompt: prompts you to enter a password for the new user.

odoo19 : the name of the new PostgreSQL user you are creating for Odoo.

After creating the PostgreSQL user, return to your normal system user by exiting the PostgreSQL session:

exit

Step 6: Create a System User for Odoo

Creating a separate system user for Odoo ensures the application has the correct permissions and operates independently, without affecting other system processes.

Create a dedicated system user for Odoo, including a home directory where the application will reside:

sudo adduser --system --home=/opt/odoo19 --group odoo19
  • system: creates a system user with a lower UID, suitable for running services.
  • home=/opt/odoo19: sets the home directory for the new user.
  • group odoo19: creates a group with the same name and adds the user to it.

With a dedicated system user and PostgreSQL database in place, Odoo 19 now has a secure environment to operate. You’re ready to move on to the installation and configuration steps.

Step 7: Get Odoo 19 Community Edition from GitHub

To install Odoo 19, start by cloning its official repository from GitHub. Follow these steps:

Git is a version control system required to clone the Odoo repository. Install it on your Ubuntu 24.04 server using the following command:

sudo apt-get install -y git

Log in as the dedicated Odoo system user you created earlier. This ensures that all Odoo files are owned by the correct user and have the appropriate permissions:

sudo su - odoo19 -s /bin/bash

Use Git to clone the Odoo 19 Community Edition repository. The --depth 1 option fetches only the latest commit, and --branch master ensures you get the most recent stable release:

git clone https://www.github.com/odoo/odoo --depth 1 --branch 19.0 --single-branch .

After cloning the Odoo repository, return to your regular system user account by exiting the Odoo user session:

exit

With the Odoo 19 repository cloned, you can now move forward with configuring and installing the application.

Step 8: Install Required Python Packages

To make sure Odoo 19 operates correctly, you should create a Python virtual environment and install all necessary Python packages along with additional dependencies. Follow these steps:

1. Install Python 3 Virtual Environment Package: This package lets you create isolated Python environments, ensuring that the Python libraries for Odoo 19 do not interfere with the system-wide Python installation.

     sudo apt install -y python3-venv

2. Create a Python Virtual Environment: Set up a Python virtual environment in the Odoo home directory (/opt/odoo19/) to keep its dependencies isolated from the system Python:

   sudo python3 -m venv /opt/odoo19/venv

3. Activate the Virtual Environment: First, switch to the Odoo system user and then activate the virtual environment to install Odoo’s Python dependencies:

sudo -s
   cd /opt/odoo19/
   source venv/bin/activate

4. Install Python Dependencies: While the virtual environment is active, use pip to install all the necessary Python packages specified in Odoo’s requirements.txt file:

   pip install -r requirements.txt

5. Install wkhtmltopdf: Odoo uses ‘wkhtmltopdf’ to generate PDF reports. Download and install the appropriate .deb package for Ubuntu 24.04:

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

6. Install OpenSSL Dependency: If your Odoo 19 installation requires SSL support, make sure the OpenSSL library is installed:

   sudo wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
   sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb

7. Install Additional Fonts: To ensure proper rendering of PDF reports, install the required font packages for wkhtmltopdf:

   sudo apt-get install -y xfonts-75dpi

8. Install wkhtmltopdf Package: After downloading the wkhtmltopdf .deb package, install it on your server using:

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

9. Fix Dependency Issues: This command automatically fixes any missing dependencies that might have occurred during the installation of the wkhtmltopdf package

   sudo apt install -f

10. Deactivate the Virtual Environment: After installing all required Python packages and dependencies, exit the virtual environment to return to the normal shell:

    deactivate

Following these steps ensures that all required Python packages and system dependencies are installed, preparing your server for the Odoo 19 installation.

Step 10: Set Up the Configuration File

To configure Odoo 19, create and edit its configuration file. This file holds key settings for the Odoo server, including database connection information, log file locations, and other server options.

1. Copy the Default Configuration File: Copy the example Odoo configuration file to the /etc directory and rename it for use with your Odoo installation:

   sudo cp /opt/odoo19/debian/odoo.conf /etc/odoo19.conf

2. Edit the Configuration File: Open the Odoo configuration file in a text editor to modify its settings according to your server and database setup:

    sudo nano /etc/odoo19.conf

3. Modify the Configuration File: Edit the Odoo configuration file and update it with the recommended settings. Make sure to replace the placeholders with your actual server and database values:

 [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
   logfile = /var/log/odoo/odoo19.log

  • db_host: set to localhost if PostgreSQL is running on the same server.
  • db_user: the PostgreSQL user created specifically for Odoo.
  • db_password: the password for the PostgreSQL user.
  • addons_path: full path to the Odoo addons directory (e.g., /opt/odoo19/addons).
  • logfile: full path to the Odoo log file (e.g., /var/log/odoo19/odoo.log).

4. Set File Permissions: Update the ownership and permissions of the Odoo configuration file to ensure that only the Odoo system user can access it:

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

5. Create a Log Directory: Create a dedicated directory for Odoo logs and assign the correct ownership and permissions so that the Odoo system user can write log files:

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

By following these steps, you have configured Odoo 19 with the necessary settings. You are now ready to start the Odoo service and continue with additional configurations.

To manage Odoo 19 as a service on your Ubuntu 24.04 server, create a systemd service file. This will allow you to start, stop, and enable Odoo to run automatically at system boot.

Create the Service File: Open a new systemd service file to define the Odoo 19 service:

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

Add the Service Configuration: Paste the following content into the odoo19.service file. This configuration defines how the Odoo 19 service will run on your server:.

[Unit]
Description=Odoo19
Documentation=http://www.odoo.com
[Service]
# Ubuntu/Debian convention:
Type=simple
User=odoo19
ExecStart=/opt/odoo19/venv/bin/python3.12 /opt/odoo19/odoo-bin -c /etc/odoo19.conf
[Install]
WantedBy=default.target
  • Type=simple: runs the service in the foreground.
  • User=odoo19: executes the service as the dedicated Odoo system user.
  • ExecStart: the command used to start Odoo, specifying the Odoo executable and its configuration file.

Set Permissions for the Service File: Set the correct ownership and permissions on the Odoo systemd service file to prevent unauthorized modifications:

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

Start the Odoo Service: Start the Odoo 19 service using systemctl to launch it immediately:

sudo systemctl start odoo19.service

Access Odoo in Your Browser: Open your web browser and go to the following address to access your Odoo 19 instance:

http://<your_domain_or_IP_address>:8069

Replace with your server’s actual domain name or IP address. Odoo 19 uses port 8069 by default, so include it in the URL unless you have configured a different port.

Monitor the Odoo Log: To view Odoo 19’s log output in real time and check for errors or status updates, use the tail command:

sudo tail -f /var/log/odoo/odoo19.log

Enable the Odoo Service at Boot: Configure the Odoo 19 service to start automatically at system boot:

sudo systemctl enable odoo19.service

Restart the Odoo Service: If you make changes to the configuration or system settings, restart the Odoo 19 service to apply

sudo systemctl restart odoo19.service

By following these steps, Odoo 19 should now be running on your Ubuntu 24.04 server. You can access it through your web browser, and the service is configured to start automatically whenever the server boots.

Installing Odoo 19 on an Ubuntu 24.04 server requires several steps, including preparing the server environment, configuring system services, and securing your setup. By following this guide, you have successfully deployed Odoo 19—a robust and flexible ERP solution—ready to streamline and optimize your business operations.

Whether you are an Odoo functional consultant, developer, or business owner, this guide provides the knowledge needed to deploy Odoo 19 with confidence. You can now focus on utilizing Odoo’s powerful features to optimize your business processes and achieve your organizational goals.

To read more about How to setup Odoo 19 development environment using pycharm in ubuntu, refer to our blog How to setup Odoo 19 development environment using pycharm in ubuntu.


If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



whatsapp_icon
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message