Dolibarr CRM

Introduction

It had been a long time I wanted to post about the Dolibarr CRM, especially since it has been running non-stop for almost 5 years on my production server and updating it from version 16 to version 20 was one of my New Year’s resolutions for 2025 😉

When I became a freelancer, I needed a quick and easy invoicing tool, so I choose this CRM which is for me the best open source management tool that can be found on the internet. Its handling is really easy and its update is disconcerting too.

What Dolibarr can do… and more

Management of customers, prospects, suppliers, services, products and their stocks, invoices, orders as well as all accounting in single or double-entry mode with basic reports provided such as turnover, sales statistics and profitability. You also have good surprise like project managment and timesheet or directly sending by email invoices and all your commercial documents.

A bit of technique

This CRM/ERP written in PHP has an intuitive graphical interface compatible with all types of screens such as mobile screens, the great strength of the tool is that you can activate and deactivate a module transparently, you activate it, configure it and you are good to go.

Updating a CRM matters, it can be a veeeeery painful task, that’s not the case with Dolibarr, the migration is incremental using automatic and out-of-the-box scripts that allow you to jump from one version to another till the target version (see demo below)

To go further

Be aware that there are paid plugins from third-party publishers that can be found on the dolistore, you can extend the functionalities by developing them yourself, Dolibarr has also an API for all kinds of integration.

From scratch live demo

Launch this command to get the repository

$ git clone https://github.com/jsminet/docker-dolibarr.git

There are two compose files in this repository

compose.yml which allows you to generate a yaml swarm file compatible with the docker stack deploy command (see sed command), it requires the activation of swarm in order to use docker secret to encrypt the database passwords, it also allows thanks to Traefik to generate and automatically renew a let’s encrypt certificate using ACME protocol.

compose-test.yml allows us to launch a test environment with the desired version of dolibarr, version 20.0.1 in the example.

Now use the command

$ docker compose -f .\compose-test.yml up

Once all containers are up and running, you can navigate to dolibarr.localtest.me, the proxy Traefik will redirect this request to the dolibarr container frontend based on the DNS entry.

Use login: admin and password: admin

Complete your company informations and select/activate required modules

Click on Society/organization then enter your informations and upload a logo

Choosing the country will automatically select the accounting plan if you use the module as well as the VAT rates in the country in question.
EDIT: You must add the VAT rate which has gone from 16% to the original rate of 17% in Luxembourg, in 2023 the only country that temporary decrease VAT to help purchasing power due to inflation

Go to the menu Configuration -> Dictionnaire -> Taux de TVA ou de Taxes de Ventes

Activate these modules to create a customer invoice

Create yout first customer, define the customer type then click on Create customer button.

Create a service to sell, you can exclude it from buying.

You are now ready to invoice. Juste create a draft invoice by selecting the invoice date, terms and conditions. Once the draft is create, add a invoice line with the service we created prevously and define a quantity. You can now validate the invoice to finalize it take it into consideration in accounting point of view.

Let’s see the result

Clean everything

$ docker compose -f .\compose-test.yml down -v

Upgrading Dolibarr demo

In this part, we’ll see how to put a MariaDB backup file and automatically inject it to the database throught the /docker-entrypoint-initdb.d directory

Put the compressed sql.gz backup into app/mariadb/dump/in directory

This dump is generate automatically by the ubuntu-cron container

Change the crontab if you need to, by default the save is processed at midnight

You can get the dump in this volume named dolibarr-dump

Change the DOLI_INSTALL_AUTO environment variable to zero in order to disable the initial load of fresh dolibarr metadata.

The dump will automatically be injected when the MariaDB database starts, for this example I’ll use a version 16 dump. Once you reach the interface page, a new window detects and displays the database version as well as all the prerequisites necessary for a new installation, which are obviously correct since it is the official version of the docker image 😉

You just have to click on Start button one by one, to switch from one version (v16) to another till the target version (v20)

Conclusion

We’ll see how it’s easy to drive a fresh or an upgraded installation of Dolibarr, if you plan to use it on a secured remote server and need advice using docker secret and let’s encrypt certificate for https, feel free to contact me