AlmaLinuxRHEL Based

How To Install Odoo on AlmaLinux 9

Install Odoo on AlmaLinux 9

Odoo is a powerful open-source ERP (Enterprise Resource Planning) software that provides a suite of business applications to help companies manage their operations efficiently. With its modular architecture, Odoo offers features ranging from CRM and project management to e-commerce and inventory management. In this guide, we will walk you through the steps to install Odoo on AlmaLinux 9, ensuring that you have a robust platform for your business needs.

Understanding Odoo

Odoo is designed to cater to various business requirements, making it a versatile choice for organizations of all sizes. Its key features include:

  • CRM: Manage customer relationships and sales pipelines effectively.
  • ERP: Streamline operations across finance, HR, and supply chain.
  • E-commerce: Build online stores with integrated payment solutions.
  • Project Management: Track tasks, deadlines, and team collaboration.

Odoo is available in two editions: Community and Enterprise. The Community edition is free and open-source, while the Enterprise edition includes additional features and support. Choosing the right edition depends on your business requirements and budget.

Prerequisites for Installation

Before proceeding with the installation, ensure that your system meets the following prerequisites:

  • System Requirements: At least 2 GB of RAM, 2 CPU cores, and 20 GB of storage space.
  • Software Dependencies: Python 3.x, PostgreSQL database server, and various development tools.
  • User Privileges: You need root or sudo privileges to install software packages.
  • Terminal Access: Ensure you can access the terminal via SSH or directly on the server.

Step 1: Update the System

The first step in preparing your AlmaLinux system for Odoo installation is to update all existing packages. This ensures that you have the latest security patches and software versions. Run the following command in your terminal:

sudo dnf update -y

This command updates all installed packages to their latest versions. Once completed, you are ready for the next step.

Step 2: Install Required Dependencies

Odoo requires several software packages to function correctly. Install these dependencies using the following command:

sudo dnf install python3 python3-devel git gcc redhat-rpm-config libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel curl unzip -y

This command installs essential packages such as Python development libraries, Git for version control, and various libraries required by Odoo. Each package plays a vital role in ensuring that Odoo operates smoothly.

Step 3: Install PostgreSQL

PostgreSQL serves as the database backend for Odoo. To install PostgreSQL on AlmaLinux 9, follow these steps:

Add the PostgreSQL repository:

sudo dnf module enable postgresql:15

Install PostgreSQL server and client:

sudo dnf install postgresql-server postgresql-contrib -y

Initialize the PostgreSQL database:

sudo postgresql-setup --initdb

Start and enable PostgreSQL service:

sudo systemctl start postgresql
sudo systemctl enable postgresql

This process sets up PostgreSQL on your server, allowing Odoo to connect to its database seamlessly.

Step 4: Create a PostgreSQL User for Odoo

The next step is to create a dedicated PostgreSQL user for Odoo. This user will have permissions to create databases and manage data for your Odoo instance. Execute the following command:

sudo -u postgres createuser --createdb --username postgres --pwprompt odoo_user

You will be prompted to enter a password for the new user. Make sure to choose a strong password as this user will have significant access rights within your database.

Step 5: Create an Odoo System User

Create a dedicated system user that will run the Odoo service. This approach enhances security by isolating Odoo from other processes on your server. Use the following command:

sudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo

This command creates a new user named “odoo” with its home directory at /opt/odoo. The `-r` flag indicates that this is a system account.

Step 6: Download Odoo Source Code

You can now download the latest version of Odoo from its official GitHub repository. Switch to the newly created Odoo user and clone the repository using these commands:

sudo su - odoo
git clone https://www.github.com/odoo/odoo --depth 1 --branch  /opt/odoo/odoo

Please replace “ with the actual version number you wish to install (e.g., `16.0`). This command fetches the source code necessary for running Odoo.

Step 7: Set Up Python Virtual Environment

A virtual environment helps manage dependencies specific to your project without affecting system-wide packages. To create and activate a virtual environment for Odoo, execute the following commands:

cd /opt/odoo
python3 -m venv odoo_venv
source odoo_venv/bin/activate

This creates a virtual environment named `odoo_venv` in your Odoo directory and activates it so that subsequent Python package installations occur within this isolated environment.

Step 8: Install Python Dependencies

The next step is installing all necessary Python packages required by Odoo. Navigate to the Odoo directory (if not already there) and run:

pip install -r /opt/odoo/odoo/requirements.txt

This command installs all dependencies listed in `requirements.txt`, ensuring that your installation has everything it needs to function correctly.

Step 9: Configure Odoo

A configuration file is essential for setting parameters such as database connection details and server settings. Create an Odoo configuration file using a text editor like nano:

sudo nano /etc/odoo.conf

Add the following configuration details into this file:

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

Please replace `YOUR_ADMIN_PASSWORD` and `YOUR_DATABASE_PASSWORD` with secure passwords of your choice. Save and exit by pressing Ctrl + X, then Y, followed by Enter.

Step 10: Set Up Nginx as a Reverse Proxy

Nginx can be used as a reverse proxy server for better performance and security when serving web applications like Odoo. Install Nginx with this command:

sudo dnf install nginx -y

Create an Nginx configuration file for your Odoo instance by executing:

sudo nano /etc/nginx/conf.d/odoo.conf

Add the following configuration into this file:


server {
    listen 80;
    server_name YOUR_DOMAIN_OR_IP;

    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

    location / {
        proxy_pass http://127.0.0.1:8069;
        proxy_redirect off;
        proxy_buffering off;
        proxy_cache off;
        proxy_read_timeout 720s;
        proxy_send_timeout 720s;
    }
}

Please replace `YOUR_DOMAIN_OR_IP` with your actual domain name or IP address. Save and exit as before.

Step 11: Configure Firewall Settings

If you have a firewall enabled on your AlmaLinux server, you need to allow HTTP (port 80) traffic through it. Execute these commands:

sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --add-service=https --permanent
sudo firewall-cmd --reload

This configuration ensures that users can access your Odoo instance via web browsers securely.

Step 12: Start Odoo Service

The final step is starting the Odoo service and enabling it to run at boot time. Use these commands:

sudo systemctl start odoo.service
sudo systemctl enable odoo.service

This starts your Odoo application immediately while ensuring it launches automatically whenever your server reboots.

Accessing Your Odoo Instance

You can now access your newly installed Odoo instance through any web browser. Simply navigate to http://YOUR_DOMAIN_OR_IP in your browser’s address bar. You should see the initial setup screen where you can configure your database settings.

Install Odoo on AlmaLinux 9

Congratulations! You have successfully installed Odoo. Thanks for using this tutorial for installing the Odoo business management software on your AlmaLinux 9 system. For additional help or useful information, we recommend you check the official Odoo website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button