How to Install Odoo on AlmaLinux, Rocky Linux, Debian, and Ubuntu

Odoo is a suite of open-source business applications that covers everything from CRM to accounting. This guide will walk you through installing Odoo on AlmaLinux, Rocky Linux, Debian, and Ubuntu.


Prerequisites:

Before starting the installation, ensure the following:

  • A server running AlmaLinux, Rocky Linux, Debian, or Ubuntu.
  • Root or sudo access to your server.
  • Python 3, PostgreSQL, and other dependencies installed.
  • A domain or subdomain pointing to your server.

Step 1: Update the System

Make sure your system is up-to-date with the latest packages.

  • For Ubuntu/Debian:
 
sudo apt update && sudo apt upgrade -y
  • For AlmaLinux/Rocky Linux:
 
sudo dnf update -y

Step 2: Install Required Software

Odoo requires Python 3, PostgreSQL, and several Python dependencies. Let's install them.

  1. Install Python 3 and required dependencies:
  • For Ubuntu/Debian:
 
sudo apt install python3 python3-pip python3-dev build-essential libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev libssl-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev -y
  • For AlmaLinux/Rocky Linux:
 
sudo dnf install python3 python3-pip python3-devel gcc libxml2-devel libxslt-devel zlib-devel openldap-devel libjpeg-devel python3-ldap python3-psycopg2 -y
  1. Install PostgreSQL (Odoo uses PostgreSQL as its database backend):
  • For Ubuntu/Debian:
 
sudo apt install postgresql postgresql-contrib -y
  • For AlmaLinux/Rocky Linux:
 
sudo dnf install postgresql-server postgresql-contrib -y

Step 3: Create a PostgreSQL User for Odoo

  1. Start PostgreSQL and log into the PostgreSQL shell:
 
sudo systemctl start postgresql sudo -u postgres psql
  1. Create a PostgreSQL user and database for Odoo:
sql
 
CREATE USER odoo WITH PASSWORD 'your_password'; CREATE DATABASE odoo OWNER odoo; \q

Step 4: Install Odoo

  1. Install Odoo from the official GitHub repository:
 
cd /opt sudo git clone https://www.github.com/odoo/odoo --depth 1 --branch 15.0 --single-branch odoo cd odoo
  1. Install Python dependencies for Odoo using pip:
 
sudo pip3 install -r /opt/odoo/requirements.txt

Step 5: Configure Odoo

  1. Create a configuration file for Odoo:
 
sudo cp /opt/odoo/debian/odoo.conf /etc/odoo.conf
  1. the Odoo configuration file:
 
sudo nano /etc/odoo.conf

Add the following content, updating with your own information:

ini
 
[options] ; This is the password that allows database operations: admin_passwd = admin_password db_host = False db_port = False db_user = odoo db_password = your_password dbfilter = ^%d$ logfile = /var/log/odoo/odoo.log addons_path = /opt/odoo/addons xmlrpc_port = 8069
  1. Create a directory for Odoo logs:
 
sudo mkdir /var/log/odoo sudo chown -R odoo: /var/log/odoo

Step 6: Start Odoo

  1. Run Odoo to check that everything is working:
 
sudo python3 /opt/odoo/odoo-bin -c /etc/odoo.conf
  1. Access Odoo in your web browser at http://yourdomain.com:8069.

You will be prompted to create a new database for your Odoo instance. You can log in using the admin password you set in the odoo.conf file.


Step 7: Set Up Odoo to Start on Boot

  1. Create a systemd service file for Odoo:
 
sudo nano /etc/systemd/system/odoo.service
  1. Add the following content:
ini
 
[Unit] Description=Odoo Documentation=http://www.odoo.com After=network.target [Service] Type=simple User=odoo ExecStart=/usr/bin/python3 /opt/odoo/odoo-bin -c /etc/odoo.conf ExecStop=/bin/kill -s TERM $MAINPID WorkingDirectory=/opt/odoo StandardOutput=journal+console [Install] WantedBy=default.target
  1. Enable and start the Odoo service:
 
sudo systemctl enable odoo sudo systemctl start odoo

Step 8: Secure Odoo with SSL (Optional)

For production environments, it is recommended to secure Odoo with SSL. You can use Let’s Encrypt to obtain a free SSL certificate.

  1. Install Certbot:
  • For Ubuntu/Debian:
 
sudo apt install certbot python3-certbot-nginx -y
  • For AlmaLinux/Rocky Linux:
 
sudo dnf install certbot python3-certbot-nginx -y
  1. Obtain an SSL certificate:
 
sudo certbot --nginx -d yourdomain.com
  1. Restart NGINX to apply the SSL configuration.

Step 9: Access Odoo in the Browser

Open your browser and visit http://yourdomain.com:8069 or https://yourdomain.com if you set up SSL. You should now be able to access the Odoo web interface and configure your company, apps, and users.


Conclusion

You have successfully installed Odoo on your AlmaLinux, Rocky Linux, Debian, or Ubuntu server. You can now manage your business processes with Odoo's wide range of applications.

Was this answer helpful? 0 Users Found This Useful (0 Votes)

Powered by WHMCompleteSolution