Independent testing Updated April 2026 387 self-hosting guides 5 VPS providers tested

guide

How to Self-Host Dolibarr on a VPS (Complete Guide)

A complete guide to self-hosting Dolibarr on a VPS: install, configure, and secure Dolibarr step by step, with recommended specs and common gotchas.

How to Self-Host Dolibarr on a VPS (Complete Guide)

Dolibarr is an open-source ERP and CRM suite that simplifies business management for small to mid-sized enterprises. Self-hosting it on a VPS ensures you have full control over your data, improves privacy, and can often result in cost savings over time. This guide will walk you through the steps required to self-host Dolibarr on a VPS.

Why Choose a VPS for Dolibarr?

Using a VPS allows for better performance and customization compared to shared hosting. It also provides the freedom to install necessary software, configure security settings, and scale resources according to your needs.

VPS Provider Comparison

When selecting a VPS for hosting Dolibarr, consider the following options:

ProviderMonthly Price (EUR/USD)CPURAMStorage
Contabo VPS5.99 EUR14GB200GB
Hetzner Cloud4.15 EUR12GB20GB
DigitalOcean6 USD11GB25GB
Vultr6 USD11GB25GB
Linode (Akamai Cloud)5 USD11GB25GB

All options are suitable for hosting Dolibarr, but for better performance, Contabo VPS is recommended due to its larger RAM and storage capacity. Check out our full VPS comparison for more details.

Prerequisites

Before proceeding with the installation, ensure that you have:

  1. A VPS set up with SSH access.
  2. A domain name pointed to your VPS (optional but recommended).
  3. A basic understanding of Linux commands.

Step 1: Setting Up Your VPS

  1. Connect to Your VPS: Use SSH to access your VPS terminal:

    ssh root@your_vps_ip
  2. Update your system: This ensures all packages are up to date.

    apt-get update && apt-get upgrade -y

Step 2: Install Required Packages

Install Apache, MySQL, and PHP. Dolibarr requires these services to function properly.

apt-get install apache2 mysql-server php php-mysql libapache2-mod-php -y

Step 3: Download Dolibarr

Navigate to the directory where you want to install Dolibarr:

cd /var/www/html

Download the latest version of Dolibarr:

wget https://sourceforge.net/projects/dolibarr/files/latest/download -O dolibarr.zip

Unzip the downloaded file:

unzip dolibarr.zip

Step 4: Configure MySQL Database

  1. Log into MySQL:

    mysql -u root -p
  2. Create a database for Dolibarr:

    CREATE DATABASE dolibarr;
    CREATE USER 'dolibarruser'@'localhost' IDENTIFIED BY 'your_password';
    GRANT ALL PRIVILEGES ON dolibarr.* TO 'dolibarruser'@'localhost';
    FLUSH PRIVILEGES;
    EXIT;

Step 5: Configure Apache

  1. Create an Apache configuration file for Dolibarr:

    nano /etc/apache2/sites-available/dolibarr.conf
  2. Add the following configuration:

    <VirtualHost *:80>
        DocumentRoot /var/www/html/dolibarr/htdocs
        ServerName your_domain.com
    
        <Directory /var/www/html/dolibarr/htdocs>
            AllowOverride All
        </Directory>
    </VirtualHost>
  3. Enable the new site and rewrite module:

    a2ensite dolibarr.conf
    a2enmod rewrite
    systemctl restart apache2

Step 6: Complete the Installation

Open your web browser and navigate to http://your_domain.com/install. Follow the web-based installer instructions. Use the database credentials you set up earlier.

Step 7: Secure Your Installation

Once installed, take the following precautions:

  1. Remove the installation folder:

    rm -rf /var/www/html/dolibarr/htdocs/install
  2. Set file permissions:

    chown -R www-data:www-data /var/www/html/dolibarr/htdocs
  3. Secure MySQL:

    Run mysql_secure_installation to remove test users and databases.

Step 8: Optional - Docker Installation

If you prefer using Docker for self-hosting Dolibarr, you can follow these steps:

  1. Install Docker:

    apt-get install docker.io docker-compose -y
  2. Create a docker-compose.yml:

    version: '3'
    
    services:
      db:
        image: mysql:5.7
        environment:
          MYSQL_DATABASE: dolibarr
          MYSQL_USER: dolibarruser
          MYSQL_PASSWORD: your_password
          MYSQL_ROOT_PASSWORD: root_password
    
      dolibarr:
        image: dolibarr/dolibarr
        environment:
          - DB_HOST=db
          - DB_USER=dolibarruser
          - DB_PASS=your_password
        ports:
          - "80:80"
  3. Run Dolibarr:

    docker-compose up -d

Congratulations! You now have Dolibarr self-hosted on your VPS.

FAQs

1. Is self-hosting Dolibarr safe?

Self-hosting Dolibarr provides enhanced data control and privacy. However, you need to take steps to secure your server, including setting up firewalls, using secure passwords, and regularly updating software. Also, consider implementing SSL for your web server to encrypt the data transmitted.

2. Can I install Dolibarr on a low-spec VPS?

Yes, Dolibarr can run on low-spec VPS, but performance may be affected as user load increases. For minimal installations, options like Hetzner Cloud ($4.15 EUR/mo) can be sufficient for testing. If you expect high usage, opt for a provider like Contabo VPS ($5.99 EUR/mo) for better performance.

3. What are the benefits of using Docker for self-hosting Dolibarr?

Using Docker simplifies the setup and management of Dolibarr, allowing you to run it in isolated containers. This can make it easier to manage dependencies and updates. Additionally, Docker can simplify scaling and migrating your application.

By following this guide, you can successfully self-host Dolibarr on a VPS and manage your business effectively. For more resources, check out r/selfhosted and the awesome-selfhosted list for additional tools and applications.