How to Install Dolibarr ERP/CRM Platform on Ubuntu Server 22.04
If your business has grown to the point of needing help with planning and organizing details like contacts, suppliers, invoices, purchase orders, inventory, and schedules, you need ERP Tools. You can switch to a third-party platform, or you can deploy an in-house solution to your data center or third-party cloud hosting.
Follow this step-by-step process to install the Dolibarr ERP/CRM solution, which is perfect for organizations of all sizes as well as for freelancers.
What you need to install Dolibarr
I will demonstrate the implementation on Ubuntu Server 22.04, but Dolibarr can be installed on any Linux distribution. If you are using a non-Ubuntu server distribution, you will need to modify some installation commands. You will also need a user with sudo privileges.
UNDERSTAND: 9 must-do tips to secure Ubuntu Server (TechRepublic Premium)
How to install dependencies
The first thing we will do is install the necessary dependencies, starting with the web server and database.
Log in to your Ubuntu Server instance and install the Apache web server with the command:sudo apt-get install apache2 -y
Once the installation is complete, start and activate the server with:
sudo systemctl enable --now apache2
Enable the rewrite module with:
sudo a2enmod rewrite
Next, install the required PHP dependencies with:
sudo apt-get install php php-cli php-mysql php-common php-zip php-mbstring php-xmlrpc php-curl php-soap php-gd php-xml php-intl php-ldap libapache2-mod-php -y
Once PHP is installed, you will need a quick configuration. Open the PHP configuration file with the command:
sudo nano /etc/php/*/apache2/php.ini
In that file, find the following and change them to the values shown, where TIMEZONE is your specific time zone:
- date.timezone = TIMEZONE
- memory_limit = 256 million
- upload_max_filesize = 64 million
- display_errors = On
- log_errors = Off
We will install the MariaDB database using the command:
sudo apt-get install mariadb-server mariadb-client -y
Once the installation is complete, you need to secure the MariaDB database server with the command:
sudo mysql_secure_installation
Make sure to set a strong/unique password for the admin user.
How to create a database
Log in to the database console with:
sudo mysql -u root -p
Create the Dolibarr database and user using the following commands, where PASSWORD is the strong/unique password:
CREATE USER 'dolibarr'@'localhost' IDENTIFIED BY 'PASSWORD';
CREATE DATABASE dolibarr;
GRANT ALL PRIVILEGES ON dolibarr.* TO 'dolibarr'@'localhost';
FLUSH PRIVILEGES;
exit
How to configure Apache
Let’s create an Apache virtual host file with:
sudo nano /etc/apache2/sites-enabled/dolibarr.conf
In that file, paste the following:
<VirtualHost *:80> ServerAdmin [email protected] ServerName erp.example.com ServerAlias www.erp.example.com DocumentRoot /var/www/html//dolibarr/htdocs/ Directory /srv/dolibarr/htdocs> Options +FollowSymlinks AllowOverride All Require all granted </Directory> ErrorLog /var/log/apache2/dolibarr_error.log CustomLog /var/log/apache2/dolibarr_access.log combined </VirtualHost>
Save and close the file. Restart Apache with:
sudo systemctl restart apache2
How to download and extract Dolibarr
We will set a variable to the latest version available for Dolibarr with the command:
release_tag=$(curl -s https://api.github.com/repos/Dolibarr/dolibarr/releases/latest | grep tag_name | cut -d '"' -f 4)
Now we can use release_tag to make sure we’re loading and using the latest version. Download Dolibarr with:
wget https://github.com/Dolibarr/dolibarr/archive/${release_tag}.tar.gz
Extract Dolibarr with:
sudo mv dolibarr-${release_tag} /var/www/html/dolibarr
Give the new directory the appropriate permissions with:
sudo chown -R /var/www/html/dolibarr
How to complete the installation
Open a web browser and point it to http://SERVER/dolibarr/htdocs where SERVER is the host’s IP address and you will be greeted by the Dolibarr web installer (Picture A).
Picture A
Click Next and then, in the resulting window, click Start (Figure BUG).
Figure BUT
On the configuration page (SIZE), you need to configure the database options. In our installation, the database name is dolibarr, the user is dolibarr and the password is what you set in the MariaDB console. You’ll also want to scroll to the bottom of that page, create a premium user account, and then click Next Step.
SIZE
When prompted, click Next Step again to launch the installation. This step will take a while to complete, as it has to populate the database and save the configuration options you selected. Once this process is over, you can log in to Dolibarr with your superuser account and start using your new ERP/CRM solutions.
Before you complete the installation of Dolibarr, be sure to add an installation lock file to prevent anyone from maliciously using the installation tool. To do that, issue the command:
sudo touch /var/www/html/dolibarr/documents/install.lock
Congratulations on taking your business to the next level of efficiency.
Subscribe to TechRepublic’s How to make technology work on YouTube for all the latest tech advice for business professionals from Jack Wallen.