How to Install Odoo 19 on Ubuntu 24.04


How to Install Odoo 19 on Ubuntu 24.0


If you're running Ubuntu 24.04 and want to install Odoo 19, this guide will walk you through the process.

 Prerequisites

Before diving into the installation process, make sure you have:

  • A clean installation of Ubuntu 24.04 (or any version of Ubuntu compatible with Odoo).

  • Root or sudo privileges on the server.

  • A Python environment (as Odoo is built on Python).


Step 1: Update Your System





Initial update to ensure your system packages are compatible. Run the following commands to update:

sudo apt update
sudo apt upgrade -y

Step 2: Install Dependencies

Odoo requires several dependencies to run smoothly.

























Install the necessary packages using the following command:


sudo apt install -y python3-dev python3-pip python3-venv libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libmysqlclient-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev

These packages will ensure that Odoo has all the libraries it needs for smooth operation.


Step 3: Install PostgreSQL

Odoo uses PostgreSQL as its database backend. Install it with the following commands:

sudo apt install -y postgresql

Next, create a PostgreSQL user for Odoo:

sudo -u postgres createuser --createdb --pwprompt --interactive --pwprompt odoo

Once you create the user, set the user to have administrative privileges:

sudo -u postgres psql
ALTER USER odoo WITH SUPERUSER;
\q

Step 4: Install Odoo 19

Now, let's install Odoo. We'll use a Python virtual environment to keep dependencies isolated.

  1. First, create a directory where Odoo will be installed:

    mkdir /opt/odoo
    cd /opt/odoo
  2. Next, create a Python virtual environment:

    python3 -m venv odoo-venv
    source odoo-venv/bin/activate
  3. Install Odoo's required Python packages:

    pip install wheel
    pip install -r https://github.com/odoo/odoo/raw/19.0/requirements.txt
  4. Download Odoo 19 from GitHub:

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

Step 5: Create a System User for Odoo

For security reasons, it's best to run Odoo as a non-root user. Create a new user dedicated to running 
                                                                                                                                                                                                                                                                                                                                         

Odoo         

sudo useradd --system --home /opt/odoo --create-home --shell /bin/bash --comment "Odoo User" odoo
sudo chown -R odoo:odoo /opt/odoo

Step 6: Configure Odoo

You’ll need to configure Odoo before running it. Create a configuration file for Odoo:

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

In the odoo.conf file, make the following changes:

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

Make sure to replace admin_passwd with a secure password of your choice.


Step 7: Create a Systemd Service File

To run Odoo as a service and automatically start it on boot, create a systemd service file:

  1. Create the service file:

    sudo nano /etc/systemd/system/odoo.service
  2. Paste the following content into the file:

    [Unit]
    Description=Odoo
    Documentation=http://www.odoo.com
    After=network.target
    
    [Service]
    Type=simple
    User=odoo
    ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo-bin --config=/etc/odoo.conf
    WorkingDirectory=/opt/odoo
    StandardOutput=journal
    StandardError=journal
    Restart=always
    
    [Install]
    WantedBy=default.target
  3. Reload the systemd services and enable Odoo to start on boot:

    sudo systemctl daemon-reload
    sudo systemctl enable odoo

Step 8: Start Odoo

You’re now ready to start the Odoo service. To start Odoo, run:

sudo systemctl start odoo

You can check the status of the Odoo service:

sudo systemctl status odoo

If everything is set up correctly, you should see Odoo running.


Step 9: Access Odoo via Browser

Open your web browser and navigate to:

http://<your-server-ip>:8069
You should be greeted with the Odoo setup screen. Follow the on-screen instructions to set up your database and start using Odoo!

Conclusion

You’ve successfully installed Odoo 19 on your Ubuntu 24.04 server! You can now begin exploring its powerful features and integrating them into your business workflow. Feel free to explore additional configurations, such as setting up an SSL certificate or using Odoo with multiple databases. 
Keep in mind that regular backups and updates are important for the security and stability of your Odoo system.


Comments

Popular posts from this blog

Odoo Technical Interview Questions and Answers

Adding a domain name to Odoo Community Edition and configuring Nginx as a reverse proxy

Odoo 18: A Comprehensive Guide to the Latest Features