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.