TSF – Giải pháp IT toàn diện cho doanh nghiệp SMB | HCM

Install GLPI on Ubuntu Server 22.04 Full Step by Step

Installing GLPI on Ubuntu Server is a great way to build a complete open-source IT asset management and helpdesk system for your organization. GLPI (Gestionnaire Libre de Parc Informatique) helps you manage computers, software, users, and support tickets all in one platform. In this guide, we’ll walk you through the full installation process step by step — from preparing your Ubuntu server and installing Apache, PHP, and MariaDB to setting up the GLPI web interface. You’ll learn how to configure permissions, secure your installation, and access GLPI from a browser. The process is simple and beginner-friendly, even if you’re new to Linux or ITSM tools. By the end, you’ll have a fully functional GLPI system ready for daily operations. Whether you’re a system administrator, IT technician, or student, this GLPI installation on Ubuntu Server tutorial is designed to help you deploy a stable and efficient environment.

Step 1: Prepare the system environment

Set the hostname for the server
sudo hostnamectl set-hostname GLPI
sudo nano /etc/hosts
set GLPI in file hosts
sudo reboot now

Set a static IP for the server (netplan)
Use a yaml file
sudo netplan apply

Update the system
sudo apt update && sudo apt upgrade -y

Install the necessary packages:
sudo apt install apache2 mariadb-server php php-mysql php-cli php-curl php-gd php-intl php-mbstring php-xml php-zip php-bz2 php-soap php-apcu unzip wget -y

Step 2: Configure MariaDB

Create a SQL administrator root password
sudo mysql_secure_installation

Step 3: Create a database and administrator user

Log in to the mysql shell
sudo mysql

CREATE DATABASE glpidb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER ‘glpiuser’@’localhost’ IDENTIFIED BY ‘Abc@1234’;
GRANT ALL PRIVILEGES ON glpidb.* TO ‘glpiuser’@’localhost’;
FLUSH PRIVILEGES;
EXIT;

Step 4: Download and unzip GLPI

#1: Download
Home page download link: https://glpi-project.org/downloads/

wget https://github.com/glpi-project/glpi/releases/download/10.0.18/glpi-10.0.18.tgz
Move to /var/www/ directory and download in here
cd /var/www/
sudo wget https://github.com/glpi-project/glpi/releases/download/10.0.18/glpi-10.0.18.tgz

#2: Unzip and grant permissions
sudo tar -xvzf glpi-10.0.18.tgz
sudo chown -R www-data:www-data glpi
sudo chmod -R 755 glpi

Step 5: Configure Apache

#1: Create VirtualHost configuration file:
sudo nano /etc/apache2/sites-available/glpi.conf

Paste the following content
<VirtualHost *:80>
ServerAdmin http://192.168.16.248
DocumentRoot /var/www/glpi
ServerName tsf.id.vn

<Directory /var/www/glpi>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/glpi_error.log
CustomLog ${APACHE_LOG_DIR}/glpi_access.log combined
</VirtualHost>

#2: Enable configuration:
sudo a2ensite glpi.conf
sudo a2enmod rewrite
sudo systemctl restart apache2

#3: Turn off default site
sudo a2dissite 000-default.conf
sudo a2ensite glpi.conf
sudo systemctl reload apache2

Step 6: Configure Web UI

Access server IP: 192.168.16.248
Glpiuser/Abc@1234
Pass default: glpi/glpi

Step 7: Secure and complete

Delete install folder
sudo rm -rf /var/www/glpi/install

(Optional) Configure cron:
sudo crontab -e

add line
*/5 * * * * /usr/bin/php /var/www/glpi/front/cron.php

• /usr/bin/php: is the PHP file execution program using the command line (CLI).
• /var/www/glpi/front/cron.php: is the main cron file of GLPI.
This is GLPI’s internal cron. It performs background tasks such as:
• Send/receive emails automatically (e.g., automatically create tickets from emails).
• Synchronize LDAP if configured.
• Run plugins (like FusionInventory).
• Automatically clean up temporary/redundant data.
• Scheduled tasks configured in GLPI.