Odoo (formerly known as OpenERP) is a suite of open-source business applications. It is widely regarded as a leading open-source enterprise resource planning (ERP) software. The most used modules for Odoo include Point of Sale (POS), Inventory, CRM, Website, Live Chat, e-Commerce, Billing, Accounting, Warehouse, etc. The range of the modules that can be installed in one application make Odoo so popular these days, they significantly contribute to its widespread adoption. This tutorial will show you how to install Odoo 17 on Almalinux 10 with nginx as a reverse proxy.
Prerequisites
- An AlmaLinux 10 VPS with at least 2GB of RAM.
- SSH root access, or a user with sudo privileges.
Conventions
# – given commands should be executed with root privileges either directly as a root user or by use of sudo command
$ – given commands should be executed as a regular user
Step 1. Install Dependencies
Let’s install the dependencies first before proceeding to the next steps.
$ sudo dnf install bzip2-devel freetype gcc git libjpeg-devel libxslt-devel openldap-devel python3 python3-devel redhat-rpm-config xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 -y
Step 2. Add System User
We will install the Odoo 17 instance under a system user account, not under root, so we need to create a new system account.
$ sudo useradd -md /opt/odoo17 -Urs /bin/bash odoo17
Step 3. Install PostgreSQL
$ sudo dnf install postgresql-server postgresql-devel postgresql-server-devel
Then, we need to initialize the database by executing this command:
$ sudo /usr/bin/postgresql-setup initdb
Without initializing the database, the PostgreSQL server would not start.
Now, we can start it and enable it on boot.
$ sudo systemctl enable --now postgresql
After the installation is finished, we can add a new PostgreSQL user for our Odoo 17, run this command:
$ sudo su - postgres -c "createuser -s odoo17"
Step 4. Install wkhtmltopdf
At the moment, the package for Almalinux 10 is not available. But, we can use the package for AlmaLinux 9. You can go to their page and check the link.
Next, let’s download the package using the download link above.
$ wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox-0.12.6.1-2.almalinux9.x86_64.rpm -O wkhtmltox.rpm
Once downloaded, we can install it by running this command:
$ sudo rpm -Uvh wkhtmltox.rpm
That’s it, it should be installed now. We can check the version.
wkhtmltopdf --version
wkhtmltopdf 0.12.6.1 (with patched qt)
Step 5. Install Odoo
In the previous step, we created a new system user called odoo17. We will use this user to install Odoo 17.
$ su - odoo17
Now, it’s time to download Odoo 17 from Github.
$ git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 odoo17
Execute the following command to create a new Python virtual environment.
$ python3 -m venv odoo17-venv
The virtual environment is now installed, it is time to activate it by running this command.
$ source odoo17-venv/bin/activate
Once executed, your shell prompt would look like this:
(odoo17-venv) [odoo17@rh ~]$
Next, let’s install Odoo
(odoo17-venv) [odoo17@rh ~]$ pip3 install wheel
(odoo17-venv) [odoo17@rh ~]$ pip3 install -r odoo17/requirements.txt
Once the Odoo 17 installation is completed, we can create a new directory to store our custom Odoo addons.
(odoo17-venv) [odoo17@rh ~]$ deactivate
[odoo17@rh ~]$ mkdir /opt/odoo17/odoo17/custom-addons
(odoo17-venv) [odoo17@rh ~]$ exit
Step 6. Create Odoo Systemd Unit file
In this step, we will create a systemd unit file, it is required to start/stop/restart Odoo.
$ sudo nano /etc/systemd/system/odoo17.service
Paste the following content into the systemd unit file above.
[Unit]
Description=Odoo17
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo17
PermissionsStartOnly=true
User=odoo17
Group=odoo17
ExecStart=/opt/odoo17/odoo17-venv/bin/python3 /opt/odoo17/odoo17/odoo-bin -c /etc/odoo17.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
Save the file, then exit from the file editor.
Now, let’s create the Odoo 17 configuration file.
$ sudo nano /etc/odoo17.conf
Paste the following contents into the file.
[options]
admin_passwd = m0d1fyth15
db_host = False
db_port = False
db_user = odoo17
db_password = False
addons_path = /opt/odoo17/odoo17/addons,/opt/odoo17/odoo17/custom-addons
http_port = 8069
Remember to replace the password ‘m0d1fyth15’ with a stronger password. Save it, then exit.
That’s it. We can now reload systemd and run Odoo.
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now odoo17
Check if Odoo is starting by running this command:
$ sudo systemctl status odoo17
Open your web browser and navigate to http://YOUR_SERVER_IP_ADDRESS:8069, and you will see the Odoo page.
Step 7. Install and Configure Reverse Proxy
At this point, you should be able to access your Odoo 17 installation at http://YOUR_SERVER_IP_ADDRESS:8069. To access it using your domain/subdomain, we can install a web server and configure it as a reverse proxy.
$ sudo dnf install nginx
Upon installation, nginx will not start automatically. Let’s run the command below to enable nginx and run it on boot.
$ sudo systemctl enable --now nginx
Nginx should be up and running now. Let’s proceed to the next step and create an nginx server block.
$ sudo nano /etc/nginx/conf.d/odoo.conf
Insert the following into that file.
upstream odoo17 {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
server {
listen 80;
server_name yourdomain.com;
access_log /var/log/nginx/odoo17.access.log;
error_log /var/log/nginx/odoo17.error.log;
proxy_buffers 16 64k;
proxy_buffer_size 128k;
location / {
proxy_pass http://odoo17;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
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 https;
}
location /longpolling {
proxy_pass http://odoochat;
}
location ~* /web/static/ {
proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo17;
}
}
Please replace yourdomain.com with your domain name or subdomain name pointing to your server IP address. Then, save the file and exit the file editor.
To apply the changes, we need to restart nginx.
$ sudo systemctl restart nginx
That’s it. You should now be able to access Odoo 17 at http://yourdomain.com.
Congratulations! You have followed this article and successfully installed Odoo 17 on your AlmaLinux 10 server.
Of course, you don’t have to install Odoo 17 on AlmaLinux 10 if you have an active service with us. In that case, you can simply ask our expert Linux admins to install Odoo 17 on AlmaLinux 10 for you. Our expert administrators are available 24×7 and will take care of your request immediately. Simply log in to the client area and submit a ticket. Your Odoo 17 install should be up and running in no time.
If you liked this post on how to install Odoo 17 on AlmaLinux 10, please share it with your friends or leave a comment below.