Dolibarr is a free, open source and an all-in-one ERP and CRM for small and medium companies. It is simple and easy to use web-based ERP application that can be used to manage customers, invoices, orders, products, inventories and much more. If you are looking for ERP and CRM solutions for your business, then Dolibarr is a good choice for you.
In this tutorial, we will install Dolibarr on Ubuntu 18.04 server.
Requirements
- Ubuntu 18.04 desktop installed on your system.
- A non-root user with sudo privileges.
Install Apache, PHP, MariaDB
Before starting, you will need to install Apache, MariaDB, PHP, and other PHP modules to your system with the following command:
sudo apt-get update -y
sudo apt-get install apache2 mariadb-server php7.2 libapache2-mod-php7.2 php7.2-common php7.2-curl php7.2-intl php7.2-mbstring php7.2-json php7.2-xmlrpc php7.2-soap php7.2-mysql php7.2-gd php7.2-xml php7.2-cli php7.2-zip wget unzip git -y
Once the installation has been completed, open php.ini file with the following command:
sudo nano /etc/php/7.2/apache2/php.ini
memory_limit = 512M upload_max_filesize = 150M max_execution_time = 360 date.timezone = Europe/Berlin
Save and close the file. Then, start Apache and MariaDB service and enable them to start on boot time with the following command:
sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl start mariadb
sudo systemctl enable mariadb
Configure MariaDB
By default, MariaDB is not secured. So, you will need to secure it first. You can do this by running the following script:
sudo mysql_secure_installation
Answer all the questions as shown below:
Enter current password for root (enter for none): Set root password? [Y/n]: N Remove anonymous users? [Y/n]: Y Disallow root login remotely? [Y/n]: Y Remove test database and access to it? [Y/n]: Y Reload privilege tables now? [Y/n]: Y
Once the MariaDB is secured, log in to MariaDB shell:
mysql -u root -p
Enter your root password, then create a database and user for Dolibarr:
MariaDB [(none)]> CREATE DATABASE dolibarrdb character set UTF8 collate utf8_bin;
MariaDB [(none)]> CREATE USER dolibarr;
Next, grant privileges to the Dolibarr database with the following command:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON dolibarrdb.* TO 'dolibarr'@'localhost' IDENTIFIED BY 'mypassword';
Replace the word 'mypassword' in the above command with a secure password of your choice. Next, you will need to run the FLUSH PRIVILEGES command so that the privileges table will be reloaded by MySQL and we can use new credentia$
MariaDB [(none)]> FLUSH PRIVILEGES;
Next, exit from the MariaDB console with the following command:
MariaDB [(none)]> EXIT
Download and Install Dolibarr
First, download the latest version of Dolibarr from SourceForge with the following command:
cd /tmp
wget https://sourceforge.net/projects/dolibarr/files/Dolibarr%20ERP-CRM/8.0.4/dolibarr-8.0.4.zip
Once the download is completed, unzip the downloaded file with the following command:
unzip dolibarr-8.0.4.zip
Next, copy the extracted directory to the Apache web root and give proper permissions:
sudo mkdir /var/www/html/dolibarr
sudo cp -r dolibarr-8.0.4/htdocs/* /var/www/html/dolibarr/
sudo chown -R www-data:www-data /var/www/html/dolibarr/
sudo chmod -R 755 /var/www/html/dolibarr/
Create a folder for Dolibarr to store uploaded documents:
mkdir /var/documents
chown www-data:www-data /var/documents
chmod 700 /var/documents
Next, create an Apache virtual host file with the following command:
sudo nano /etc/apache2/sites-available/dolibarr.conf
Add the following lines:
<VirtualHost *:80> ServerAdmin admin@example.com DocumentRoot /var/www/html/dolibarr ServerName example.com <Directory /var/www/html/dolibarr> 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 the domain name 'example.com' with your own domain name in the vhost file. Then save the file, then enable apache virtual host file with the following command:
sudo a2ensite dolibarr
Next, enable Apache rewrite module and reload apache service with the following command:
sudo a2enmod rewrite
sudo systemctl restart apache2
Access Dolibarr
Now, open your web browser and type the URL of your Dolibarr website, in my case http://example.com. Here, select your language and click on the Next step button. Then, validate the PHP checks and click on the Start button.
Now, provide your document directory (/var/documents) and the database details and click on the Next step button. Here, click on the Next step button. Here, set a new admin username and password. Then, click on the Next step button. Once the user created successfully. Now, click on the Go to Dolibarr button. You will be redirected to the Dolibarr login page.
Now, provide your admin username and password. Then, click on the Connection button. You should see the Dolibarr setup page.
Click on Company/Organization and enter the Details of your company, then go to Modules/Applications and select which Modules you want to use. When you click on 'My dashboard' afterwards, you will get a page similar to that.
To finalize the installation and remove the installation warnings on the dashboard, run these commands:
sudo touch /var/documents/install.lock
sudo chown root:root /var/www/html/dolibarr/conf/conf.php
Virtual machine image download of this tutorial
This tutorial is available as ready to use virtual machine image in ovf/ova format that is compatible with VMWare and Virtualbox. The virtual machine image uses the following login details:
SSH / Shell Login
Username: administrator
Password: rootadminz
This user has sudo rights.
Dolibarr Login
Username: admin
Password: rootadminz
MySQL Login
Username: root
Password: rootadminz
Username: dolibarr
Password: rootadminz
The IP of the VM is 192.168.1.100, it can be changed in the file /etc/netplan/01-netcfg.yaml. Please change all the above passwords to secure the virtual machine.