Odoo is an open-source and full suite of business apps including, ERP, CRM, Finance, Human resource, and more. It is available in different editions depending on what’s right for you. It can be used for a lot of different industries including, Sales, Operations, Manufacturing, Marketing, Human resource, Finance and more. The biggest strengths of Odoo is integrated scalability, user-friendly, flexible, and customizable. It is written in Python and helps you manage your business and be more efficient wherever you are.
In this post, we will show you how to install Odoo15 on Debian 11.
Prerequisites
- A Debian 11 (we’ll be using our SSD 2 VPS plan)
- Access to the root user account (or access to an admin account with root privileges)
Log in and Update the Server:
Log in to your Debian 11 VPS via SSH as user root (You can use a superuser account if the root is not available. Our VPSes come with root access included):
ssh root@IP_Address -p Port_number
Don’t forget to replace ‘IP_Address’ and ‘Port_number’ with the actual IP address of your server and the SSH service port. The default SSH port is 22.
Run the following commands to make sure that all installed packages on your Debian 11 VPS are updated to their latest available versions:
apt-get update -y && apt-get upgrade -y
Install Required Dependencies
Odoo is written in Python so you will need to install Python and other required dependencies to your server. You can install all of them using the following command:
apt-get install python3-pip python-dev python3-dev libxml2-dev libpq-dev liblcms2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential git libssl-dev libffi-dev libjpeg-dev libblas-dev libatlas-base-dev
After installing all the Python dependencies, install Node.js and other dependencies using the following command:
apt-get install npm npm install -g less less-plugin-clean-css apt-get install node-less
Next, install the wkhtmltopdf tool using the following command:
apt-get install wkhtmltopdf
Install and Configure PostgreSQL
Next, you will need to install the PostgreSQL database server package to your server. You can install it using the following command:
apt-get install postgresql -y
After the installation, log in to PostgreSQL and create an Odoo user with the following command:
su - postgres createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo15 psql ALTER USER odoo15 WITH SUPERUSER;
Next, exit from the PostgreSQL shell with the following command:
\q exit
Install and Configure Odoo15
It is recommended to run Odoo as a separate user. So create a new user for Odoo15 with the following command:
useradd -m -d /opt/odoo15 -U -r -s /bin/bash odoo15
Next, log in to Odoo15 user and download the Odoo15 by running the following command:
su - odoo15 git clone https://www.github.com/odoo/odoo --depth 1 --branch 15.0 /opt/odoo15/odoo
Next, exit from the Odoo15 user with the following command:
exit
Next, install other Odoo dependencies using the following command:
pip3 install -r /opt/odoo15/odoo/requirements.txt
Next, copy the Odoo sample configuration file to the /etc directory:
cp /opt/odoo15/odoo/debian/odoo.conf /etc/odoo.conf
Next, edit the Odoo15 configuration file:
nano /etc/odoo.conf
Change the following lines:
[options] ; This is the password that allows database operations: admin_passwd = adminpassword db_host = False db_port = False db_user = odoo15 db_password = False xmlrpc_interface = 127.0.0.1 proxy_mode = True addons_path = /opt/odoo15/odoo/addons logfile = /var/log/odoo/odoo.log
Save and close the file then set proper ownership to the Odoo configuration file:
chown odoo15: /etc/odoo.conf
Next, create a log directory for Odoo and set proper ownership:
mkdir /var/log/odoo chown odoo15:root /var/log/odoo
Create a Systemd Service File for Odoo15
Next, create a systemd service file for Odoo15 to manage the Odoo instance.
nano /etc/systemd/system/odoo15.service
Add the following lines:
[Unit] Description=Odoo Documentation=http://www.odoo.com [Service] Type=simple User=odoo15 ExecStart=/opt/odoo15/odoo/odoo-bin -c /etc/odoo.conf [Install] WantedBy=default.target
Save and close the file then reload the systemd daemon to apply the changes:
systemctl daemon-reload
Next, start the Odoo15 service and enable it to start at system reboot:
systemctl start odoo15 systemctl enable odoo15
Configure Nginx as a Reverse Proxy for Odoo15
Next, you will need to configure Nginx as a reverse proxy for Odoo15. First, install the Nginx package with the following command:
apt-get install nginx -y
Next, create an Nginx virtual host configuration file:
nano /etc/nginx/conf.d/odoo15.conf
Add the following configuration:
upstream odoo { server 127.0.0.1:8069; } upstream odoochat { server 127.0.0.1:8072; } server { listen 80; server_name odoo15.yourdomain.com; 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; # 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 and close the file then restart the Nginx service to apply the changes:
systemctl restart nginx
Access Odoo15 Instance
At this point, Odoo15 is installed and running. You can now access the Odoo15 instance using the URL http://odoo15.yourdomain.com. You should see the following screen:
Provide your Odoo15 master password, database name, and password and click on the Create database button.
We trust that our guide on installing Odoo 15 on Debian 11 has been beneficial to you.
Now, it’s your turn:
Do you believe we overlooked something, or are there any steps that have left you puzzled and in need of further explanation?
What other subjects or guides are you interested in learning about through our platform?
Please share your thoughts in the comments section below.
Thanks for this tutorial, was really helpful.