How to Install Dolibarr on Ubuntu Server Latest

Dolibarr is a free and open-source CRM and ERP system that can help you manage your business operations. In this tutorial, we will be installing Dolibarr onto an Ubuntu Server.

Prerequisites

Before we begin, you will need the following:

  • An Ubuntu Server with a non-root user with sudo privileges.
  • PHP, Apache, and MySQL/MariaDB installed on the server.

Step 1: Download Dolibarr

Visit the Dolibarr website and obtain the latest version of Dolibarr.

wget https://github.com/Dolibarr/dolibarr/archive/develop.zip

Step 2: Extract Dolibarr files

Once the files are downloaded, extract them to the /var/www/ directory.

sudo unzip develop.zip -d /var/www/

Change the ownership of the Dolibarr files to www-data, the user which Apache runs as:

sudo chown -R www-data:www-data /var/www/*/

Step 3: Create Dolibarr Database and User

To create a database for Dolibarr, open the MySQL shell:

sudo mysql -u root -p

Create a database for Dolibarr:

CREATE DATABASE dolibarr;

Create a user with privileges to the dolibarr database:

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

Exit the MySQL shell:

exit

Step 4: Configure Apache

Create a virtual host for Dolibarr by creating a new Apache configuration file:

sudo nano /etc/apache2/sites-available/dolibarr.conf

Add the following content to the configuration file:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/dolibarr-develop/htdocs
     ServerName example.com
     ServerAlias www.example.com
    
     <Directory /var/www/dolibarr-develop/htdocs>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
     </Directory>
 
     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
 
</VirtualHost>

Save and exit the file.

Disable the default site and enable the Dolibarr site:

sudo a2dissite 000-default
sudo a2ensite dolibarr.conf

Restart Apache:

sudo systemctl restart apache2

Step 5: Configure Dolibarr

Open the Dolibarr configuration file in a text editor:

sudo nano /var/www/dolibarr-develop/htdocs/conf/conf.php

Update the lines below with the details for your MySQL/MariaDB database:

$conf->dbhost = "localhost";
$conf->dbuser = "dolibarruser";
$conf->dbpassword = "dolibarrpassword";
$conf->dbport = 3306;
$conf->dbtype = 'mysqli';
$conf->dbdefault = 'dolibarr';

Save and exit the file.

Step 6: Run Dolibarr Installation

In your web browser, navigate to your server's IP address or domain name. You should see the Dolibarr installation page.

Select your language and follow the prompts to install Dolibarr.

Step 7: Secure your Installation

It is important to keep your Dolibarr installation secure. Consider the following measures:

  • Enable HTTPS to encrypt your traffic.
  • Keep your installation up to date with security patches.
  • Use strong passwords and limit access to your Dolibarr installation to those who need it.
  • Set up backups to protect against data loss.

That's it. You have now installed Dolibarr on Ubuntu Server.