In this tutorial, we will show you how to install GLPI on Ubuntu 20.04 LTS. For those of you who didn’t know, GLPI is a free, open-source ITSM platform built with PHP designed to help you plan and easily manage your IT operations.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of GLPI on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
Prerequisites
- A server running one of the following operating systems: Ubuntu 20.04, 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install GLPI on Ubuntu 20.04 LTS Focal Fossa
Step 1. First, make sure that all your system packages are up-to-date by running the following apt
commands in the terminal.
sudo apt update sudo apt upgrade
Step 2. Installing the LAMP stack.
A Ubuntu 20.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here.
Step 3. Installing GLPI on Ubuntu 20.04.
Now we download GLPI from the official website:
wget https://github.com/glpi-project/glpi/releases/download/9.5.5/glpi-9.5.5.tgz tar xvf glpi-9.5.5.tgz
Next, move the created glpi
folder to the /var/www/html
directory:
sudo mv glpi /var/www/html/
Now give proper permissions to the GLPI directory:
sudo chown -R www-data:www-data /var/www/html/
Step 4. Configuring MariaDB for GLPI.
By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation
script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:
mysql_secure_installation
Configure it like this:
- Set root password? [Y/n] y - Remove anonymous users? [Y/n] y - Disallow root login remotely? [Y/n] y - Remove test database and access to it? [Y/n] y - Reload privilege tables now? [Y/n] y
Next, we will need to log in to the MariaDB console and create a database for GLPI. Run the following command:
mysql -u root -p
This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for GLPI installation:
MariaDB [(none)]> create database glpidb character set utf8mb4; MariaDB [(none)]> grant all on glpidb.* to 'glpi'@'localhost' identified by 'your-strong-password'; MariaDB [(none)]> flush privileges; MariaDB [(none)]> exit;
Step 5. Configuring Apache for GLPI.
Now we create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘glpi.conf
’ on your virtual server:
sudo nano /etc/apache2/sites-available/glpi.conf
Add the following line:
<VirtualHost *:80> ServerAdmin admin@example.com DocumentRoot /var/www/html/ ServerName your-domain.com ServerAlias www.your-domain.com <Directory /var/www/html/> Options +FollowSymlinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Now, we can restart the Apache webserver so that the changes take place:
sudo a2enmod rewrite sudo a2ensite yourls.conf sudo systemctl restart apache2.service
Step 6. Configure Firewall
In case, you enabled UFW firewall and firewall block requests of the apache web server, open a port in the firewall:
sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw reload
Step 7. Accessing GLPI Web Interface.
GLPI will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://your-domain.com/glpi/install/install.php
and complete the required steps to finish the installation.
Congratulations! You have successfully installed GLPI. Thanks for using this tutorial for installing GLPI on Ubuntu 20.04 LTS Focal Fossa system. For additional help or useful information, we recommend you check the official GLPI website.