Back to Blog
    LinuxLabs

    Installing GLPI on Linux: Complete ITSM Setup Guide

    Step-by-step guide to deploy GLPI IT asset management on Ubuntu/Debian with MariaDB, Apache, and SSL configuration.

    February 1, 20264 min read

    Introduction

    GLPI is an open-source ITSM platform for asset management, helpdesk, and inventory. This guide focuses on a clean, secure, and maintainable deployment.

    Prerequisites

    • A Linux server (Ubuntu LTS or Debian stable)
    • Root or sudo access
    • A domain name (recommended for SSL)
    • At least 2 GB RAM and 20 GB disk

    Step 1: Install the LAMP Stack

    terminal
    $sudo apt update && sudo apt upgrade -y
    $sudo apt install apache2 mariadb-server php php-{curl,gd,mbstring,xml,zip,intl,ldap,apcu,xmlrpc,cas,mysqli,bz2} -y

    Step 2: Secure and Prepare MariaDB

    bash
    1sudo mysql_secure_installation

    Create the database and user:

    sql
    1CREATE DATABASE glpi CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    2CREATE USER 'glpi'@'localhost' IDENTIFIED BY 'StrongPasswordHere';
    3GRANT ALL PRIVILEGES ON glpi.* TO 'glpi'@'localhost';
    4FLUSH PRIVILEGES;

    Step 3: Install GLPI

    bash
    1cd /tmp
    2wget https://github.com/glpi-project/glpi/releases/latest/download/glpi.tgz
    3sudo tar -xzf glpi.tgz -C /var/www/html/
    4sudo chown -R www-data:www-data /var/www/html/glpi
    5sudo chmod -R 755 /var/www/html/glpi

    Step 4: Apache Virtual Host

    apache
    1# /etc/apache2/sites-available/glpi.conf
    2<VirtualHost *:80>
    3 ServerName glpi.example.com
    4 DocumentRoot /var/www/html/glpi/public
    5
    6 <Directory /var/www/html/glpi/public>
    7 AllowOverride All
    8 Require all granted
    9 </Directory>
    10
    11 ErrorLog ${APACHE_LOG_DIR}/glpi_error.log
    12 CustomLog ${APACHE_LOG_DIR}/glpi_access.log combined
    13</VirtualHost>
    terminal
    $sudo a2ensite glpi.conf
    $sudo a2enmod rewrite
    $sudo systemctl reload apache2

    Step 5: SSL with Let's Encrypt

    bash
    1sudo apt install certbot python3-certbot-apache -y
    2sudo certbot --apache -d glpi.example.com

    Step 6: Post-Installation Hardening

    bash
    1sudo rm -rf /var/www/html/glpi/install
    2sudo chmod 600 /var/www/html/glpi/config/config_db.php

    File Structure

    /var/www/html/glpi
    ├── config
    │ └── config_db.php
    ├── files
    │ ├── _uploads
    │ └── _documents
    ├── public
    │ └── index.php
    └── plugins

    Conclusion

    Your GLPI instance is ready. Change default credentials and set up backups for the database and the files/ directory.

    GLPI
    Apache
    MariaDB
    PHP
    Linux

    Written by

    CT

    Corentin Tujague

    Network & Security Engineer

    Passionate about building secure, scalable infrastructure and sharing technical knowledge.