How to Install GLPI on Ubuntu: A Complete Step‑by‑Step Guide
Setting up GLPI (the open‑source IT asset and service‑management tool) on an Ubuntu server doesn’t have to feel like deciphering ancient code. In this guide we’ll walk through every command you need, explain why each step matters, and leave you with a functional GLPI instance ready for your organization’s tickets and inventory. By the end you’ll know exactly how to install GLPI on Ubuntu and get it running securely.
Prerequisites Before Installing GLPI
Before you start, make sure you have a fresh Ubuntu 22.04 LTS installation (or a later LTS release). You’ll need:
- A non‑root user with
sudoprivileges. - At least 2 GB of RAM and 10 GB of disk space for a modest deployment.
- Access to the internet for package downloads.
If you plan to use GLGLPI in production, consider a static IP address and a proper hostname (e.g., glpi.example.com).
1. Update the System and Install Core Packages
Begin with a clean slate. Running the latest updates reduces the chance of dependency conflicts.
sudo apt update && sudo apt upgrade -ysudo apt install -y software-properties-common curl wget gnupg2
These utilities give you the flexibility to add external repositories and fetch files directly from the web.
2. Install the Web Server, PHP, and Database
GLPI runs on a LAMP stack, so we’ll install Apache, MariaDB, and the required PHP extensions.
sudo apt install -y apache2 mariadb-serverSecure MariaDB with the built‑in script:
sudo mysql_secure_installationWhen prompted, set a strong root password, remove anonymous users, and disallow remote root login.
Next, install PHP 8.1 (the default in Ubuntu 22.04) along with the extensions GLPI needs:
sudo apt install -y php php-{cli,gd,mbstring,curl,xml,zip,bz2,intl,ldap,soap,apcu,common}sudo a2enmod rewrite
sudo systemctl restart apache2
3. Create a Dedicated Database for GLPI
It’s best practice to keep GLPI’s data isolated.
sudo mysql -u root -pCREATE DATABASE glpidb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'glpiuser'@'localhost' IDENTIFIED BY 'StrongPassw0rd!';
GRANT ALL PRIVILEGES ON glpidb.* TO 'glpiuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Replace StrongPassw0rd! with a password you can remember but that isn’t easy to guess.
4. Download and Extract GLPI
The official GLPI website hosts the latest stable tarball. Pull it down with wget and place it in Apache’s web directory.
cd /tmpwget https://github.com/glpi-project/glpi/releases/download/10.0.6/glpi-10.0.6.tgz
tar xzf glpi-10.0.6.tgz
sudo mv glpi /var/www/html/glpi
sudo chown -R www-data:www-data /var/www/html/glpi
sudo chmod -R 755 /var/www/html/glpi
If a newer version exists, simply replace the URL with the latest release link.
5. Configure Apache for GLPI
Create a virtual host file so you can access GLPI via a friendly URL.
sudo tee /etc/apache2/sites-available/glpi.conf > /dev/null <<EOF<VirtualHost *:80>
ServerName glpi.example.com
DocumentRoot /var/www/html/glpi
<Directory /var/www/html/glpi>
AllowOverride All
Require all granted
</Directory>
ErrorLog \${APACHE_LOG_DIR}/glpi_error.log
CustomLog \${APACHE_LOG_DIR}/glpi_access.log combined
</VirtualHost>
EOF
sudo a2ensite glpi.conf
sudo a2dissite 000-default.conf
sudo systemctl reload apache2
Update your DNS or /etc/hosts file so glpi.example.com points to your server’s IP.
6. Run the Web Installer
Open a browser and navigate to http://glpi.example.com. The installer will guide you through:
- Accepting the license.
- Checking system requirements (you should see green ticks if all dependencies are satisfied).
- Providing the database details you created earlier.
- Creating the first admin account.
After the wizard finishes, it will prompt you to delete the /install directory for security reasons. Do so with:
sudo rm -rf /var/www/html/glpi/install7. Harden the Installation
A few extra tweaks make your GLPI server more resilient:
- Enable HTTPS. Install Certbot and obtain a free Let’s Encrypt certificate:
sudo apt install -y certbot python3‑certbot‑apachesudo certbot --apache -d glpi.example.com
- Restrict file permissions. Ensure only the web server can write to the
filesandconfigdirectories:sudo chown -R www-data:www-data /var/www/html/glpi/files /var/www/html/glpi/configsudo chmod -R 750 /var/www/html/glpi/files /var/www/html/glpi/config
- Set up automatic backups. A simple
mysqldumpcron job can protect your data:0 2 * * * mysqldump -u glpiuser -pStrongPassw0rd! glpidb | gzip > /var/backups/glpi_$(date +\%F).sql.gz
8. Verify Everything Is Working
Log in with the admin credentials you created during installation. Check the dashboard for any red warnings. If the “Plugins” tab loads and the “Tickets” module lets you open a test ticket, you’re good to go.
Frequently Asked Questions
Can I run GLPI on Ubuntu 20.04 instead of 22.04?
Yes. The steps are virtually identical, but you may need to install PHP 7.4 (the default in 20.04) and adjust the list of required PHP extensions accordingly.
Do I need to install additional PHP modules for LDAP authentication?
If you plan to sync with Active Directory or OpenLDAP, the php-ldap package is required. Install it before running the web installer, then enable LDAP in GLPI’s authentication settings.
How often should I update GLPI?
GLPI releases security patches roughly every few months. Subscribe to the project’s mailing list or monitor the GitHub releases page; applying updates promptly reduces exposure to known vulnerabilities.