Install & Configure GLPI on Ubuntu (Nginx + MariaDB + PHP 8.3) — Full SOP 2025
🧭 Install & Configure GLPI on Ubuntu (Nginx + MariaDB + PHP 8.3) — Full SOP 2025
Comprehensive setup guide for GLPI 10.x using Nginx, MariaDB, and PHP 8.3 on Ubuntu 22.04/24.04 LTS.
📋 1. Prerequisites
- Ubuntu 22.04/24.04 with sudo/root privileges
- DNS record or hostname (e.g.
glpi.localhostorglpi.example.com) - Updated system packages
sudo apt update && sudo apt upgrade -y
⚙️ 2. Install Required Packages
2.1 Nginx Web Server
sudo apt install -y nginx sudo nano /etc/nginx/sites-available/glpi.conf
server {
listen 80;
listen [::]:80;
server_name glpi.localhost;
root /var/www/glpi/public;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php$ {
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
sudo ln -s /etc/nginx/sites-available/glpi.conf /etc/nginx/sites-enabled/
2.2 PHP 8.3 + Extensions
Check PHP modules:
php -m | egrep "dom|fileinfo|filter|libxml|json|simplexml|xmlreader|xmlwriter|curl|gd|intl|mysqli|session|zlib|bz2|Phar|zip|exif|ldap|openssl|Zend OPcache"
Install PHP and required extensions:
sudo apt install -y php8.3-fpm php8.3-cli php8.3-common php8.3-xml php8.3-curl \ php8.3-gd php8.3-intl php8.3-mysql php8.3-zip php8.3-bz2 php8.3-ldap \ php8.3-opcache php8.3-mbstring
2.3 MariaDB Database Server
sudo apt install -y mariadb-server mariadb-client sudo mysql_secure_installation
Create GLPI database and user:
CREATE DATABASE glpidb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'glpiuser'@'localhost' IDENTIFIED BY 'StrongPassword'; GRANT ALL PRIVILEGES ON glpidb.* TO 'glpiuser'@'localhost'; FLUSH PRIVILEGES;
📦 3. Download and Deploy GLPI
cd /tmp wget https://github.com/glpi-project/glpi/releases/download/10.0.15/glpi-10.0.15.tgz tar -xvzf glpi-10.0.15.tgz sudo mv glpi /var/www/html/ sudo chown -R www-data:www-data /var/www/html/glpi sudo chmod -R 755 /var/www/html/glpi
🧩 4. Configure Nginx for GLPI
Create site configuration:
sudo nano /etc/nginx/sites-available/glpi.conf
Paste the following:
server {
listen 80;
server_name glpi.localhost;
root /var/www/html/glpi/public;
index index.php index.html;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|ttf|svg|eot)$ {
expires 6M;
access_log off;
log_not_found off;
}
}
Set permissions and reload Nginx:
sudo chown -R www-data:www-data /var/www/glpi
sudo find /var/www/glpi -type d -exec chmod 755 {} \;
sudo find /var/www/glpi -type f -exec chmod 644 {} \;
sudo ln -s /etc/nginx/sites-available/glpi.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
🔒 5. PHP Session Security
sudo nano /etc/php/8.3/fpm/php.ini
Ensure these settings are present:
session.cookie_httponly = On session.cookie_secure = On session.use_strict_mode = 1
Restart PHP-FPM:
sudo systemctl restart php8.3-fpm sudo chown -R www-data:www-data /var/lib/php/sessions sudo chmod 1733 /var/lib/php/sessions
🌐 6. Run GLPI Installer
http://glpi.localhost
Follow the web installer:
- Choose Install
- Use database:
glpidb - User:
glpiuser - Password:
StrongPassword
Default Login: glpi / glpi
🛠️ 7. Post-Installation Tasks
sudo rm /var/www/html/glpi/install/install.php sudo -u www-data php /var/www/html/glpi/front/cron.php sudo crontab -u www-data -e
Add line:
*/5 * * * * php /var/www/html/glpi/front/cron.php
🔐 8. Optional: Enable HTTPS (Let’s Encrypt)
sudo apt install certbot python3-certbot-nginx -y sudo certbot --nginx -d glpi.example.com
👤 9. Default Users
- glpi / glpi → Super Admin
- tech / tech → Technician
- normal / normal → Normal User
- post-only / postonly → Post-only
🧰 10. Maintenance Commands
sudo systemctl restart nginx sudo systemctl restart php8.3-fpm sudo systemctl restart mariadb
Check logs:
sudo tail -f /var/log/nginx/error.log sudo tail -f /var/log/nginx/access.log sudo journalctl -u php8.3-fpm -f sudo journalctl -u mariadb -f
✅ GLPI is now fully installed and configured with Nginx, MariaDB, and PHP 8.3 on Ubuntu!
© 2025 • IT Infrastructure Deployment Guide — GLPI on Ubuntu (Nginx + MariaDB) ⚙️
Comments
Post a Comment