How to Install Odoo on AlmaLinux 8

How to Install Odoo on AlmaLinux 8

Odoo is a group of open-source business apps that offers a wide range of applications including, CRM, accounting, billing, inventory, warehouse, e-commerce, project management and more. It is simple, customizable, fully integrated and helps you to manage your business and be more efficient wherever you are. It is written in Python and uses PostgreSQL as a database backend.

In this post, we will show you how to install Odoo 14 on AlmaLinux 8 VPS.

Prerequisites

  • An AlmaLinux 8 VPS
  • Access to the root user account (or access to an admin account with root privileges)

Log in to the Server & Update the Server OS Packages

First, log in to your AlmaLinux 8 server via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.

Before starting, you have to make sure that all AlmaLinux OS packages installed on the server are up to date. You can do this by running the following commands:

dnf update -y

Install Required Dependencies

First, you will need to install Python and other required dependencies on your server. You can install all of them with the following command:

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

Next, install wkhtmltopdf package with the following command:

dnf install https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos8.x86_64.rpm

Once all the packages are installed, you can proceed to the next step.

Install PostgreSQL

Next, you will need to install the PostgreSQL package on your server. You can install it with the following command:

dnf install @postgresql:12 -y

Once installed, initialized to PostgreSQL database with the following command:

/usr/bin/postgresql-setup initdb

Next, start the PostgreSQL service and enable them to start at system reboot:

systemctl start postgresql
systemctl enable postgresql

Next, create a new PostgreSQL user for Odoo with the following command:

su - postgres -c "createuser -s odoo"

Install and Configure Odoo

First, create a dedicated user for Odoo with the following command:

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

Next, log in with the Odoo user and download the Odoo 14 with the following command:

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

Next, change the directory to /opt/odoo and create a new Python virtual environment:

python3 -m venv odoo14-venv

Next, activate the virtual environment with the following command:

source odoo14-venv/bin/activate

Next, install the required dependencies with the following command:

pip3 install -r odoo14/requirements.txt

Next, deactivate from the virtual environment and exit from the Odoo user with the following command:

deactivate
exit

Next, create addons and log directory with the following command:

mkdir /opt/odoo/odoo14-custom-addons
mkdir /var/log/odoo14 && touch /var/log/odoo14/odoo.log

Next, set proper ownership with the following command:

chown odoo: /opt/odoo/odoo14-custom-addons
chown -R odoo: /var/log/odoo14/

Next, create an Odoo configuration file with the following command:

nano /etc/odoo.conf

Add the following lines:

[options]
admin_passwd = odoo_master_password
db_host = False
db_port = False
db_user = odoo
db_password = False
xmlrpc_port = 8069
logfile = /var/log/odoo14/odoo.log
logrotate = True
addons_path = /opt/odoo/odoo14/addons,/opt/odoo/odoo14-custom-addons

Save and close the file when you are finished.

Create a Systemd Service File for Odoo

Next, you will need to create a systemd service file for Odoo with the following command:

nano /etc/systemd/system/odoo.service

Add the following lines:

[Unit]
Description=Odoo14
#Requires=postgresql-10.6.service
#After=network.target postgresql-10.6.service

[Service]
Type=simple
SyslogIdentifier=odoo14
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo14-venv/bin/python3 /opt/odoo/odoo14/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

Save and close the file then reload the systemd daemon to apply the changes:

systemctl daemon-reload

Next, start the Odoo service and enable it to start at system reboot:

systemctl start odoo
systemctl enable odoo

You can now check the status of the Odoo service with the following command:

systemctl status odoo

You should get the following output:

● odoo.service - Odoo14
   Loaded: loaded (/etc/systemd/system/odoo.service; disabled; vendor preset: disabled)
   Active: active (running) since Sun 2021-06-06 09:41:58 EDT; 4s ago
 Main PID: 23729 (python3)
    Tasks: 4 (limit: 25014)
   Memory: 55.6M
   CGroup: /system.slice/odoo.service
           └─23729 /opt/odoo/odoo14-venv/bin/python3 /opt/odoo/odoo14/odoo-bin -c /etc/odoo.conf

Jun 06 09:41:58 AlmaLinux systemd[1]: Started Odoo14.

At this point, Odoo is started and listening on port 8069. You can check it with the following command:

ss -antpl | grep 8069

You should get the following output:

LISTEN    0         128                0.0.0.0:8069             0.0.0.0:*        users:(("python3",pid=23729,fd=4))    

Configure Firewall

Next, you will need to allow port 8069 through the firewall. You can allow it with the following command:

firewall-cmd --permanent --zone=public --add-port=8069

Next, reload the firewall to apply the changes:

firewall-cmd --reload

Access Odoo Web UI

Now, open your web browser and access the Odoo web UI using the URL http://your-server-ip:8069. You should see the following page:

Provide your Odoo master password, database, admin username, password, email and click on the Create Database button. You should see the Odoo dashboard on the following page:

 

Congratulations! You have successfully installed Odoo on AlmaLinux 8.

Of course, you don’t have to install Odoo if you use one of our Managed Hosting services, in which case you can simply ask our expert Linux admins to install Odoo on AlmaLinux 8, for you. They are available 24×7 and will take care of your request immediately. Also, check out our Odoo dedicated servers.

PS. If you liked this post on how to install Odoo on AlmaLinux 8, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Leave a Comment