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_installationCreate 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 /tmp2wget https://github.com/glpi-project/glpi/releases/latest/download/glpi.tgz3sudo tar -xzf glpi.tgz -C /var/www/html/4sudo chown -R www-data:www-data /var/www/html/glpi5sudo chmod -R 755 /var/www/html/glpiStep 4: Apache Virtual Host
apache
1# /etc/apache2/sites-available/glpi.conf2<VirtualHost *:80>3 ServerName glpi.example.com4 DocumentRoot /var/www/html/glpi/public5 6 <Directory /var/www/html/glpi/public>7 AllowOverride All8 Require all granted9 </Directory>10 11 ErrorLog ${APACHE_LOG_DIR}/glpi_error.log12 CustomLog ${APACHE_LOG_DIR}/glpi_access.log combined13</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 -y2sudo certbot --apache -d glpi.example.comStep 6: Post-Installation Hardening
bash
1sudo rm -rf /var/www/html/glpi/install2sudo chmod 600 /var/www/html/glpi/config/config_db.phpFile 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