Tag Archives: Odoo

Odoo Nginx Reverse Proxy

How to Configure Odoo with Nginx as Reverse Proxy on Debian 13

If you are planning to deploy Odoo in a production environment, configuring it behind a reverse proxy like Nginx is highly recommended. Odoo’s built-in server is sufficient for development but not optimized for handling SSL encryption, load balancing, URL routing, and performance tuning. Nginx acts as a powerful reverse proxy that enhances reliability, security, and performance, making your Odoo installation production-ready.

In this tutorial, you will learn step-by-step how to configure Odoo with Nginx as a reverse proxy on Debian 13, including SSL setup.

Step 1: Update Operating System

Update your Debian 13 operating system to the latest version with the following command:

# apt update && apt upgrade

Step 2: Install Nginx Web Server

To install Nginx web server, run the following command:

Cloud server hosting
# apt install nginx

You can start the Nginx service and configure it to run on startup by entering the following commands:

# systemctl start nginx
# systemctl enable nginx

Verify the status of the Nginx service using systemctl status command:

# systemctl status nginx

Step 3: Configure Odoo for Reverse Proxy

Make sure that Odoo is configured to work behind a proxy. In the Odoo configuration file (/etc/odoo.conf), you need to set the proxy_mode parameter to True:

proxy_mode = True

After making the changes, it’s important to restart the Odoo service to ensure the changes take effect:

# systemctl restart odoo

Step 4: Configure Nginx for Odoo

Now we set up the Nginx configuration to route traffic to Odoo.

Create a new configuration file:

# /etc/nginx/conf.d/odoo.conf

Paste the following configuration (replace erp.example.com with your real domain):

upstream odoo {
server 127.0.0.1:8069;
}

upstream odoo-chat {
server 127.0.0.1:8072;
}

server {
listen 80;
server_name erp.example.com;

access_log /var/log/nginx/odoo_access.log;
error_log /var/log/nginx/odoo_error.log;

proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;

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

location / {
proxy_pass http://odoo;
}

location /websocket {
proxy_pass http://odoo-chat;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

Save the file and Exit.

Check Nginx syntax:

# /usr/sbin/nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

To implement the changes, restart Nginx webserver:

# systemctl restart nginx

You can now open your Odoo at:

http://erp.your-domain.com

However, this is still not secure because we are using HTTP.

Step 5: Install free Let’s Encrypt SSL certificate (Optional)

First you need to install the Certbot client which is used to create Let’s Encrypt certificates:

# apt install certbot python3-certbot-nginx

Then to get the SSL certificate using the Certbot, type the following command:

# certbot --nginx -d erp.your-domain.com

If the SSL certificate is successfully obtained, certbot displays a message to show the configuration was successful:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for erp.your-domain.com

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/erp.your-domain.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/erp.your-domain.com/privkey.pem
This certificate expires on 2026-02-16.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for erp.your-domain.com to /etc/nginx/conf.d/odoo.conf
Congratulations! You have successfully enabled HTTPS on https://erp.your-domain.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Now, you have successfully installed SSL on your website.

Step 6: Access Odoo server

Open your web browser and type the URL https://erp.your-domain.com.

You should now see your Odoo login page loading securely via Nginx.

Comments and Conclusion

Configuring Nginx as a reverse proxy for Odoo enhances security, performance, and scalability.

It allows you to run Odoo in a professional production environment with HTTPS, HTTP/2, caching, and better resource usage.

If you have any questions please leave a comment below.

 

How to Install Odoo 18 on Ubuntu 24.04

Odoo 18 is an open-source suite of business applications that provides a complete ERP (Enterprise Resource Planning) solution for organizations of various sizes. It offers a wide range of integrated tools and modules to help manage all aspects of a business, such as finance, sales, inventory, human resources, and more.

The open-source community edition is free, making it accessible to small businesses and developers. The enterprise edition, on the other hand, offers additional features, services, and support.

Odoo is highly customizable. Businesses can tailor modules to meet their specific needs, create custom workflows, or build entirely new apps using Odoo’s development framework.

In summary, Odoo is a versatile business management software that can streamline operations and provide real-time insights, making it an ideal solution for companies looking to optimize their business processes.

In this tutorial, we will show you how to install Odoo 18 on a Ubuntu 24.04 OS.

Step 1: Update Operating System

Update your Ubuntu 24.04 operating system to make sure all existing packages are up to date:

# apt update && apt upgrade

Then install all the required packages for the Odoo 18 setup on the Ubuntu 24.04 OS.

# apt install python3-minimal python3-dev python3-pip python3-venv python3-setuptools build-essential libzip-dev libxslt1-dev libldap2-dev python3-wheel libsasl2-dev node-less libjpeg-dev xfonts-utils libpq-dev libffi-dev fontconfig git wget

Step 2: Install PostgreSQL

Odoo uses PostgreSQL as a database backend, so you will need to install PostgreSQL on your server.

Follow these steps to install and configure PostgreSQL server:

# apt-get install postgresql

After the successful installation, start the PostgreSQL service and enable it to start after the system reboot:

# systemctl start postgresql
# systemctl enable postgresql

Verify that is active and running on your server:

# systemctl status postgresql
Output
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: enabled)
     Active: active (exited)
   Main PID: 19754 (code=exited, status=0/SUCCESS)
        CPU: 2ms

Now create an Odoo user in PostgreSQL:

# su - postgres -c "createuser -s odoo" 

This will add a new role odoo in the PostgreSQL server.

Step 3: Install Node.js

To install Node.js and npm on your Ubuntu 24.04 OS use the following command:

# apt install nodejs npm

Also, install the following module to enable RTL support:

# npm install -g rtlcss

Step 4: Installation of wkhtmltopdf

To generate PDF reports successfully, wkhtmltopdf is necessary. PDF reports are a crucial component of any organization.

First install the xfonts dependency before installing wkhtmltopdf:

# apt-get install xfonts-75dpi xfonts-base

Now download and install wkhtmltopdf using the following commands:

# wget  http://security.ubuntu.com/ubuntu/pool/universe/w/wkhtmltopdf/wkhtmltopdf_0.12.6-2build2_amd64.deb
# dpkg -i wkhtmltopdf_0.12.6-2build2_amd64.deb

Verify if the wkhtmltopdf installation is successful by checking the version:

# wkhtmltopdf --version
wkhtmltopdf 0.12.6

Step 5: Create an Odoo User

Create a new system user for managing the Odoo processes on the Odoo server.

# adduser --system --group --home=/opt/odoo --shell=/bin/bash odoo

Step 6: Install Odoo 18

Switch to the user that you have created before to avoid encountering issues related to access rights.

# su - odoo

Now, download the Odoo 17 source code from the git repository and install it:

# git clone https://www.github.com/odoo/odoo --depth 1 --branch 18.0 /opt/odoo/odoo

Next run the following command to generate a new Python virtual environment.

# python3 -m venv odoo-env

Activate the virtual environment with the following command:

# source odoo-env/bin/activate

Then install the required Python packages:

(odoo-env) $ pip3 install wheel
(odoo-env) $ pip3 install -r odoo/requirements.txt

After completing the process of installing all requirements to deactivate the virtual environment run the following command:

(odoo-env) $ deactivate

Execute the following command to create a directory for custom addons:

# mkdir /opt/odoo/custom-addons

Next exit from the Odoo user:

# exit

Create an Odoo log directory and provide it the required write permissions.

# mkdir /var/log/odoo18
# chown odoo:odoo /var/log/odoo18

Step 7: Create Odoo Configuration File

Create the Odoo configuration file.

# nano /etc/odoo.conf

Then paste the following configuration into it.

[options]
admin_passwd = Strong_admin_Password
db_host = False
db_port = False
db_user = odoo
db_password = False
logfile = /var/log/odoo18/odoo-server.log
addons_path = /opt/odoo/odoo/addons,/opt/odoo/custom-addons
xmlrpc_port = 8069

Remember to update the value of the “Strong_admin_Password” key above with a more secure password.

Step 8: Create a Systemd Service File

Create a systemd service file to manage the Odoo service:

# nano /etc/systemd/system/odoo.service

Paste the following content into the odoo.service file:

[Unit]
Description=Odoo
Requires=postgresql.service
After=network.target postgresql.service

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

[Install]
WantedBy=multi-user.target

Reload system daemon and start the service:

# systemctl daemon-reload
# systemctl start odoo
# systemctl enable odoo

To confirm everything is working normally, check the status of service:

# systemctl status odoo

Output:

● odoo.service - Odoo
     Loaded: loaded (/etc/systemd/system/odoo.service; enabled; preset: enabled)
     Active: active (running)
   Main PID: 21764 (python3)
      Tasks: 4 (limit: 2218)
     Memory: 73.3M (peak: 73.5M)
        CPU: 973ms
     CGroup: /system.slice/odoo.service
             └─21764 /opt/odoo/odoo-env/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf

Step 9: Access Odoo 18 server

Open your web browser and type http://your-IP-address:8069 and you will see the following screen:

Comments and Conclusion

That’s it. You have successfully installed Community version of Odoo 18 on Ubuntu 24.04.

For additional help or useful information, we recommend you to check  the official Odoo 18 documentation.

If you have any questions please leave a comment below.

How to Configure Odoo with Apache as Reverse Proxy on Debian 12

Odoo is an open-source suite of integrated business applications that includes various modules for different business needs. Odoo is developed using the Python programming language and follows a modular architecture, allowing users to select and deploy the specific modules that suit their business requirements.

The system is highly customizable, and it covers a wide range of business functions. It provides a comprehensive set of tools to manage various aspects of a business, from sales and finance to human resources and inventory management.

In this tutorial, we will show you how to configure Odoo with Apache 2 as Reverse Proxy on Debian 12 OS.

If you do not have Odoo installed on your server you can follow our tutorial how to install Odoo 17 on Debian 12.

Step 1: Update Operating System

Update your Debian 12 operating system to the latest version with the following command:

# apt update && apt upgrade

Step 2: Install Apache webserver

You can install it via apt package manager by executing the following command.

# apt install apache2

You can verify the status of the Apache service using the systemctl status command:

# systemctl status apache2

Output:

● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; preset: enabled)
     Active: active (running)
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 1127 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 1131 (apache2)
      Tasks: 6 (limit: 2273)
     Memory: 18.4M
        CPU: 86ms
     CGroup: /system.slice/apache2.service
             ├─1131 /usr/sbin/apache2 -k start
             ├─1132 /usr/sbin/apache2 -k start
             ├─1133 /usr/sbin/apache2 -k start

Step 3: Enable Apache Modules

Next run the following commands to enable all necessary modules:

# /usr/sbin/a2enmod rewrite
# /usr/sbin/a2enmod proxy
# /usr/sbin/a2enmod proxy_http
# /usr/sbin/a2enmod proxy_html
# /usr/sbin/a2enmod headers

Then restart the Apache web server:

# systemctl restart apache2

Step 4: Configure Apache for Odoo

Run the commands below to create a new VirtualHost file called odoo in the /etc/apache2/sites-available/ directory.

# nano /etc/apache2/sites-available/odoo.conf

Paste the content as shown below:

 <VirtualHost *:80>
    ServerAdmin admin@your-domain.com
    DocumentRoot /var/www/html/
    
    ServerName your-domain.com
    ServerAlias www.your-domain.com

    ProxyPass / http://127.0.0.1:8069/
    ProxyPassReverse / http://127.0.0.1:8069/> 

    ErrorLog /var/log/apache2/your-domain.com-error_log
    CustomLog /var/log/apache2/your-domain.com-access_log common

 </VirtualHost>

Remember to replace your-domain.com with the domain name of your server.

Then save and exit the configuration file.

To enable this site run the following command:

# ln -s /etc/apache2/sites-available/odoo.conf /etc/apache2/sites-enabled/odoo.conf

To implement the changes, you need to restart the Apache webserver:

# systemctl restart apache2

Step 5: Install free Let’s Encrypt SSL certificate (Optional)

First you need to install the Certbot client which is used to create Let’s Encrypt certificates:

# apt install certbot python3-certbot-apache

Then to get the SSL certificate using the Certbot, type the following command:

# certbot --apache -d your-domain.com -d www.your-domain.com

If the SSL certificate is successfully obtained, certbot displays a message to show the configuration was successful:

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/your-domain.com.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/your-domain.com/privkey.pem
   Your cert will expire on 2024-03-02. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

Now, you have successfully installed SSL on your website.

Step 6:  Odoo Proxy Configuration

Make sure that Odoo is configured to work behind a proxy. In the Odoo configuration file (/etc/odoo.conf), you need to set the proxy_mode parameter to True:

proxy_mode = True

After making the changes, it’s important to restart the Odoo service to ensure the changes take effect:

# systemctl restart odoo

Step 7: Access Odoo server

Open your web browser and type the URL https://your-domain.com. You should see the following page:

Comments and Conclusion

Congratulations! You have successfully configured Odoo with Apache 2 as Reverse Proxy on your Debian 12 OS.

For additional information, you can check the official Odoo documentation.

If you have any questions please leave a comment below.

How to Install Odoo 17 on Debian 12

Odoo is an open-source suite of business management software applications that encompasses a wide range of business needs, including customer relationship management (CRM), sales, project management, inventory management, manufacturing, financial management, and more.

It is widely used by businesses of various sizes and across different industries to streamline their operations, improve productivity, and manage their business processes more efficiently. Its flexibility, scalability, and cost-effectiveness make it a popular choice for organizations seeking comprehensive business management solutions.

In this tutorial, we will show you how to install Odoo 17 on Debian 12 OS.

Step 1: Update Operating System

Update your Debian 12 operating system to make sure all existing packages are up to date:

# apt update && apt upgrade

Then install all the required packages for the Odoo 17 setup on the Debian 12 OS.

# apt install python3 python3-dev python3-pip python3-venv python3-setuptools build-essential libzip-dev libxslt1-dev libldap2-dev python3-wheel libsasl2-dev node-less libjpeg-dev xfonts-75dpi xfonts-base libpq-dev libffi-dev fontconfig git wget nodejs npm

Step 2: Install PostgreSQL

Odoo uses PostgreSQL as a database backend, so you will need to install PostgreSQL on your server.

You can run the following command to install the PostgreSQL server:

# apt-get install postgresql-15

After the successful installation, start the PostgreSQL service and enable it to start after the system reboot:

# systemctl start postgresql
# systemctl enable postgresql

Verify that is active and running on your server:

# systemctl status postgresql
Output
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; preset: enabled)
     Active: active (exited)
   Main PID: 18666 (code=exited, status=0/SUCCESS)
        CPU: 2ms

Now create an Odoo user in PostgreSQL:

# su - postgres -c "createuser -s odoo" 

This will add a new role odoo in the PostgreSQL server.

Step 3: Install Node.js

To install Node.js and npm on your Debian OS use the following command:

# apt install nodejs npm

Also, install the following module to enable RTL support:

# npm install -g rtlcss

Step 4: Installation of wkhtmltox

To generate PDF reports successfully, wkhtmltopdf is necessary. PDF reports are a crucial component of any organization.

First install the xfonts dependency before installing wkhtmltopdf:

# apt-get install xfonts-75dpi xfonts-base

Now download and install wkhtmltopdf using the following commands:

# wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb
# dpkg -i wkhtmltox_0.12.6.1-3.bookworm_amd64.deb

Verify if the wkhtmltopdf installation is successful by checking the version:

# wkhtmltopdf --version
wkhtmltopdf 0.12.6.1 (with patched qt)

Step 5: Create an Odoo User

Create a new system user for managing the Odoo processes on the Odoo server.

# adduser --system --group --home=/opt/odoo --shell=/bin/bash odoo

Step 6: Install Odoo

Switch to the user that you have created before to avoid encountering issues related to access rights.

# su - odoo

Now, download the Odoo 17 source code from the git repository and install it:

# git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 /opt/odoo/odoo

Next run the following command to generate a new Python virtual environment.

# python3 -m venv odoo-env

Activate the virtual environment with the following command:

# source odoo-env/bin/activate

Then install the required Python packages:

(odoo-env) $ pip3 install wheel
(odoo-env) $ pip3 install -r odoo/requirements.txt

After completing the process of installing all requirements to deactivate the virtual environment run the following command:

(odoo-env) $ deactivate

Execute the following command to create a directory for custom addons:

# mkdir /opt/odoo/custom-addons

Next exit from the Odoo user:

# exit

Create an Odoo log directory and provide it the required write permissions.

# mkdir /var/log/odoo
# chown odoo:odoo /var/log/odoo

Step 7: Create Odoo Configuration File

Create the Odoo configuration file.

# nano /etc/odoo.conf

Then paste the following configuration into it.

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

Remember to update the value of the “Strong_admin_Password” key above with a more secure password.

Step 8: Create a Systemd Service File

Create a systemd service file to manage the Odoo service:

# nano /etc/systemd/system/odoo.service

Paste the following content into the odoo.service file:

[Unit]
Description=Odoo
Requires=postgresql.service
After=network.target postgresql.service

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

[Install]
WantedBy=multi-user.target

Reload system daemon and start the service:

# systemctl daemon-reload
# systemctl start odoo
# systemctl enable odoo

To confirm everything is working normally, check the status of service:

# systemctl status odoo

Output:

● odoo.service - Odoo
     Loaded: loaded (/etc/systemd/system/odoo.service; enabled; preset: enabled)
     Active: active (running)
   Main PID: 2270 (python3)
      Tasks: 4 (limit: 2273)
     Memory: 110.0M
        CPU: 1.622s
     CGroup: /system.slice/odoo.service
             └─2270 /opt/odoo/odoo-env/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf

Step 9: Access Odoo server

Open your web browser and type http://your-IP-address:8069 and you will see the following screen:

Fill the required information and then click the “Create Database” button to complete the installation.

After successfully creating the Odoo database, you will be redirected to the login page.

Enter your login credentials and you will be redirected to apps page:

Comments and Conclusion

That’s it. You have successfully installed Odoo 17 on Debian 12. For additional information, you can check the official Odoo 17 documentation.

If you have any questions please leave a comment below.