Log inSign up

Dolibarr for invoices, contacts and stock on your VPS

Install Nginx, PHP-FPM with the needed extensions and MariaDB, unpack the latest Dolibarr release into /var/www/dolibarr, and point Nginx at its htdocs folder. Run the browser installer at /install/, then create install.lock in the documents directory and request a certificate with Certbot. Dolibarr is a classic PHP application, so it runs well even on a 1 or 2 GB plan.

Topic: Self-hosted apps · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

Why install Dolibarr from the release archive?

The release archive is the format the Dolibarr project documents for Linux servers, and it gives you the current version regardless of what the distribution ships. The Debian and Ubuntu repositories carry an old or missing dolibarr package, so the archive is the cleaner path.

Requirements are modest: a web server, PHP 8.x with a handful of extensions, and MariaDB or MySQL. Ubuntu 24.04 ships PHP 8.3, Debian 12 ships 8.2 and Debian 13 ships 8.4; check the Dolibarr release notes for the PHP range of the version you install. You also need a hostname such as crm.example.net pointing at 198.51.100.24 and 2001:db8:4f2a::24 (DNS records).

How do you install the web stack?

One apt command brings in Nginx, PHP-FPM, the PHP modules Dolibarr checks for, and MariaDB.

sudo apt update
sudo apt install -y nginx mariadb-server php-fpm php-mysql php-gd php-curl php-intl php-mbstring php-xml php-zip php-soap unzip curl
php -v
mariadb --version
ls /run/php/

The last command shows the FPM socket; Debian and Ubuntu also provide a version-neutral /run/php/php-fpm.sock link, which the Nginx block below uses. Raise the upload size so attachments and logos fit, using the PHP version you just saw:

PHPV=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')
sudo sed -i 's/^upload_max_filesize.*/upload_max_filesize = 32M/; s/^post_max_size.*/post_max_size = 32M/' /etc/php/$PHPV/fpm/php.ini
sudo systemctl restart php$PHPV-fpm

How do you create the database?

Give Dolibarr its own database and user with rights on that database only. Run sudo mariadb and enter:

CREATE DATABASE dolibarr CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'dolibarr'@'localhost' IDENTIFIED BY 'choose-a-strong-password';
GRANT ALL PRIVILEGES ON dolibarr.* TO 'dolibarr'@'localhost';
FLUSH PRIVILEGES;
EXIT;

MariaDB on these systems listens on 127.0.0.1 only, so the database is not exposed. The MariaDB guide covers tuning and the secure installation script.

How do you download and place the Dolibarr files?

Ask the GitHub API for the newest release tag, download that archive, and keep uploaded documents in a separate folder outside the web root.

VER=$(curl -s https://api.github.com/repos/Dolibarr/dolibarr/releases/latest | grep -oP '"tag_name": "\K[^"]+')
echo $VER
cd /tmp
curl -fsSLo dolibarr.tar.gz https://github.com/Dolibarr/dolibarr/archive/refs/tags/$VER.tar.gz
sudo mkdir -p /var/www/dolibarr /var/lib/dolibarr/documents
sudo tar xzf dolibarr.tar.gz -C /var/www/dolibarr --strip-components=1
sudo touch /var/www/dolibarr/htdocs/conf/conf.php
sudo chown -R www-data:www-data /var/www/dolibarr /var/lib/dolibarr

The empty conf.php is where the installer writes the database settings, so it has to exist and be writable at first.

What does the Nginx server block look like?

The document root is htdocs, and PHP files go to PHP-FPM through the stock snippet. Create /etc/nginx/sites-available/dolibarr:

server {
    listen 80;
    listen [::]:80;
    server_name crm.example.net;
    root /var/www/dolibarr/htdocs;
    index index.php;
    client_max_body_size 32M;
    location / {
        try_files $uri $uri/ /index.php?$args;
    }
    location ~ [^/]\.php(/|$) {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php-fpm.sock;
    }
    location ~ /\.(?!well-known) {
        deny all;
    }
}
sudo ln -s /etc/nginx/sites-available/dolibarr /etc/nginx/sites-enabled/
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t && sudo systemctl reload nginx
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d crm.example.net
sudo ufw allow OpenSSH && sudo ufw allow 'Nginx Full' && sudo ufw enable

Getting the certificate before the installer runs means the admin password never crosses the network in plain text. Renewal details are in the Certbot guide.

How do you finish the installer and lock it?

Browse to https://crm.example.net/install/ and follow the pages: language, prerequisite check, then the configuration form. Enter /var/lib/dolibarr/documents as the documents directory, https://crm.example.net as the URL, MariaDB on localhost with the database and user from earlier, and do not tick "create database" because it already exists. The last step creates the administrator login. Afterwards, block the installer and make the config read-only:

sudo -u www-data touch /var/lib/dolibarr/documents/install.lock
sudo chmod 400 /var/www/dolibarr/htdocs/conf/conf.php
curl -sI https://crm.example.net/ | head -n 1

Sign in, open Home, Setup, Modules/Applications and switch on what you use: Third parties, Commercial proposals, Invoices, Products, Stock, Projects and so on. Then fill in company details under Setup, Company/Organization.

How do you configure email and scheduled jobs?

Under Setup, Emails, choose the SMTP/SMTPS method, enter your relay host, port 587, enable TLS (STARTTLS), and add the username and password. A relay gives reliable delivery; port 25 for direct sending may be closed, so ask support in a ticket before counting on it, and see SMTP relay for apps for SPF and DKIM records. Send a test from the same page.

Dolibarr's Scheduled jobs module runs reminders and recurring invoices. Enable it, copy the security key it shows, and add a cron entry for www-data:

sudo crontab -u www-data -e
*/5 * * * * php /var/www/dolibarr/scripts/cron/cron_run_jobs.php YOUR_SECURITY_KEY admin > /dev/null 2>&1

Replace admin with the login that should run the jobs. The cron guide explains the timing syntax.

How do you back up and upgrade Dolibarr?

A full backup is a database dump plus the documents folder:

sudo mariadb-dump dolibarr | gzip > /var/backups/dolibarr-$(date +%F).sql.gz
sudo tar czf /var/backups/dolibarr-docs-$(date +%F).tgz -C /var/lib/dolibarr documents

To upgrade, unpack the new release over /var/www/dolibarr (your conf.php is not in the archive, so it survives), remove install.lock, open /install/ and choose the upgrade link for your version step, then create the lock file again. Skip no major versions: go 20 to 21 to 22 one at a time. Pair this with server-level daily backups.

What should you check when something breaks?

  • Blank page or error 500: read sudo tail -n 50 /var/log/nginx/error.log and the PHP-FPM log; a missing extension is the usual reason.
  • "Directory not writable" during install: re-run the chown for /var/lib/dolibarr.
  • Installer keeps reappearing: install.lock is missing or in the wrong folder; it belongs in the documents directory.
  • PDF generation fails: check that php-gd is installed and that the documents folder has space (disk usage).

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A1-2a small office1 vCPU, 2 GB RAM, 50 GB NVMe$7.20/mo$43.20 for 6 months
A2-4more users and stock modules2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months

Questions about Dolibarr ERP and CRM with Nginx

Can Dolibarr run on Apache instead of Nginx?

Yes. Point an Apache virtual host at /var/www/dolibarr/htdocs with PHP-FPM or mod_php; the installer and the rest of this guide are the same.

Is there a Docker image for Dolibarr?

Yes, the project publishes dolibarr/dolibarr on Docker Hub. Pair it with a MariaDB container and put Nginx or Caddy in front for HTTPS.

How small can the server be?

A team of a few people is fine on 1 vCPU and 2 GB of memory, since Dolibarr is plain PHP with no background services beyond cron.

Can customers log in to see their invoices?

Dolibarr has portal modules for that, including a public portal for third parties. Enable and configure them under Modules.

Where are uploaded files stored?

In the documents directory you gave the installer, here /var/lib/dolibarr/documents, grouped by module.