If your business has grown to the point it requires help with planning and organizing details such as contacts, suppliers, invoices, orders, stock and schedules, you need an ERP tool. You can either turn to a third-party platform, or you can deploy an in-house solution to your data center or a third-party cloud host.

Follow this step-by-step process of installing the Dolibarr ERP/CRM solution, which is perfectly suited for organizations of all sizes as well as for freelancers.

What you’ll need to install Dolibarr

I’ll demonstrate the deployment on Ubuntu Server 22.04, but Dolibarr can be installed on just about any Linux distribution. If you’re using a server distro other than Ubuntu, you’ll need to modify some of the installation commands. You’ll also need a user with sudo privileges.

SEE: 9 must-do tips to secure Ubuntu Server (TechRepublic Premium)

How to install the dependencies

The first thing we’ll do is install the necessary dependencies, starting with the web and database servers.

Log in to your instance of Ubuntu Server and install the Apache web server with the command:
sudo apt-get install apache2 -y
Once the installation completes, start and enable the server with:

sudo systemctl enable --now apache2

Enable the rewrite module with:

sudo a2enmod rewrite

Next, let’s install the necessary PHP dependencies with:

sudo apt-get install php php-cli php-mysql php-common php-zip php-mbstring php-xmlrpc php-curl php-soap php-gd php-xml php-intl php-ldap libapache2-mod-php -y

After PHP is installed, you’ll need to do a quick configuration. Open the PHP config file with the command:

sudo nano /etc/php/*/apache2/php.ini

In that file, look for the following and change them to the values shown, where TIMEZONE is your particular time zone:

  • date.timezone = TIMEZONE
  • memory_limit = 256M
  • upload_max_filesize = 64M
  • display_errors = On
  • log_errors = Off

We’ll install the MariaDB database with the command:

sudo apt-get install mariadb-server mariadb-client -y

When the installation completes, you need to secure the MariaDB database server with the command:

sudo mysql_secure_installation

Make sure to set a strong/unique password for the admin user.

How to create the database

Log into the database console with:

sudo mysql -u root -p

Create the database and the Dolibarr user with the following commands, where PASSWORD is a strong/unique password:

CREATE USER 'dolibarr'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT ALL PRIVILEGES ON dolibarr.* TO 'dolibarr'@'localhost';

How to configure Apache

Let’s create an Apache virtual host file with:

sudo nano /etc/apache2/sites-enabled/dolibarr.conf

In that file, paste the following:

<VirtualHost *:80>
  DocumentRoot /var/www/html//dolibarr/htdocs/

  Directory /srv/dolibarr/htdocs>
  Options +FollowSymlinks
  AllowOverride All
  Require all granted

  ErrorLog /var/log/apache2/dolibarr_error.log
  CustomLog /var/log/apache2/dolibarr_access.log combined


Save and close the file. Restart Apache with:

sudo systemctl restart apache2

How to download and unpack Dolibarr

We’re going to set a variable to the latest version available for Dolibarr with the command:

release_tag=$(curl -s | grep tag_name | cut -d '"' -f 4)

We can now use release_tag to ensure we’re getting and using the latest version. Download Dolibarr with:


Unpack Dolibarr with:

sudo mv dolibarr-${release_tag} /var/www/html/dolibarr

Give the new directory the proper permissions with:

sudo chown -R /var/www/html/dolibarr

How to complete the installation

Open a web browser and point it to http://SERVER/dolibarr/htdocs where SERVER is the IP address of the hosting server, and you’ll be greeted by the Dolibarr web installer (Figure A).

Figure A

Dolibarr ERP/CRM web installer.
The Dolibarr web installer.

Click Next and then, in the resulting window, click Start (Figure B).

Figure B

Dolibarr ERP/CRM prerequisite check has passed and is ready to go.
The prerequisite check has passed and is ready to go.

On the configuration page (Figure C), you need to configure the database options. In our install, the database name is dolibarr, the user is dolibarr, and the password is what you set in the MariaDB console. You’ll also want to scroll to the bottom of that page, create a super user account, and then click Next Step.

Figure C

Dolibarr web-based configuration page.
The Dolibarr web-based configuration page.

When prompted, click Next Step again to launch the installation. This step will take awhile to complete, as it must populate the database and save the configuration options you’ve selected. After this finishes, you can log into Dolibarr with your superuser account and begin using your new ERP/CRM solutions.

Before you finish the Dolibarr installation process be sure to add an installation lock file to prevent anyone from maliciously using the install tools. To do that, issue the command:

sudo touch /var/www/html/dolibarr/documents/install.lock

Congratulations on taking your business to the next level of efficiency.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays