DebianDebian Based

How To Install Odoo ERP on Debian 12

Install Odoo ERP on Debian 12

In this tutorial, we will show you how to install Odoo ERP on Debian 12. Odoo is a powerful open-source ERP (Enterprise Resource Planning) software that offers a wide range of business management tools, including CRM, e-commerce, accounting, inventory management, and more. With its modular architecture and user-friendly interface, Odoo has become a popular choice for businesses of all sizes looking to streamline their operations and boost productivity. One of the great advantages of Odoo is its compatibility with various operating systems, including Debian 12.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Odoo ERP on Debian 12 (Bookworm).

Prerequisites

Before proceeding with the installation of Odoo on Debian 12, ensure you meet the following requirements:

  • A server running one of the following operating systems: Debian 12 (Bookworm).
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies.
  • A user account with sudo privileges to execute administrative commands.

Install Odoo ERP on Debian 12 Bookworm

Step 1. To begin the installation process, it’s crucial to update your Debian 12 system to ensure you have the latest packages and security patches. Open a terminal and run the following commands:

sudo apt update
sudo apt upgrade

Step 2. Installing Git.

Git is a distributed version control system that allows you to clone the Odoo repository from GitHub. To install Git on your Debian 12 system, use the following command:

sudo apt install git

Once the installation is complete, you can verify the Git version by running:

git --version

This command will display the installed Git version, confirming that it has been successfully set up on your system.

Step 3. Installing Python Dependencies.

Odoo is primarily written in Python, so you’ll need to install Python and its related dependencies. Run the following command to install the necessary packages:

sudo apt install python3 python3-pip python3-dev python3-venv python3-wheel libpq-dev libxslt-dev libzip-dev libldap2-dev libsasl2-dev

To create a clean and isolated environment for Odoo, it’s recommended to use a Python virtual environment. Create a new virtual environment by running:

python3 -m venv odoo-venv

Activate the virtual environment with the following command:

source odoo-venv/bin/activate

Your terminal prompt will now indicate that you are working within the virtual environment.

Step 4. Installing PostgreSQL.

Odoo uses PostgreSQL as its database backend. To install PostgreSQL on Debian 12, run the following command:

sudo apt install postgresql

After the installation, switch to the postgres user to create a PostgreSQL user for Odoo:

sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo

Enter a secure password when prompted. This command creates a PostgreSQL user named “odoo” with the ability to create databases but without superuser privileges.

Exit the postgres user session by typing exit and pressing Enter. You can verify the database connection by running:

psql -U odoo -h localhost -d postgres

If the connection is successful, you will enter the PostgreSQL command-line interface. Type \q and press Enter to exit.

Step 5. Installing Node.js and npm.

Odoo requires Node.js and npm for certain website features. Install them using the following command:

sudo apt install nodejs npm

Verify the Node.js and npm installation by running:

node --version
npm --version

Step 6. Installing wkhtmltopdf

Wkhtmltopdf is a command-line tool used by Odoo to generate PDF reports. Download the appropriate package for Debian 12 from the official website:

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb

Next, install wkhtmltopdf and its dependencies using the following command:

sudo apt install ./wkhtmltox_0.12.6-1.buster_amd64.deb

Step 7. Installing Odoo on Debian 12.

Navigate to the Odoo user’s home directory:

cd /opt/odoo

Clone the Odoo repository from GitHub using the following command:

sudo git clone https://github.com/odoo/odoo.git

Change to the cloned Odoo directory:

cd odoo

Check out the desired version branch. For example, to use Odoo 15.0, run:

sudo git checkout 15.0

While in the cloned Odoo directory, install Odoo’s Python dependencies using pip:

pip install -r requirements.txt

This command will install all the necessary Python packages specified in the requirements.txt file.

If you encounter any missing dependencies during the Odoo installation process, you can install them individually using apt install or pip install.

Step 8. Configure Odoo Server.

Create a configuration file for Odoo by running:

sudo nano /etc/odoo.conf

Add the following lines to the configuration file:

[options]
; Database
db_host = False
db_port = False
db_user = odoo
db_password = your_odoo_db_password
addons_path = /opt/odoo/odoo/addons,/opt/odoo/custom_addons

; Log
logfile = /var/log/odoo/odoo.log

; Security
admin_passwd = your_admin_password

Replace your_odoo_db_password with the password you set for the Odoo PostgreSQL user in Step 4, and your_admin_password with a strong password for the Odoo admin user.

Step 9. Set Up Odoo Service.

To run Odoo as a system service, create a new file named odoo.service in the /etc/systemd/system/ directory:

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

Add the following content to the file:

[Unit]
Description=Odoo ERP
After=postgresql.service

[Service]
Type=simple
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf
KillMode=mixed

[Install]
WantedBy=multi-user.target

Reload the systemd configuration:

sudo systemctl daemon-reload

Start the Odoo service:

sudo systemctl start odoo

Enable the Odoo service to start automatically on system boot:

sudo systemctl enable odoo

Step 10. Access Odoo Web Interface.

Open a web browser and navigate to http://<server-ip>:8069, replacing <server-ip> with the IP address or domain name of your Debian 12 server.

How To Install Odoo ERP on Debian 12

Congratulations! You have successfully installed Odoo. Thanks for using this tutorial to install the latest version of the Odoo ERP on Debian 12 Bookworm. For additional help or useful information, we recommend you check the official Odoo website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button