
Dolibarr is a popular open-source Enterprise Resource Planning (ERP) and Customer Relationship Management (CRM) software that can be installed on Linux systems. It offers a wide range of features for managing businesses, including accounting, invoicing, project management, inventory, and more. In this comprehensive guide, we’ll walk you through the step-by-step process of installing Dolibarr on a Linux system.
Prerequisites
Before we begin, make sure you have the following prerequisites in place:
- Linux Operating System: Dolibarr can be installed on various Linux distributions, such as Ubuntu, Debian, CentOS, or Fedora. In this guide, we’ll use Ubuntu 22.04 LTS as an example.
- Web Server: Dolibarr requires a web server to run, so you’ll need to have Apache or Nginx installed on your Linux system.
- Database Server: Dolibarr uses a database to store its data, so you’ll need to have a database server installed, such as MySQL or MariaDB.
- PHP: Dolibarr is built using PHP, so you’ll need to have PHP installed on your system.
Step 1: Install the Required Packages
Update the Package Index:
$ sudo apt-get update
Install Apache Web Server:
$ sudo apt-get install apache2 -y
Install MariaDB Database Server:
$ sudo apt-get install mariadb-server mariadb-client -y
Install PHP and Required Modules:
$ sudo apt-get install php libapache2-mod-php php-mysql php-gd php-curl php-zip php-mbstring php-xml php-intl -y
Restart Apache:
$ sudo systemctl restart apache2
Step 2: Secure the MariaDB Database
Run the MySQL Secure Installation Script:
$ sudo mysql_secure_installation
This script will prompt you to set a root password for the MariaDB database, and it will also remove some insecure default settings.
Log in to the MariaDB Console:
$ sudo mysql -u root -p
Enter the root password you set in the previous step.
Create the Dolibarr Database and User:
CREATE DATABASE dolibarr;
CREATE USER 'dolibarr'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON dolibarr.* TO 'dolibarr'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Replace 'your_password'
with a strong, unique password for the Dolibarr user.
Step 3: Download and Extract Dolibarr
Download the Latest Dolibarr Release:
$ wget https://github.com/Dolibarr/dolibarr/archive/refs/tags/19.0.0.tar.gz
This will download the latest stable version of Dolibarr (19.0.0 in this example).
Extract the Downloaded Archive:
$ sudo tar -xzf 19.0.0.tar.gz -C /var/www/html/
This will extract the Dolibarr files to the /var/www/html/
directory.
Rename the Extracted Directory:
$ sudo mv /var/www/html/dolibarr-19.0.0 /var/www/html/dolibarr
This will rename the extracted directory to dolibarr
, making it easier to access the Dolibarr installation.
Set the Correct Permissions:
$ sudo chown -R www-data:www-data /var/www/html/dolibarr
$ sudo chmod -R 755 /var/www/html/dolibarr
These commands set the correct ownership and permissions for the Dolibarr directory and files.
Step 4: Configure the Apache Web Server
Create a Virtual Host Configuration File:
$ sudo nano /etc/apache2/sites-available/dolibarr.conf
Add the following content to the file:
<VirtualHost *:80>
ServerName dolibarr.example.com
DocumentRoot /var/www/html/dolibarr/htdocs
<Directory /var/www/html/dolibarr/htdocs>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/dolibarr-error.log
CustomLog ${APACHE_LOG_DIR}/dolibarr-access.log combined
</VirtualHost>
Replace dolibarr.example.com
with your desired domain name.
Enable the Virtual Host:
$ sudo a2ensite dolibarr.conf
Restart Apache:
$ sudo systemctl restart apache2
Step 5: Complete the Dolibarr Installation
Open the Dolibarr Installation Page:
In your web browser, navigate to http://dolibarr.example.com/install/
. Replace dolibarr.example.com
with your actual domain name or IP address.
Follow the Dolibarr Installation Wizard:
- On the first page, click “Start” to begin the installation process.
- On the configuration page, enter the database connection details:
- Database name:
dolibarr
- Database user:
dolibarr
- Database password: the password you set earlier
- Database name:
- Create a Dolibarr super-user account and click “Next Step” to continue.
- Review the installation summary and click “Next Step” to complete the installation.
Secure the Installation:
To prevent unauthorized access to the Dolibarr installation, create an installation lock file:
$ sudo touch /var/www/html/dolibarr/documents/install.lock
This file will prevent anyone from accessing the installation wizard again.
Congratulations! You have successfully installed Dolibarr ERP/CRM on your Linux system. You can now log in to the Dolibarr web interface using the super-user account you created during the installation process.
Updating Dolibarr
To update Dolibarr to a newer version, follow these steps:
Backup Your Dolibarr Data:
Before updating, it’s essential to create a backup of your Dolibarr data, including the database and any custom configurations or files.
Download the Latest Dolibarr Release:
$ wget https://github.com/Dolibarr/dolibarr/archive/refs/tags/19.0.1.tar.gz
Replace the version number with the latest stable release.
Extract the Downloaded Archive:
$ sudo tar -xzf 19.0.1.tar.gz -C /var/www/html/
Rename the Extracted Directory:
$ sudo mv /var/www/html/dolibarr-19.0.1 /var/www/html/dolibarr
Set the Correct Permissions:
$ sudo chown -R www-data:www-data /var/www/html/dolibarr
$ sudo chmod -R 755 /var/www/html/dolibarr
Clear the Cache and Logs:
$ sudo rm -rf /var/www/html/dolibarr/documents/cache/*
$ sudo rm -rf /var/www/html/dolibarr/documents/logs/*
Restart Apache:
$ sudo systemctl restart apache2
That’s it! Your Dolibarr installation has been updated to the latest version. Remember to test your updated Dolibarr installation thoroughly before putting it into production.
Troubleshooting
If you encounter any issues during the installation or usage of Dolibarr, here are some common troubleshooting steps you can try:
Check the Apache Error Logs:
$ sudo tail -n 50 /var/log/apache2/error.log
This will show you the last 50 lines of the Apache error log, which may provide clues about the issue you’re facing.
Check the Dolibarr Logs:
$ sudo tail -n 50 /var/www/html/dolibarr/documents/logs/dolibarr.log
The Dolibarr log file may contain more specific information about any errors or problems you’re experiencing.
Verify the Database Connection:
$ sudo mysql -u dolibarr -p
Log in to the MariaDB console and ensure that the Dolibarr database and user are set up correctly.
Check the Dolibarr Configuration File:
$ sudo nano /var/www/html/dolibarr/htdocs/conf/conf.php
Verify that the database connection details in the Dolibarr configuration file are correct.
Seek Community Support:
If you’re unable to resolve the issue on your own, consider seeking help from the Dolibarr community. You can post your question on the Dolibarr forums or reach out to the Dolibarr development team for assistance.
By following the steps outlined in this guide and troubleshooting any issues that arise, you should be able to successfully install and configure Dolibarr ERP/CRM on your Linux system.
One Reply to “Install / Update Dolibarr ERP/CRM on Linux”
You are wonderful. It works 100% in addition to some little adjustment in the php version installation.
Thank you.