# Dolibarr ERP/CRM

> Business management software suite.

- Category: E-Commerce & Business
- Difficulty: beginner
- Components: dolibarr, mariadb
- Tags: dolibarr, erp, crm, business
- Source: https://docker.recipes/ecommerce/dolibarr

## Overview

Dolibarr is a comprehensive open-source ERP (Enterprise Resource Planning) and CRM (Customer Relationship Management) software suite designed for small to medium-sized businesses. Originally developed in France in 2003, Dolibarr offers a modular approach to business management, allowing organizations to activate only the features they need, from customer relationship management and invoicing to inventory control, project management, and human resources. This makes it particularly attractive for growing businesses that need flexibility without the complexity and cost of enterprise-grade solutions.

This Docker stack combines Dolibarr with MariaDB to create a complete business management platform. MariaDB serves as the robust database backend, leveraging its enhanced performance features and Aria storage engine to handle Dolibarr's complex relational data structure efficiently. The combination provides excellent performance for concurrent user sessions, invoice processing, and inventory tracking while maintaining data integrity across all business modules.

This configuration is ideal for businesses transitioning from spreadsheet-based management systems, organizations needing integrated CRM and accounting functionality, and companies requiring multi-user access to centralized business data. The modular nature of Dolibarr combined with MariaDB's reliability makes this stack particularly valuable for service companies, retail businesses, and consultancies that need comprehensive business management without vendor lock-in.

## Features

- Modular ERP system with 50+ optional modules including CRM, invoicing, inventory, HR, and project management
- Multi-company support allowing management of multiple business entities from single installation
- Advanced invoicing system with recurring billing, payment tracking, and multi-currency support
- Integrated document management with automatic PDF generation for quotes, invoices, and contracts
- Point of sale (POS) module for retail operations with barcode scanning and cash register integration
- Project management tools with time tracking, expense reporting, and Gantt chart visualization
- MariaDB's Aria storage engine providing crash-safe table operations and improved performance for business data
- Built-in workflow management for purchase orders, sales processes, and approval chains

## Use cases

- Small manufacturing companies managing inventory, suppliers, and customer orders in one system
- Service-based businesses tracking client relationships, project hours, and generating professional invoices
- Retail stores needing integrated POS, inventory management, and customer loyalty programs
- Consulting firms managing multiple client projects with time tracking and expense reporting
- Non-profit organizations tracking donors, managing events, and handling membership databases
- Freelancers and small agencies requiring professional invoicing with integrated CRM capabilities
- Distribution companies managing complex supplier relationships and multi-location inventory

## Prerequisites

- Minimum 2GB RAM recommended for Dolibarr with moderate usage (MariaDB requires 1GB+)
- At least 10GB available disk space for application files and database growth
- Port 8080 available for Dolibarr web interface access
- Basic understanding of ERP concepts like customers, suppliers, products, and invoicing workflows
- Knowledge of business processes to properly configure Dolibarr modules for your organization
- Understanding of user permissions and roles for multi-user business environment setup

## docker-compose.yml

```yaml
services:
  dolibarr:
    image: dolibarr/dolibarr:latest
    container_name: dolibarr
    restart: unless-stopped
    environment:
      DOLI_DB_HOST: mariadb
      DOLI_DB_NAME: ${DB_NAME}
      DOLI_DB_USER: ${DB_USER}
      DOLI_DB_PASSWORD: ${DB_PASSWORD}
      DOLI_ADMIN_LOGIN: ${ADMIN_USER}
      DOLI_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
    volumes:
      - dolibarr_docs:/var/www/documents
      - dolibarr_custom:/var/www/html/custom
    ports:
      - "8080:80"
    depends_on:
      - mariadb
    networks:
      - dolibarr

  mariadb:
    image: mariadb:11
    container_name: dolibarr-mariadb
    environment:
      MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
      MARIADB_DATABASE: ${DB_NAME}
      MARIADB_USER: ${DB_USER}
      MARIADB_PASSWORD: ${DB_PASSWORD}
    volumes:
      - mariadb_data:/var/lib/mysql
    networks:
      - dolibarr

volumes:
  dolibarr_docs:
  dolibarr_custom:
  mariadb_data:

networks:
  dolibarr:
    driver: bridge
```

## .env

```bash
DB_ROOT_PASSWORD=rootpassword
DB_NAME=dolibarr
DB_USER=dolibarr
DB_PASSWORD=changeme
ADMIN_USER=admin
ADMIN_PASSWORD=changeme
```

## Usage notes

- Docs: https://wiki.dolibarr.org/
- Access at http://localhost:8080 - login with ADMIN_USER/ADMIN_PASSWORD
- Enable modules in Home > Setup > Modules to activate features
- Modules: CRM, invoicing, orders, stock, HR, accounting, projects
- Custom modules in /var/www/html/custom directory
- Free and open-source - great for small/medium businesses

## Troubleshooting

- Dolibarr shows database connection error: Verify MariaDB container is running and DOLI_DB_HOST matches the MariaDB service name
- Unable to upload documents or attachments: Check that dolibarr_docs volume has proper write permissions and sufficient disk space
- Dolibarr modules missing after restart: Ensure dolibarr_custom volume is properly mounted and contains your custom module files
- Invoice PDF generation fails: Verify PHP memory limits in Dolibarr configuration and check document storage volume permissions
- MariaDB crashes during large data imports: Increase MariaDB's innodb_buffer_pool_size and max_allowed_packet settings
- Dolibarr performance slow with many users: Enable MariaDB's thread pool and consider upgrading to MariaDB 11's improved connection handling

