Site icon LinuxTuto

How to Install Dolibarr ERP on Debian 12

Dolibarr ERP on Debian 12

Dolibarr ERP is an open-source software suite designed to help businesses and organizations manage various aspects of their operations. It provides modules for a wide range of business functions, making it a comprehensive solution for small and medium-sized enterprises (SMEs). Dolibarr is written in PHP and is often used as a web application, making it accessible from different devices with a web browser.

Dolibarr ERP is suitable for a variety of businesses, particularly those in the SME sector. It provides a cost-effective solution for managing key business processes and can be adapted to different industries and sectors. As an open-source solution, it offers flexibility and the ability to tailor the system to specific organizational needs.

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

Step 1: Update Operating System

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

# apt update && apt upgrade

Also, install necessary packages.

# apt install curl nano wget unzip zip

Step 2: Install Apache webserver

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

# apt install apache2

Verify the status of the Apache service using 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: 13773 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 13777 (apache2)
      Tasks: 7 (limit: 2273)
     Memory: 37.4M
        CPU: 494ms
     CGroup: /system.slice/apache2.service
             ├─13777 /usr/sbin/apache2 -k start
             ├─13778 /usr/sbin/apache2 -k start
             ├─13779 /usr/sbin/apache2 -k start
             ├─13780 /usr/sbin/apache2 -k start

Step 3: Install PHP and required extensions

By default, Debian12 comes with PHP version 8.2. To install PHP and the necessary extensions, run the following command:

# apt install php libapache2-mod-php php-cli php-intl php-json php-common php-mbstring php-imap php-mysql php-zip php-gd php-mbstring php-curl php-xml

Once the installation is complete verify if PHP is installed:

php -v
Output:
PHP 8.2.7 (cli) (built: Jun  9 2023 19:37:27) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.7, Copyright (c), by Zend Technologies

Then edit the php.ini file:

# nano /etc/php/8.2/apache2/php.ini

Change the following settings:

memory_limit = 512M
post_max_size = 32M
upload_max_filesize = 32M
date.timezone = America/Chicago

Restart the Apache service to apply the changes:

# systemctl restart apache2

Step 4: Install MariaDB and create a database

To install MariaDB run the following command:

# apt install mariadb-server mariadb-client

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

# systemctl status mariadb

Output:

● mariadb.service - MariaDB 10.11.6 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; preset: enabled)
     Active: active (running)
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 10002 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 9 (limit: 2273)
     Memory: 242.0M
        CPU: 1.918s
     CGroup: /system.slice/mariadb.service
             └─10002 /usr/sbin/mariadbd

Now run the command below to log in to the MariaDB shell.

# mysql -u root

Once you are logged in to your database server you need to create a database for the Dolibarr installation:

MariaDB [(none)]> CREATE DATABASE dolibarr;
MariaDB [(none)]> CREATE USER 'dolibarr'@'localhost' IDENTIFIED BY 'Str0ngPassw0rd';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON dolibarr. * TO 'dolibarr'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Step 5: Download Dolibarr

The latest version of Dolibarr is available to download from GitHub. You can download it with the following command:

# wget https://github.com/Dolibarr/dolibarr/archive/refs/tags/19.0.0.zip

Then extract file into the folder /var/www/ with the following command:

# unzip 19.0.0.zip -d /var/www/
# mkdir /var/www/dolibarr
# mv /var/www/dolibarr-19.0.0/htdocs/* /var/www/dolibarr

Then enable permission for the Apache webserver user to access the files:

# chown -R www-data:www-data /var/www/dolibarr/

Step 6: Configure Apache for Dolibarr

To create a new VirtualHost file run the following commands:

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

Paste the content as shown below:

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

    <Directory /var/www/dolibarr/> 
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory> 

    ErrorLog ${APACHE_LOG_DIR}/your-domain.com_error.log
    CustomLog ${APACHE_LOG_DIR}/your-domain.com_access.log combined

 </VirtualHost>

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

Save and exit the configuration file.

To enable this site run the command:

# /usr/sbin/a2ensite dolibarr.conf

To implement the changes, restart Apache webserver:

# systemctl restart apache2

Step 7: Access Dolibarr Web Interface

To complete the setup go to your browser and visit http://your-domain.com.

Select your language and click on the Next step button. You should see the following page:

Validate the PHP checks and click on the Start button. You should see the following page:

Provide your database name, database username, password, admin username and password. Then, click on the Next step button.

Installation successful, click on the Next step button.

Click on the Next step button.

Set a new admin username and password. Then, click on the Next step button.

Click on the Go to Dolibarr button and you should see the login page:

Provide your admin username and password. Then, click on the LOGIN button.

To finalize the installation and remove the installation warnings on the dashboard, run the following commands:

# touch /var/www/dolibarr/documents/install.lock
# chown root:root /var/www/dolibarr/conf/conf.php

Comments and Conclusion

That’s it. You have successfully installed Dolibarr ERP on Debian 12.

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

If you have any questions please leave a comment below.

Exit mobile version