How to Install Odoo ERP Software (formerly OpenERP) on Debian 11
Odoo (formerly OpenERP) is an open-source and powerful business management software. Odoo works as a central application that allows you to manage business-related tasks from one single web application dashboard. Odoo provides two versions, the Enterprise (paid and services version) and the Community version, which is licensed under the GNU LGPLv3.
As an ERP application, Odoo provides powerful business tools such as inventory management, project management, CRM, e-commerce, billing, reporting, accounting, warehouse management, etc. It's suitable for all different sizes of companies, from small companies to medium, or large sizes of companies.
In this tutorial, you will learn how to install Odoo 14 on the Debian 11 Bullseye. You will be installing the latest stable version of Odoo 14 with the PostgreSQL database and Nginx as a reverse proxy.
Prerequisites
* An Debian 11 Bullseye system.
* A user with root or sudo privileges for installing new packages and making changes system-wide.
Installing and Configuring PostgreSQL
First, you will be installing and configure the PostgreSQL database server on the Debian system. And for this guide, you will be installing PostgreSQL packages from the official Debian repository.
1. Execute the apt command below to install PostgreSQL on the Debian 11 Bullseye.
apt install postgresql
Type 'y' and press 'Enter' to confirm the installation.
Wait for all package installations to be complete.
2. Next, change the working directory to '/etc/postgresql/13/main' and edit the configuration 'postgresql.conf' using nano.
cd /etc/postgresql/13/main/
nano postgresql.conf
Uncomment the option 'password_encryption' and change the value to 'scram-sha-256' as below.
password_encryption = scram-sha-256
Press the 'Ctrl+x', type 'y', then press 'Enter' to save and exit.
After that, edit the configuration 'pg_hba.conf' using nano editor.
nano pg_hba.conf
Change the connection method for local connections to 'scram-sha-256' as below.
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 scram-sha-256
# IPv6 local connections:
host all all ::1/128 scram-sha-256
Press the 'Ctrl+x' button again, type 'y', then press 'Enter' to save configuration and exit.
3. Now run the following command to restart the PostgreSQL service and apply the new configuration.
systemctl restart postgresql
After that, check the PostgreSQL service using the following command.
systemctl is-enabled postgresql
systemctl status postgresql
You will see the PostgreSQL service is 'enabled' and will run automatically at the system boot. And the current status of the PostgreSQL service is 'active(exited)', which means the PostgreSQL is running, but the systemd-manager cannot find the service to monitor.
Installing wkhtmltopdf Tool
The wkhtmltopdf is a command-line tool that for rendering HTML pages to PDF format using Qt Webkit engine. The main advantage of using the wkhtmltopdf tool is all rendering processes will run 'headless' and do not require any display service.
For this step, you will be installing wkhtmltopdf package '0.12.16', which is originally for Debian Buster, but it's also working fine on the latest Debian 11 Bullseye.
1. Download the wkhtmltopdf package using the following command.
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb
2. If the download process is complete, install the wkhtmltopdf package using the dpkg command as below.
dpkg -i wkhtmltox_0.12.6-1.buster_amd64.deb
You will see an error about missing dependencies. Fix the error by executing the apt command below.
apt install -f
Type 'y' and press 'Enter' to continue the installation.
3. And if all installation is complete, verify the wkhtmltopdf by executing the following command.
wkhtmltopdf -V
wkhtmltopdf -h
If your installation is successful, you will see the wkhtmltopdf version number and help messages as below.
And you're ready for Odoo installation.
Installing Odoo 14 on Debian 11 Bullseye
For this guide, you will be installing Odoo version 14 from the official Odoo repository. SO, you will be adding a new odoo repository for Debian, then you will be installing and configuring odoo.
1. At first, you may need to add the 'gnupg2' package to your Debian system using the apt command below.
apt install gnupg2
Type 'y' and press 'Enter' to continue the installation.
2. Next, execute the following command to add the Odoo GPG key and repository.
wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
echo "deb http://nightly.odoo.com/14.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/odoo.list
Now update or refresh the repository using the command below.
apt update
And you're ready to install Odoo 14.
3. Execute the apt command below to install Odoo on the Debian 11 Bullseye.
apt install odoo -y
Now wait for Odoo and all package dependencies installation, it will take some time, depending on your internet connection.
4. When the odoo installation is complete, change the working directory to '/etc/odoo' and edit the configuration 'odoo.conf' using the nano command.
cd /etc/odoo/
nano odoo.conf
Copy and paste the following configuration.
admin_passwd = password_for_database_screen_operations
proxy_mode = True
Save the configuration by pressing the 'Ctrl+x' button, type 'y', and press 'Enter' to confirm and exit.
Options you must know:
- admin_passwd - this option will be set as the master password for the first time setting up Odoo, especially for creating a new PostgreSQL database for Odoo.
- proxy_mode - run odoo in the proxy mode. If you want to put a reverse proxy application such as Nginx or Apache for odoo, then you must run odoo with the 'proxy_mode = True' option.
5. Now restart the Odoo service to apply a new configuration using the systemctl command below.
systemctl restart odoo
If you don't have any errors, verify your Odoo installation using the following command.
systemctl is-enabled odoo
systemctl status odoo
If your Odoo installation is successful, you will get similar output to the screenshot below.
As you see on the screenshot, the Odoo service is enabled and will be automatically run at system boot. And the current status of Odoo service 'active (running)'.
Generate SSL Letsencrypt using Certbot
In this step, you will be installing the certbot tool and generating new certificates for the domain name Odoo installation.
Before generating SSL Letsencrypt, ensure that your domain name is resolved to the server IP address. And this guide assumes you're installing Odoo on the fresh Debian server.
1. First, execute the following command to install the certbot tool for generating SSL Letsencrypt.
apt install certbot
Type 'y' and press 'Enter' to install.
2. Now generate the SSL Letsencrypt using the following cerbot command. And make sure to change the domain name and email address before executing the command.
sudo certbot certonly --standalone --preferred-challenges http --agree-tos --email [email protected] --no-eff-email -d odoo.example.net
The will generate SSL Letnsecrypt using the standalone mode, which means the standalone and temporary webserver will be created for the verification. And if all process is complete, you will get all your certificates at the '/etc/letsencrypt/live/YOUR-DOMAIN.NET' directory.
Installing and Configure Nginx as Reverse Proxy for Odoo
In this step, you will be installing the Nginx web server and configuring it as a reverse proxy for the Odoo service.
1. Now execute the apt command below to install Nginx packages.
apt install nginx
Type 'y' and press 'Enter' to confirm and continue the installation.
2. Next, change the working directory to '/etc/nginx/sites-available' and create a new Nginx server block configuration 'odoo' using the nano editor.
cd /etc/nginx/sites-available/
nano odoo
Copy the following configuration and make sure to change the domain name and path of the SSL certificate, then paste the configuration.
#odoo server
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
# http -> https
server {
listen 80;
server_name odoo.example.net;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443 ssl http2;
server_name odoo.example.net;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# Add Headers for odoo proxy mode
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;
# SSL parameters
ssl_certificate /etc/letsencrypt/live/odoo.example.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/odoo.example.net/privkey.pem;
ssl_session_timeout 30m;
ssl_protocols TLSv1.2;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
# log
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;
# Redirect longpoll requests to odoo longpolling port
location /longpolling {
proxy_pass http://odoochat;
}
# Redirect requests to odoo backend server
location / {
proxy_redirect off;
proxy_pass http://odoo;
}
# common gzip
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
gzip on;
}
Save the configuration by pressing the 'Ctrl+x' button and type 'y' to confirm, then press 'Enter' to exit.
3. Next, execute the following command to activate the new nginx server block, then verify nginx configuration.
ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/
nginx -t
If your configuration is correct, you will see the message 'syntax is ok - test is successful' in the screenshot below.
Otherwise, you will see an error message following the configuration and the line number which causing the error.
4. Next, restart the Nginx service using the following to apply a new configuration.
systemctl restart nginx
After that, verify the Nginx service status using the command below.
systemctl is-enabled nginx
systemctl status nginx
Now you will see a similar screenshot below. The Nginx service is 'enabled', and the current status of the Nginx service is 'active (running)'.
Odoo First Time Configuration
At this stage, you're ready to access your Odoo installation and start adding applications for your business.
1. Open your web browser and type your Odoo domain installation URL.
https://odoo.example.net/
If your installation is correct, you will see the page for setting up odoo for the first time.
Below are some configurations you must know.
- Master Password: type the password that you are using for the option 'admin_passwd' on the odoo configuration '/etc/odoo/odoo.conf'.
- Database Name: odoo will be creating a new database automatically, so type any database name you want.
- Email: type your email address for logging in to odoo. This will become an administrator user for odoo.
- Password: type your password new administrator user.
- Phone number - Language - Country: Type your details.
- Demo data: this is optional, if you just want to test, you can load sample data. If you want to install it for production, leave it unchecked.
Now click the button 'Create database' to finish the installation.
2. If your odoo installation is successful, you will see a similar odoo dashboard application as below.
3. To install applications from the Odoo dashboard, click the 'Install' button on the application name.
Below are some critical Odoo applications for your business.
Odoo 'Project' - kanban-like project management for odoo.
'Calendar' - powerful calendar for odoo. Appointment for any for your meetings and agenda.
Odoo 'CRM' (Customer Relation Management) suite.
Simple 'Notes' for odoo. Save your idea and notes in one place.
POS (Point Of Sales) on odoo.
Conclusion
Congratulations! You've successfully installed the latest LTS version Odoo 14 on the Debian 11 Bullseye. Your Odoo installation is up and running with PostgreSQL as the database system and Nginx as a reverse proxy in front of Odoo. And most importantly, your odoo installation is secured with SSL Letsencrypt.
For the next step, you're ready to implement Odoo for your business. Also, you may check some additional configurations to optimize your Odoo installation from the official odoo website.