Installation of Dolibarr using Docker Compose

Posted By Shashank Raj | 30-Nov-2018

About Dolibar --
Dolibarr is an opensource, an all-in-one ERP & CRM platform with free software packages for small and medium companies, foundations or freelancers.

It includes different features for enterprise resource planning (ERP) & customer relationship management (CRM) but also other features for different activities.
There are several feature modules that can enable & disabled as per our need. The software is free Under GNU. As it is web-based application so it can be used over the internet. Basically, it aims to offer open source ERP & CMS for the feature for people with no technical knowledge with a simple solution.


Installation process --

 -- create a directory with a name as per your choice.

$ sudo mkdir dolibarr

-- using any editor create a compose file Docker-compose.yml

$ sudo vim Docker-compose.yml

# put these lines in the compose file

version: '3'
  image: nginx:1.15
   - php
   - db
   - dolibarr_wp
   - ./nginx/conf.d:/etc/nginx/conf.d
   - ./nginx/default.d:/etc/nginx/default.d
   - ./nginx/nginx.conf:/etc/nginx/nginx.conf
   - ./www:/var/www/html
   - "80:80"

  image: php:7.0-fpm
  restart: always
   - dolibarr_wp
   - ./www:/var/www/html

  image: mysql:5.7
  restart: always
   - dolibarr_wp
   - ./db/db_data:/var/lib/mysql
   - ./db/conf.d:/etc/mysql/conf.d
   - .env/db.env


:wq!   #to save and exit

-- dolibarr needs a webserver either nginx or Apache, a database MYSQL 5.0.3+ or MariaDB or PostgreSQl, PHP 5.3.0+ (as it is written in PHP) to be deployed.

-- Now before building the Compose file we have to setup or configure file and directories as we have mentioned in the Compose file for Database, Php, webserver Nginx configuration file and directory as conf.d, default.d and nginx.conf in the nginx directory with the same directory in of Docker Compose file. For Db create a directory db in which create two directories conf.d and db_data as mentioned in the compose file so that the DB could be able to store dolibarr related data. Also, create a dir www for webserver in which we have to place the extracted file of dolibarr.

-- Download and extract the dolibarr file in the www directory.

$ sudo mkdir www

$ cd www/

$ wget

$ tar xvf dolibarr-8.03.tar.gz

$ sudo mv dolibarr-8.03.tar.gz dolibarr

$ sudo chown -R www-data:www-data  www

$ sudo chmod -R 775 www

$ sudo chmod -R 755 www/dolibarr


-- Create a conf file for Database MYSQl

$ sudo mkdir -p db/conf.d

$ sudo mkdir db/db_data

-- create and configure the Nginx configuration files with following entries

$ sudo mkdir -p nginx/conf.d

$ cd nginx/conf.d

$ sudo vim doli.conf

#make the following entries

server {
       server_name localhost;
    index index.html index.php;
    root /var/www/html/dolibarr;

    location / {
    try_files $uri $uri/ /index.php?$args;
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass php:9000;
        fastcgi_read_timeout 3000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;


$ cd ..

$ sudo mkdir default.d

$ sudo vim nginx.conf

#put  following lines

user www-data;
worker_processes 1;
pid /var/run/;

events {
    worker_connections 1024;


http {

    # Basic Settings

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;


    # Logging Settings

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    # Gzip Settings

    gzip on;
    gzip_disable "msie6";

    # Virtual Host Configs
        include /etc/nginx/conf.d/*.conf;


-- Now for PHP-fpm configuration file:

$ cd ..

$ sudo vim php-fpm.conf


; Pool Definitions ;




-- Now create the enviroment file for the database :


$ cd ..

$ sudo mkdir .env

$ cd .env/

$ sudo vim db.env



$ cd ..

$ ls -a


.   ..   db   docker-compose.yml   .env   nginx   php-fpm.conf   www

-- Now build the docker compose file:

$ sudo docker-compose up -d

$ sudo docker ps

-- open browser



Note: If during the installation if it would ask for any further php modules then install the modules in the running php container and again run the docker compose command and also make sure that no other webserver running on your host machine.









Request for Proposal

Recaptcha is required.

Sending message..