Table of Contents
-
Introduction
-
Why Choose a VPS for Dolibarr
-
Choosing the Right VPS Provider and Specifications
-
Preparing Your VPS Environment
-
Installing the LAMP/LEMP Stack
-
Creating a Database for Dolibarr
-
Downloading and Deploying Dolibarr
-
Configuring Apache or NGINX for Dolibarr
-
Securing Your Server and Dolibarr Installation
-
Setting File and Folder Permissions
-
Running the Dolibarr Web Installer
-
Post-Installation Optimization
-
Setting Up Backups and Maintenance Routines
-
Adding HTTPS and Securing with SSL
-
Scaling and Monitoring
-
Conclusion
-
Resources and Tools
1. Introduction
Dolibarr ERP & CRM is a popular open-source solution for managing business processes including invoicing, inventory, CRM, HR, and more. While it can be installed on shared hosting, deploying Dolibarr on a VPS (Virtual Private Server) is the preferred method for businesses that demand better performance, full control, and security.
This article provides a detailed, step-by-step guide on how to deploy Dolibarr on a VPS from scratch. Whether you're a developer, system administrator, or a business owner with some technical background, this guide will walk you through everything from setting up your server to running a secure, production-ready Dolibarr instance.
2. Why Choose a VPS for Dolibarr
Choosing a VPS over shared hosting offers many benefits:
-
Full Control: Root access means you can configure services exactly as needed.
-
Better Performance: Dedicated resources (CPU, RAM) ensure stable operations.
-
Security: You control firewall rules, updates, and access levels.
-
Scalability: Upgrade your VPS as your Dolibarr usage grows.
-
Custom Configurations: Use specific PHP modules, database settings, or custom cron jobs.
A VPS is ideal for production environments where Dolibarr needs to perform reliably under real business conditions.
3. Choosing the Right VPS Provider and Specifications
Before starting, choose a reliable VPS provider. Recommended providers include:
-
DigitalOcean
-
Hetzner
-
Linode
-
OVH
-
Vultr
-
AWS Lightsail
3.1 Recommended Specifications for Dolibarr
Business Size | RAM | CPU Cores | Disk (SSD) | OS |
---|---|---|---|---|
Freelancers/SMBs | 2 GB | 1-2 cores | 20–40 GB | Ubuntu 22.04 LTS |
Medium Businesses | 4 GB | 2–4 cores | 50–80 GB | Ubuntu 22.04 LTS |
Growing Enterprises | 8+ GB | 4+ cores | 100+ GB | Ubuntu 22.04 LTS |
Choose an OS version with long-term support (LTS) for security and stability.
4. Preparing Your VPS Environment
After spinning up your VPS, connect to it via SSH:
Update your packages:
Install essential packages:
Create a new non-root user:
Then, re-login using this user for safer administration.
5. Installing the LAMP or LEMP Stack
Dolibarr runs on PHP, MySQL/MariaDB, and either Apache (LAMP) or NGINX (LEMP).
5.1 Using Apache (LAMP Stack)
Install Apache:
Install PHP (recommended version: 8.1+):
Install MySQL/MariaDB:
Secure your installation:
Enable Apache modules and restart:
5.2 Using NGINX (LEMP Stack)
For users who prefer NGINX:
Then configure NGINX with PHP-FPM for Dolibarr (covered later).
6. Creating a Database for Dolibarr
Log into MySQL:
Create a database and user:
7. Downloading and Deploying Dolibarr
Navigate to your web root (for Apache):
Download the latest Dolibarr release:
Ensure proper permissions:
Replace x.y.z
with the latest stable version.
8. Configuring Apache or NGINX for Dolibarr
8.1 Apache Virtual Host
Create a new virtual host file:
Paste:
Enable the site:
8.2 NGINX Configuration
For NGINX, create:
Example config:
Enable and reload:
9. Securing Your Server and Dolibarr Installation
9.1 Set UFW Firewall
Allow only essential ports:
9.2 Change PHP Settings
Edit /etc/php/8.1/apache2/php.ini
and tweak:
-
upload_max_filesize = 32M
-
post_max_size = 64M
-
max_execution_time = 120
Restart Apache:
10. Setting File and Folder Permissions
Set proper ownership and permissions:
Lock down the /documents
folder after installation: