How to Install Dolibarr with Apache on Ubuntu 24.04
Installing Dolibarr with Apache on Ubuntu 24.04 creates an open-source system to manage your business operations like customer info, billing, and stock.
Dolibarr is a flexible program that helps you keep track of important business tasks. It’s built to be expandable with different add-ons.
This guide explains how to set up Dolibarr on the newest Ubuntu 24.04 LTS version, using Apache, a widely used web server software.
You’ll adjust Apache so it can properly show your Dolibarr program, making sure it works well for all your business needs.
Install Apache using `sudo apt install apache2`. Then, install MariaDB with `sudo apt install mariadb-server`. Create a database and user for Dolibarr within MariaDB, and install PHP with `sudo apt install php libapache2-mod-php php-mysql php-intl`.
Install Apache HTTP server on Ubuntu
Install the Apache HTTP server on Ubuntu to get Dolibarr running. Apache is needed to serve your Dolibarr website. Open your terminal and run ‘sudo apt update’ followed by ‘sudo apt install apache2’ to install it.
To do that, open the Ubuntu terminal and run the commands below to install the Apache web server.
sudo apt update
sudo apt install apache2
Once Apache is installed, the commands below can start, stop, and enable the Apache web server to start automatically when your server boots up.
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2
You can test that the Apache web server is running by opening your web browser and browsing to the server’s localhost or IP address.
http://localhost

When you see the Apache2 Default Page, it means the Apache HTTP server is successfully installed.
Additional help on installing Apache on Ubuntu is in the link below.
Install the MariaDB database server on Ubuntu
Install the MariaDB database server on Ubuntu to store Dolibarr’s data. MariaDB is a common database that works well with Dolibarr. Open your terminal and type ‘sudo apt update’ then ‘sudo apt install mariadb-server’ to install it.
To install and use the MariaDB database server, use the instructions below.
Open the Ubuntu terminal and run the commands below to install the MariaDB database server.
sudo apt update sudo apt install mariadb-server
Once the MariaDB database server is installed, use the commands below to stop, start, and enable the MariaDB server to start automatically when the server boots.
sudo systemctl stop mariadb sudo systemctl start mariadb sudo systemctl enable mariadb
Run the following commands to validate and test if the MariaDB database server is installed successfully.
sudo mariadb
Once you run the commands above, it will log you onto the MariaDB console and display a message similar to the one below.
Welcome to the MariaDB monitor. Commands end with ; or g. Your MariaDB connection id is 32 Server version: 10.11.2-MariaDB-1 Ubuntu 23.04 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. MariaDB [(none)]>
The message tells you that the server is installed successfully.
Additional help on installing MariaDB.
- How to install MariaDB on Ubuntu Linux
- MariaDB without password prompt
Create a Dolibarr database
Create a database for Dolibarr to hold all its important information after you’ve installed MariaDB. You’ll set up a database named ‘dolibarrdb’ and a user called ‘dolibarrdbuser’ that has full access to this database. This ensures Dolibarr can store and retrieve its data correctly.
As part of the setup, we will create a dolibarrdb database and a user account called dolibarrdbuser.
The dolibarrdbuser account receives full access to the dolibarrdb database, which is essential for Dolibarr to correctly read and write all its data.
All the database steps above can be done using the commands below:
But first, log on to the MariaDB database server:
sudo mariadb
Then run the commands below to complete the steps:
CREATE DATABASE dolibarrdb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER dolibarrdbuser@localhost IDENTIFIED BY 'type_your_password_here';
GRANT ALL ON dolibarrdb.* TO dolibarrdbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
Install PHP on Ubuntu Linux
Install PHP on Ubuntu Linux because Dolibarr needs it to work. You also need specific PHP modules like ‘php-mysql’ and ‘php-intl’ for Dolibarr to function properly. Run the command ‘sudo apt install php libapache2-mod-php php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common php-mbstring php-xmlrpc php-bcmath php-json php-sqlite3 php-soap php’ to get everything installed.
Then, run the commands below to install the latest PHP version.
sudo apt install php libapache2-mod-php php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common php-mbstring php-xmlrpc php-bcmath php-json php-sqlite3 php-soap php-zip php-ldap php-imap
Additional help on installing PHP
Download Dolibarr files
Download the latest Dolibarr files from the official Dolibarr website. You will then move these downloaded files to your server, usually into the ‘/tmp/’ directory, so you can install them. Always check the download page for the most current version.
To always install the latest version, check the download page for Dolibarr. Get the download link and download the archived package to your computer. Then, extract it.
First, navigate to the /tmp/ directory and download the Dolibarr files. Next, extract the content into the Dolibarr folder in the Apache root directory.
Apache root folder permissions must change for the Dolibarr app to function correctly. Run the commands below to grant the necessary access. This ensures Dolibarr can read and write the files it needs, such as its configuration settings and uploaded documents, without encountering errors.
cd /tmp
wget https://pilotfiber.dl.sourceforge.net/project/dolibarr/Dolibarr%20ERP-CRM/20.0.3/dolibarr-20.0.3.zip
unzip dolibarr-*.zip
sudo mv dolibarr-20.0.3 /var/www/dolibarr
sudo chown -R www-data:www-data /var/www/dolibarr/
Once you have completed all the above steps, continue configuring the Apache web server below to serve the Dolibarr content.
Run the commands below to create an Apache virtual host file for Dolibarr.
sudo nano /etc/apache2/sites-available/dolibarr.conf
Then, copy and paste the content block below into the Apache server block.
<VirtualHost *:80>
ServerName dolibarr.example.com
ServerAlias www.dolibarr.example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/dolibarr/htdocs
<Directory /var/www/dolibarr/htdocs/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Save the file.
To make the Dolibarr website work, you must enable the Apache virtual host for Dolibarr and restart the Apache server. Run these commands in your terminal: `sudo a2ensite dolibarr.conf` and then `sudo systemctl restart apache2`. This ensures Apache reads the new configuration and starts serving your Dolibarr site.
sudo a2ensite dolibarr.conf
sudo a2enmod rewrite
sudo systemctl restart apache2
Setup Let’s Encrypt SSL/TLS for Dolibarr
Set up Let’s Encrypt SSL/TLS for Dolibarr to make your website secure with HTTPS. This uses free certificates to protect the data shared between users and your Dolibarr, making it safer to use. Following these steps ensures your Dolibarr installation is protected.
Please read the post below for additional resources on installing and creating Let’s Encrypt SSL certificates for Apache.
How to set up Let’s Encrypt SSL certificate for Apache on Ubuntu Linux
Once you have restarted the Apache web server, open your browser and browse to the server hostname or IP address defined in the Apache server block.
http://dolibarr.example.com
Dolibarr installation wizard should appear.
Select the installation language and continue.

Next, type in the database name, account name, and password.

Create an admin account and complete the installation.

Dolibarr should be ready to use.

That should do it!

Conclusion:
Installing Dolibarr with Apache on Ubuntu is a straightforward process that enables businesses to leverage an efficient ERP and CRM solution. Here are the key takeaways:
- Seamless Integration: Dolibarr works flawlessly within the Ubuntu ecosystem, utilizing Apache as a robust web server.
- Easy Setup: The installation involves simple terminal commands for managing Apache, MariaDB, and PHP.
- Configurable Database: Creating a dedicated database for Dolibarr allows for better organization and management of your data.
- Secure Environment: Implementing SSL/TLS ensures that your Dolibarr installation is safe and trustworthy for users.
- User-Friendly Interface: The Dolibarr installation wizard simplifies the setup process, making it accessible for users of all skill levels.
Your Dolibarr installation, completed through the preceding setup steps, now effectively streamlines your business operations by providing features like [insert a specific Dolibarr feature, e.g., invoice generation or customer management].
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
THanks a lot