Skip to main content

Install Dolibarr via apt (.deb package)

This guide explains how to install Dolibarr ERP/CRM on an Ubuntu or Debian server using apt and the official .deb package (DoliDeb). This method lets apt automatically resolve the dependencies (Apache, MySQL/MariaDB, PHP) and provides a setup wizard during installation.

Dolibarr is no longer in the standard repositories

Since Ubuntu 18.04, the dolibarr package is no longer shipped in the official Ubuntu/Debian repositories. Running apt install dolibarr will therefore return a "package not found" error on recent versions. The recommended method today is to fetch the official .deb package published by the Dolibarr project and install it with apt, which handles the dependencies.

Order a Server

To host your Dolibarr instance, HostMyServers offers several suitable options:

Prerequisites

  • SSH access as root or user with sudo
  • Ubuntu 24.04 LTS or Debian 12 64-bit system
  • x64 processor
  • Minimum 1 GB RAM (2 GB recommended for Dolibarr + database)
  • About 5 GB free disk space (SSD recommended)
  • Port 80 (and 443 for HTTPS) accessible

Required Configuration

ComponentMinimumRecommended
RAM1 GB2-4 GB
CPU1 core2 cores
Storage5 GB SSD20 GB SSD
Network100 Mbps1 Gbps
Software stack

Dolibarr relies on a LAMP stack: a web server (Apache recommended), a database (MySQL / MariaDB) and PHP. The .deb package installs and configures these components for you via apt.

Connect to the Server

Make sure you are connected to your server before starting. Depending on your environment:

Connect with username and IP (default port)

If the server uses the standard SSH port (22):

ssh user@server_ip_address
  • user: server login name
  • server_ip_address: IP address assigned to your server

Connect with a custom port

If the server uses a different SSH port than 22:

ssh -p port_number user@server_ip_address

Connect with a PEM key

If PEM key authentication is required:

ssh -i /path/to/your/key.pem user@server_ip_address

Choose the method that matches your setup. Once connected, you can continue the installation.

System Update

Update your server before installing Dolibarr:

sudo apt-get update
sudo apt-get upgrade -y

Download the Official .deb Package

Fetch the Debian/Ubuntu package from the official Dolibarr repository. At the time of writing, the latest stable version is Dolibarr 23.0.3.

cd /tmp
wget https://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_23.0.3-4_all.deb
Check the latest version

Browse the stable package index to find the most recent version and adjust the filename in the commands.

Install via apt

Install the package with apt install, prefixing the path with ./. Unlike dpkg -i, apt automatically resolves and installs the dependencies (Apache, MariaDB/MySQL, PHP and extensions):

sudo apt install ./dolibarr_23.0.3-4_all.deb
Path required

The ./ prefix (or an absolute path such as /tmp/dolibarr_23.0.3-4_all.deb) is mandatory: without it, apt looks for a package named "dolibarr" in the repositories and fails.

Setup Wizard

During installation, a debconf wizard appears and asks several questions. Use the arrow keys, the space bar to tick options and Tab/Enter to confirm.

QuestionRecommended answer
Web server to reconfigure automaticallyTick apache2
Configure database with dbconfig-common?Yes
Database administrative user password (MySQL/MariaDB root)Enter / confirm a strong password
Application password for the dolibarr databaseEnter a password dedicated to Dolibarr
Note your passwords

Keep the database root password and the dolibarr database application password safe: you will need them for maintenance or troubleshooting.

If the installation stops on a missing dependency, fix it then restart the configuration:

sudo apt-get install -f -y
sudo dpkg-reconfigure dolibarr

Access the Web Interface

Once the installation is complete, open a browser and go to:

http://server_ip_or_domain/dolibarr/

On first access, Dolibarr launches a browser-based installation wizard:

  1. Environment check (PHP, extensions, write permissions)
  2. Database connection settings (pre-filled by dbconfig-common)
  3. Creation of the Dolibarr administrator account (login and password)
  4. End of installation and access to the dashboard
Lock the installation

At the end of the wizard, Dolibarr creates an install.lock lock file to prevent it from running again. Check that it exists to secure access:

ls -l /var/lib/dolibarr/documents/install.lock

Firewall Configuration

If UFW is active, open the web ports:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw reload

Secure Access with HTTPS

In production, protect access to Dolibarr with an SSL certificate. The simplest method under Apache is Certbot / Let's Encrypt:

sudo apt-get install -y certbot python3-certbot-apache
sudo certbot --apache -d your-domain.com

Certbot automatically configures the Apache virtual host and the HTTP → HTTPS redirection.

Domain name

A Let's Encrypt certificate requires a domain name pointing to your server's IP. See our guide to create an A record pointing to your server's IP.

Useful Commands

CommandDescription
sudo systemctl restart apache2Restart the web server
sudo systemctl status apache2Apache status
sudo systemctl status mariadbDatabase status
sudo dpkg-reconfigure dolibarrRestart the setup wizard
sudo tail -f /var/log/apache2/error.logFollow Apache/PHP errors

File Structure

PathDescription
/usr/share/dolibarr/htdocs/Application source code
/etc/dolibarr/conf.phpMain configuration file
/etc/dolibarr/install.forced.phpSettings forced during installation
/var/lib/dolibarr/documents/Documents, generated PDFs, backups and the install.lock file
/var/log/apache2/error.logWeb server error log

Updating Dolibarr

To move to a newer version, download the new .deb package then install it over the existing one — apt handles the migration:

cd /tmp
wget https://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_NEW_VERSION_all.deb
sudo apt install ./dolibarr_NEW_VERSION_all.deb

On the first login after an update, Dolibarr may ask you to run a database migration wizard. Follow the suggested steps.

Back up before updating

Back up your database and the /var/lib/dolibarr/documents/ folder before any update:

sudo mysqldump -u root -p dolibarr > /root/dolibarr_backup.sql
sudo tar czf /root/dolibarr_documents.tar.gz /var/lib/dolibarr/documents

Troubleshooting

"Package not found" when running apt install dolibarr

  • The package no longer exists in the repositories: use the official .deb file as described above.
  • Make sure you prefix the name with ./ or an absolute path.

Dependency errors during installation

  • Fix the dependencies: sudo apt-get install -f -y
  • Then restart the configuration: sudo dpkg-reconfigure dolibarr

Cannot access /dolibarr/

  • Check that Apache is running: sudo systemctl status apache2
  • Check that the PHP module is active: sudo apachectl -M | grep php
  • Consult the log: sudo tail -f /var/log/apache2/error.log

Database connection error

  • Check that MariaDB/MySQL is running: sudo systemctl status mariadb
  • Verify the credentials in /etc/dolibarr/conf.php
  • Test the connection: mysql -u root -p -e "SHOW DATABASES;"

The installation wizard no longer appears

  • If the install.lock file exists, the wizard is locked (normal behavior). To deliberately run it again: sudo rm /var/lib/dolibarr/documents/install.lock (only remove it knowingly).

References