3.2.1. Install Dolibarr and Talerbarr from the Command Line#

Important: This is not an official Dolibarr installation tutorial. It is provided only as a full end-to-end guide for installing the Talerbarr module, specifically using a folder-based installation rather than installation through the Dolibarr UI or Dolistore.

This tutorial is intended for users with some developer or system administration background. If you have never used command-line tools before, consider a more user-friendly way of getting Dolibarr, such as a SaaS solution approved by the Dolibarr team.

3.2.1.1. Mít server Debian#

Ensure you have a Debian server up and running with sudo access before proceeding. For this installation, Dolibarr will run in rootless Podman as a regular user, while sudo is used only for package installation and initial system setup. Rootless Podman is an officially supported mode, and for user services that must survive logout and start at boot, Podman/systemd guidance recommends enabling lingering for that user.

3.2.1.2. Have a DNS record#

Create a DNS record with your domain registrar or DNS provider:

Type: A

Name: erp, dolibarr, or another subdomain of your choice

Value: your server’s public IP address

3.2.1.3. Install Podman#

Install Podman and the tools needed for rootless containers:

sudo apt update
sudo apt upgrade -y
sudo apt install -y podman podman-compose uidmap slirp4netns fuse-overlayfs passt aardvark-dns

3.2.1.4. Create a dedicated user for Dolibarr#

Create a dedicated unprivileged user that will own and run the Dolibarr stack:

sudo adduser --disabled-password --gecos "" dolibarr
sudo loginctl enable-linger dolibarr

The loginctl enable-linger command is important because user-level systemd services are otherwise stopped after the last session for that user ends.

3.2.1.5. Create a reverse proxy#

You are absolutely, welcome, to set it up in preffered for you way, there mostly no right or wrong, here it will be just written, how we prepared system to completete the tutorials text and pictures.

Install Nginx and Certbot on the host:

sudo apt update
sudo apt install -y nginx certbot python3-certbot-nginx

Create /etc/nginx/sites-available/dolibarr.conf with the following content, replacing erp.example.com with your real domain:

server {
    listen 80;
    listen [::]:80;
    server_name erp.example.com;

    client_max_body_size 64M;

    location / {
        proxy_pass http://127.0.0.1:2793;
        proxy_http_version 1.1;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Port $server_port;
    }
}

Enable the site and reload Nginx:

sudo ln -s /etc/nginx/sites-available/dolibarr.conf /etc/nginx/sites-enabled/dolibarr.conf
sudo nginx -t
sudo systemctl reload nginx

Request a Let’s Encrypt certificate:

sudo certbot --nginx -d erp.example.com

After the certificate is issued successfully, Certbot will update the Nginx configuration to enable HTTPS and redirect HTTP traffic to HTTPS.

3.2.1.6. Become the Dolibarr user#

Switch to the new user:

sudo -iu dolibarr

All remaining Podman commands in this tutorial should be run as this user so that the deployment stays rootless.

3.2.1.7. Create persistent directories#

Create the directories that will hold persistent data:

mkdir -p ~/dolibarr/{mariadb,documents,custom}
cd ~/dolibarr

All of this has to be done, so that you wouldn’t lose data, in case of reboot or in case of upgrade of Dolibarr to a newer version.

3.2.1.8. Create the environment file#

Create a .env file for database and Dolibarr settings:

cat > .env <<'EOF'
MYSQL_ROOT_PASSWORD=CHANGE_THIS_ROOT_PASSWORD
MYSQL_DATABASE=dolidb
MYSQL_USER=dolidbuser
MYSQL_PASSWORD=CHANGE_THIS_DB_PASSWORD

DOLI_INSTALL_AUTO=1
DOLI_INIT_DEMO=0
DOLI_PROD=1
DOLI_DB_HOST=mariadb
DOLI_DB_HOST_PORT=3306
DOLI_DB_NAME=dolidb
DOLI_DB_USER=dolidbuser
DOLI_DB_PASSWORD=CHANGE_THIS_DB_PASSWORD
DOLI_URL_ROOT=https://erp.example.com
DOLI_ADMIN_LOGIN=admin
DOLI_ADMIN_PASSWORD=CHANGE_THIS_ADMIN_PASSWORD

WWW_USER_ID=1000
WWW_GROUP_ID=1000
EOF

This variables are part of the official Dolibarr container interface. Always re-verify that they have not changed and any contstraints/recommendations have been introduced before proceeding forward.

3.2.1.9. Create the compose file#

Create compose.yml:

cat > compose.yml <<'EOF'
services:
  mariadb:
    image: docker.io/library/mariadb:latest
    container_name: dolibarr-mariadb
    env_file:
      - .env
    volumes:
      - ./mariadb:/var/lib/mysql:Z
    restart: unless-stopped

  web:
    image: docker.io/dolibarr/dolibarr:latest
    container_name: dolibarr-web
    env_file:
      - .env
    depends_on:
      - mariadb
    ports:
      - "2793:80"
    volumes:
      - ./documents:/var/www/documents:Z
      - ./custom:/var/www/html/custom:Z
    restart: unless-stopped
EOF

3.2.1.10. Start Dolibarr#

Launch the stack:

podman-compose up -d
podman-compose logs

Verify that the containers are up:

podman ps
podman-compose logs

Open your browser and navigate to:

https://erp.example.com

If everything is configured correctly, you should see the Dolibarr web interface over HTTPS.

3.2.1.11. Install custom modules#

Now you can put modules in the ~/dolibarr/custom directory. For the TalerBarr module example, continue with Install from the source repository.