GLPI is an open-source IT asset and Helpdesk management solution written in PHP. It’s a complete solution IT management software for your organization. GLPI helps you manage incidents/requests, create forms, and define SLAs. It also helps you manage your hardware, software, and data center solution, which also allows you to link asset inventory and get control of your IT and business infrastructure.

Not only that but GLPI also can be used as financial management for tracking your expenses, contracts, and suppliers, creating new inventory objects, managing user databases, and generating reports. Furthermore, GLPI includes project management for task assignments, adding collaborators, setting up timelines and reminders, and also provides a Kanban board for easier task management.

In this guide, I’ll show you how to install GLPI IT Management Software on a Debian 12 machine. You will install GLPI alongside the LAMP Stack (Apache2, MariaDB, and PHP). Furthermore, you will also secure GLPI via SSL/TLS certificates from Letsencrypt.

Prerequisites

To get started, ensure that you have:

  • A Debian 12 server.
  • A non-root user with sudo administrator privileges.
  • A domain name pointed to the server IP address.

Installing Dependencies

GLPI is an open-source IT management software written in PHP with MySQL/MariaDB as the database. It can be run with Apache2 or Nginx web server. In this guide, you will install GLPI with the LAMP Stack (Apache2, MariaDB, and PHP), complete the following steps to install LAMP Stack, and some additional dependencies for your GLPI installation.

First, update and refresh your Debian package index by executing the apt update command below.

sudo apt update

<img alt="update repository" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/1-update-repo.png65030fde879e2.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="237" loading="lazy" src="data:image/svg xml,” width=”750″>

Once the repository is updated, enter the following command to install package dependencies for GLPI installation, including the LAMP Stack (Apache2, MariaDB, and PHP) packages and some additional PHP extensions.

sudo apt install apache2 mariadb-server php php-common php-mysql libapache2-mod-php php-gd php-curl php-json php-xmlrpc php-intl php-bcmath php-zip php-apcu php-mbstring php-fileinfo php-xml php-soap php-zip

Type y to confirm and proceed with the installation.

<img alt="install dependnecies" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/2-install-dependencies.png65030fdec1957.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="135" loading="lazy" src="data:image/svg xml,” width=”750″>

After the dependencies are installed, verify each dependencies by executing the following command.

Verify the apache2 service to ensure that the service is running and enabled.

sudo systemctl is-enabled apache2

sudo systemctl status apache2

The output enabled confirms that the Apache2 service is enabled. The active (running) output confirms that Apache2 is running.

<img alt="verify apache2" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/3-verify-apache2.png65030fdef324f.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="234" loading="lazy" src="data:image/svg xml,” width=”750″>

Verify the mariadb service using the command below.

sudo systemctl is-enabled mariadb

sudo systemctl status mariadb

The output should be similar to the following:

<img alt="check mariadb" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/4-checking-mariadb.png65030fdf296a2.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="234" loading="lazy" src="data:image/svg xml,” width=”750″>

Lastly, verify the PHP version and list of enabled extensions using the command below.

php -v

php -m

You should see that PHP 8.2 is installed with some extensions such as fileinfo, gd, intl, mysqli, and zlib enabled.

<img alt="check php" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/5-check-php.png65030fdf670e9.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="460" loading="lazy" src="data:image/svg xml,” width=”603″>

Configuring MariaDB Server

After installing LAMP Stack packages, next you will configure your MariaDB server by securing it via the mariadb-secure-installation utility. Then, you will also create a new MariaDB database and user that GLPI will use.

Execute the mariadb-secure-installation utility on your terminal to secure your MariaDB server installation.

sudo mariadb-secure-installation

Input Y to apply the configuration to your MariaDB server, or n for No, and reject the changes. Below are some related MariaDB configurations you will be asked for:

  • Switch local authentication to unix_socket? Input n for no.
  • Set up MariaDB root password? Input y, then type the new MariaDB root password and repeat.
  • Remove the default anonymous user? Input y to confirm.
  • Disable remote login for the root user? Input y to confirm.
  • Remove the default database test? Input y to confirm.
  • Reload table privileges and apply changes? Input y to confirm.

After securing the MariaDB server, you will create a new database and user that will be used by GLPI. You can create a new database and user via the mariadb client.

Log in to the MariaDB server using the following command, Be sure to input your MariaDB root password when asked.

sudo mariadb -u root -p

Next, execute the following queries to create a new MariaDB database glpidb with user glpi and the password is p4ssw0rd. Be sure to change the following with your info.

CREATE DATABASE glpidb;

CREATE USER glpi@localhost IDENTIFIED BY 'p4ssw0rd';

GRANT ALL PRIVILEGES ON glpidb.* TO glpi@localhost;

FLUSH PRIVILEGES;

<img alt="create new database and user" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/6-create-glpi-db-user.png65030fdf95940.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="245" loading="lazy" src="data:image/svg xml,” width=”694″>

Now run the following query to verify the privileges for user glpi@localhost.

SHOW GRANTS FOR glpi@localhost;

You should see the user glpi@localhost has privileges to access the database glpidb.

<img alt="verify user privileges" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/7-create-user-privileges.png65030fdfc32ce.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="261" loading="lazy" src="data:image/svg xml,” width=”620″>

Type quit to exit from the MariaDB server.

Configuring PHP

In the following section, you will set up your PHP installation by editing the php.ini file. Then, you will verify your Apache2 and PHP installation by creating a new PHPINFO file that will show you detailed information about your PHP installation.

Open the default php.ini configuration using the following nano editor command.

sudo nano /etc/php/8.2/apache2/php.ini

Change some of the following PHP configurations like this. Be sure to adjust the date.timezone with your proper timezone and the memory_limit with your proper memory configuration.

memory_limit = 512M

date.timezone = Europe/Stockholm

upload_max_filesize = 16M

session.cookie_httponly = on

Save and close the file when you’re done.

Next, execute the following systemctl command to restart the Apache2 service and apply the changes that you’ve made.

sudo systemctl restart apache2

Then create a new PHPINFO file /var/www/html/info.php by executing the following command.

echo "" > /var/www/html/info.php

Launch your web browser and visit your server IP address followed by the /info.php path, such as http://192.168.10.15/info.php. If your configuration is successful, you should see the PHPINFO page like the following:

<img alt="phpinfo" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/8-phpinfo.png65030fe035a31.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="612" loading="lazy" src="data:image/svg xml,” width=”750″>

Downloading GLPI Source Code

After configuring PHP, you will download the GLPI source code from GitHub and set up proper permission and ownership of the GLPI web root directory.

Move to the /var/www directory and download the GLPI source code via the wget command below. In this example, you will download GLPI v10.x, which is the latest and stable version of GLPI 10.x. Be sure to check the GLPI download page to get the latest version of it.

cd /var/www/

wget https://github.com/glpi-project/glpi/releases/download/10.0.9/glpi-10.0.9.tgz

Once the GLPI source code is downloaded, extract it using the tar command below, and you should see a new directory /var/www/glpi.

tar -xf glpi-10.0.9.tgz

Now run the following command to change the ownership of the /var/www/glpi directory to user www-data and allow the Apache2 web server to access it.

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

Then, execute the following command to make the directory files and config writable. This will allow the Apache2 web server to write to those directories for storing GLPI data.

sudo chmod u rw /var/www/glpi/{files,config}

Configuring Apache2 Virtual Host

Now that you’ve downloaded the GLPI source code, the next step is to create a new Apache2 virtual host configuration that will be used to run GLPI. Before going further, ensure that you have a domain name pointed to your Debian server IP address.

Before creating the virtual host configuration, execute the following command to enable the rewrite module in Apache2.

sudo a2enmod rewrite

Create a new virtual host configuration /etc/apache2/sites-available/glpi.conf using the following nano editor command.

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

Insert the following configuration and be sure to change the domain name with your domain on the ServerName parameter.



    ServerName glpi.hwdomain.io

    DocumentRoot /var/www/glpi/public

    # If you want to place GLPI in a subfolder of your site (e.g. your virtual host is serving multiple applications),

    # you can use an Alias directive:

    # Alias "https://www.howtoforge.com/glpi" "https://www.howtoforge.com/var/www/glpi/public"

   

        Require all granted

        RewriteEngine On

        # Redirect all requests to the GLPI router, unless file exists.

        RewriteCond %{REQUEST_FILENAME} !-f

        RewriteRule ^(.*)$ index.php [QSA,L]

   

Save and close the file when you’re done.

Next, execute the command below to activate the virtual host file glpi.conf. Then, verify your Apache2 syntax to ensure there is no syntax error.

sudo a2ensite glpi.conf

sudo apachectl configtest

If you’ve proper Apache2 syntax, you should get the output Syntax OK.

<img alt="setup virtual host" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/9-setup-virtualhost.png65030fe05a004.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="253" loading="lazy" src="data:image/svg xml,” width=”668″>

Now run the following systemctl command to restart the Apache2 service and apply the new changes on your virtual host file.

sudo systemctl restart apache2

Lastly, open your web browser and visit the domain name of your GLPI installation, such as http://glpi.hwdomain.io. If your installation is successful, you should see the GLPI installation page like the following:

<img alt="glpi installation page" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/10-glpi-installation-page.png65030fe085c1c.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="269" loading="lazy" src="data:image/svg xml,” width=”750″>

Securing GLPI with SSL/TLS Certificates

At this point, you are almost ready to finish up GLPI installation. Now you will secure GLPI by generating SSL/TLS certificates from Letsencrypt via the Certbot tool and Certbot Apache plugin.

Run the following apt command to install the Certbot and Certbot Apache plugin. Type y to confirm and proceed with the installation.

sudo apt install certbot python3-certbot-apache

<img alt="install certbot" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/11-install-certbot.png65030fe0ba2d9.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="392" loading="lazy" src="data:image/svg xml,” width=”731″>

After Certbot is installed, run the certbot command below to generate new SSL/TLS certificates for your GLPI installation. Be sure to change the domain name and email address within the following command.

sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d glpi.example.io

Now your SSl/TLS certificates will be available at /etc/letsencrypt/live/domain.com directory. Also, your virtual host configuration glpi.conf is now configured with HTTPS, which is configured via the Certbot Apache2 plugin.

GLPI Installation via Web Installer

Launch your web browser and visit the domain name of your GLPI installation, such as http://glpi.hwdomain.io/. Now you will be redirected to secure HTTPS connections and you will get the GLPI installation page.

First, select your preferred language and click OK.

<img alt="select language" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/12-select-language.png65030fe0ef004.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="240" loading="lazy" src="data:image/svg xml,” width=”750″>

Accept the GLPI License and click Continue to proceed.

<img alt="GLPI License" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/13-license.png65030fe12d1e1.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="491" loading="lazy" src="data:image/svg xml,” width=”750″>

Click Install to start the GLPI installation.

<img alt="install glpi" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/14-install-glpi.png65030fe165224.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="291" loading="lazy" src="data:image/svg xml,” width=”750″>

Confirm that your server environment is met with GLPI requirement checks, then click Continue.

<img alt="check requirements" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/15-php-extensions-check.png65030fe1cf0fc.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="684" loading="lazy" src="data:image/svg xml,” width=”750″>

Input details MariaDB user that you’ve created for your GLPI installation and click Continue.

<img alt="input database details" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/16-database-user-connections.png65030fe214d5a.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="454" loading="lazy" src="data:image/svg xml,” width=”750″>

Select the database glpidb and Continue again.

<img alt="select the database" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/17-select-the-database.png65030fe2537e3.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="505" loading="lazy" src="data:image/svg xml,” width=”750″>

The GLPI database will be initialized, click Continue.

<img alt="database intialization" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/18-database-initialization.png65030fe28d2be.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="276" loading="lazy" src="data:image/svg xml,” width=”750″>

Configure the Collect data section with your preferred settings, then click Continue.

<img alt="collect data settings" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/19-collect-data-no.png65030fe2daeed.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="650" loading="lazy" src="data:image/svg xml,” width=”750″>

Select Continue to go to the next section.

<img alt="configuration finished" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/20-configuration-finished.png65030fe31e299.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="443" loading="lazy" src="data:image/svg xml,” width=”750″>

In the last, you should see some default GLPI users created, such as glpi/glpi as administrator, tech/tech for the technican account, normal/normal for the normal account, post-only/postonly for the postonly account.

Click Use GLPI to finish your installation.

<img alt="installation finished" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/21-glpi-installation-finished.png65030fe36d2d9.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="393" loading="lazy" src="data:image/svg xml,” width=”750″>

Now you should get the GLPI login page. Input the default user glpi with password glpi, then click Sign In.

<img alt="glpi login page" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/22-glpi-login-page.png65030fe3c7c7e.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="529" loading="lazy" src="data:image/svg xml,” width=”750″>

Once logged in, you will get the GLPI administration dashboard like the following:

<img alt="glpi dashboard" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/23-glpi-dashboard.png65030fe434fe8.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="493" loading="lazy" src="data:image/svg xml,” width=”750″>

You will also be asked to change the default password for the glpi user. Input the new glpi administrator password and click Save.

<img alt="change admin password" data-ezsrc="https://kirelos.com/wp-content/uploads/2023/09/echo/24-change-password.png65030fe475c23.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="383" loading="lazy" src="data:image/svg xml,” width=”750″>

Lastly, back to your terminal server and run the following command to remove the installer script.

sudo rm /var/www/glpi/public/install/install.php

Conclusion

To wrap up, you’ve installed GLPI Inventory Management with the LAMP Stack (Apache2, MariaDB, and PHP) on the Debian 12 server. You’ve also secured GLPI with SSL/TLS certificates generated from Letsencrypt via Certbot and Certbot Apache plugin. Now you can explore the GLPI’s vast capabilities as inventory management, data center infrastructure management (DCIM), and many more.