Installing Dolibarr with Docker for a small web project

I’m setting up Dolibarr with Docker to manage a small web project and would like to make sure I’m following current best practices before going live.

For those who’ve deployed Dolibarr this way, did you run into any issues with file permissions, database initialization, or upgrades? I’d also appreciate any recommendations for backup strategies or configuration tips that have worked well in production.

If there are any official guides or community resources you’d recommend so I can learn more about maintaining a Docker-based installation, I’d be grateful for the suggestions.

Thanks in advance for your help!

The main gotchas with Docker + Dolibarr: map persistent volumes for both /var/www/documents (file uploads and generated documents) and your database data directory — lose either and you lose data. The official image is dolibarr/dolibarr on Docker Hub; pair it with a MariaDB container via docker-compose. File permissions are usually fine if your volumes are writable by www-data (UID 33 on Debian-based images).

For upgrades, the image supports a DOLI_VERSION env var that triggers the upgrade wizard automatically on container restart — read the image docs carefully before doing this in production, and always back up first. For backups, mysqldump the database and snapshot the documents volume; you need both together to restore cleanly.

— Ali — Dolibarr AI Consultant / SiliconBlaze.com

hey @kaileyketchum

I’ve used Dolibarr running in a Podman pod with some containers for 3 years.

I only export 2 ports, port 80 for dolibarr, and then also port 8036 for phpmyadmin, though I only ever start phpmyadmin when I need it, else it is a dormant or perhaps even non existing container.

I use mariadb latest, and it runs in it’s own container, and it is hidden inside the pod.

Dolibarr is also a container, running inside the pod.

Both dolibarr and mariadb uses persistent volumes.

Upgrading to a new Dolibarr version is simple. Just stop and remove the old version Dolibarr and leave the mariadb running. Then start a new dolibarr container with almost the same setup, only the version is different. Then you follow the instructions on the website - BUT - be careful, at this point your dolibarr upgrade process is not protected - anyone can view it.

What you could do here is define your pod with a second port, like 8080 which is for a dolibarr container only used for upgrading, and this port has extra protection such that only you can access the upgrade process. After the upgrade, just stop the upgrade dolibarr, and start the production dolibarr container. NOTE they should use the same version!

Use a 3. dolibarr container of the same version as the scheduler container.

The good thing about a podman pod setup is that all network traffic to localhost stays inside the pod, so Dolibarr talks to mariadb running at localhost, and mariadb is never exposted outside.

I regularly dump the mariadb database and store the dump off site.

I’ve got a dolibarr_devtainer project on github - I only use it for development, for running in production I start it using ansible, and my pods and containers are systemd services that start when the server starts.