Dolibarr is a free and open source ERP/CRM for small and medium companies that can be used to manage your customers, invoices, orders, products, stocks, agenda, e-mailings, shipments easily.
Dolibarr comes with several feature modules for ERP and CMS that can be enabled or disabled as per your need. You can freely use, study, modify or distribute it according to its Free Software licence.
Dolibarr is a standalone web application that enables you to access it from the Internet or a LAN.
In this tutorial, we will learn how to install and configure Dolibarr on CentOS 7 server.
Requirements
-A server running CentOS 7.
– A not root user with sudo privileges setup on your server.
Update the System
Before installing any packages, it is recommended to update your system with the latest stable version.
You can update it with the following command:
sudo yum update -y
Once your system is up to date, you can proceed to install required packages.
Install LAMP server
First, you will need to install Apache web server, PHP and other required packages on your system.
You can install all of them with the following command:
sudo yum install httpd php php-common php-cli php-gd php-pgsql openssl mod_ssl -y
Once the installation is complete, start Apache web server and enable it to start on boot with the following command:
sudo systemctl start httpd
sudo systemctl enable httpd
Next, we will use PostgreSQL to store database. You can install it with the following command:
sudo yum install postgresql postgresql-server postgresql-libs -y
Once PostgreSQL is installed, you will need to initialize the PostgreSQL database before PostgreSQL service is started for the first time.
To do so, run the following command:
sudo postgresql-setup initdb
Next, you will need to make some changes in /var/lib/pgsql/data/pg_hba.conf file.
sudo nano /var/lib/pgsql/data/pg_hba.conf
Change the file from:
local all all peer
host all all 127.0.0.1/32 ident
host all all ::1/128 ident
to
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
Save and close the file when you are finished, then start PostgreSQL and enable it to start at boot time:
sudo systemctl start postgresql
sudo systemctl enable postgresql
Configure Database
Next, you will need to create a user and database for Dolibarr.
First, login to Postgres console with the following command:
su - postgres
Next, create a user and database for dolibarr with the following command:
createuser dolibarr
psql -h localhost -d template1 -c "alter user postgres with password 'password'"
psql -h localhost -d template1 -c "alter user dolibarruser with password 'password'"
psql
create database dolibarrdb encoding 'UTF8' owner dolibarr;
Finally, exit from the postgres shell with the following command:
exit
It is recommended to use a strong password for the postgres and dolibarr PostgreSQL user accounts respectively.
Next, you will need to modify pg_hba.conf file located at /var/lib/pgsql/data/ directory:
sudo nano /var/lib/pgsql/data/pg_hba.conf
Change the file as shown below:
local all dolibarr md5
local all postgres md5
host all all 127.0.0.1/32 ident
host all all ::1/128 ident
Save and close the file, then restart PostgreSQL service for the changes to take effect:
sudo systemctl restart postgresql
Download Dolibarr
You can download the latest version of Dolibarr from their official website.
Otherwise you can use wget command to download it:
wget http://www.dolibarr.org/files/dolibarr.tgz
Once the download is completed, extract the downloaded file with the following command:
tar -xvfz dolibarr.tgz
Next, move the extracted directory to the apache web root directory:
sudo mv dolibarr-4.0.4/htdocs /var/www/html/dolibarr
Next, give proper permission to the dolibarr directory:
sudo chown -R apache:apache /var/www/html/dolibarr
Once you are done, you can proceed to configure apache.
Configure Apache for Dolibarr
Now, you will need to create a apache virtual host configuration file for Dolibarr.
You can do this by creating dolibarr.conf file inside /etc/httpd/conf.d/ directory:
sudo nano /etc/httpd/conf.d/dolibarr.conf
Add the following lines:
<VirtualHost *:80>
ServerAdmin webmaster@your-domain.com
DocumentRoot /var/www/html/dolibarr
ServerName 192.168.15.193
ErrorLog /var/log/httpd/dolibarr-error_log
CustomLog /var/log/httpd/dolibarr-access_log combined
<Directory /var/www/html/dolibarr/>
DirectoryIndex index.php
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Save and close the file when you are finished, then restart Apache using systemctl for the changes to take effect:
sudo systemctl restart httpd
Access Dolibarr Web Interface
Before accessing Dolibarr web interface, you will need to configure your firewall to allow port 80 so that the Apache web server’s default port will be accessible externally. You can do this with the following command:
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
Next, reload your firewall service with the following command:
sudo firewall-cmd --reload
Once, everything is configured, open your web browser and type the URL http://192.168.15.193, you will be redirected to the Dolibarr setup wizard as shown in below image:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/1498639074.png” alt=”” />
Here, choose the language as per your need, then click on the “Next step” button, you should see the following page:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/661422687.png” alt=”” />
Here, you should see all the requirements check. when all is well then click on the start button to begin the installation:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/1018824489.png” alt=”” />
The above steps creates configuration config for us. Click on the “Next step” button, you should see the following page:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/1024442277.png” alt=”” />
Here, you will need to define the web root directory and directory to store generated documents:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/2093783059.png” alt=”” />
Here, provide your database credentials, then click on the “Next” button, you should see the following page:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/738449821.png” alt=”” />
Here, you should see the success messege of database object creation, then click on the “Next” button, you should see the following page:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/478555632.png” alt=”” />
Here, you will need to input Dolibarr admin credentials, then click on the “Next step” button. Once the installation is finished, you should see the Dolibarr login page as shown in below image:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/535940164.png” alt=”” />
Here, provide your admin credentials and click on the “Connection” button, you should see the Dolibarr default dashboard in below image:
HP_NO_IMG/data/uploads/users/7ecb43a5-b365-4ebf-93d5-f3b632f29f33/1421714866.png” alt=”” />
Congratulations! You have successfully installed Dolibarr on your CentOS 7 server.