Installing GLPI on Ubuntu is a short, ordered install. You install Apache, PHP and MariaDB from the Ubuntu archive and create an empty database. Then you unpack the GLPI tarball into /var/www/glpi, point an Apache virtual host at its public/ folder, add a Let’s Encrypt certificate and run the installer. Order matters, because the GLPI requirements check reads your HTTPS and cookie settings, so we put TLS before the wizard, not after it. The sections below follow that order as a GLPI installation step by step Ubuntu walkthrough, with real output.
Three things changed under the old steps. Ubuntu 26.04 dropped two PHP packages the old command asked for, and the certbot redirect silently does nothing on the GLPI vhost. The installer also warns about session cookies until you set one PHP directive. Every command below was run on Ubuntu 26.04 and 24.04 with GLPI 12.0.2 in November 2026.
Prerequisites
You need one Ubuntu 26.04 or 24.04 server with sudo access, a DNS A record pointing a name such as glpi.example.com at it, and ports 80 and 443 reachable for the Let’s Encrypt HTTP-01 challenge. Any DNS provider works. If the box is fresh, run through the Ubuntu 26.04 server post-install checklist first so updates, the timezone and SSH are sorted before GLPI lands on it.
Both LTS releases run the current GLPI line, since it needs PHP 8.3 or newer and the older LTS ships exactly that. The archive versions differ, though, and the difference shows up in the package list you can use:
| Component | Ubuntu 26.04 LTS | Ubuntu 24.04 LTS |
|---|---|---|
| PHP | 8.5 | 8.3 |
| Apache | 2.4.66 | 2.4.58 |
| MariaDB | 11.8 | 10.11 |
php-imap, php-opcache packages | Not in the archive | Available |
| Time zones loaded into MariaDB | 486 | 1196 |
For sizing, 2 vCPU and 4 GB of RAM carries a few hundred assets and a small helpdesk. What grows the box is inventory volume: once GLPI Agent reports from every laptop and switch, the database and the cron workers do most of the work, so give MariaDB the extra memory first. We tested on VMs with 2 vCPU and 8 GB, comfortably above that floor. If you’d rather not run your own hardware for the test, DigitalOcean’s $200 trial credit covers a lab like this for months.
Set the install variables
The database name, user, password, install path and domain repeat through every step, so export them once. Change the password and the domain to your own values. The email has to be a real address on a real domain, because Let’s Encrypt rejects example.com addresses outright:
export GLPI_DB="glpidb"
export GLPI_USER="glpiuser"
export GLPI_PASS="ChangeMe#Strong2026"
export GLPI_ROOT="/var/www/glpi"
export GLPI_DOMAIN="glpi.example.com"
export ADMIN_EMAIL="[email protected]"
These only live in the current shell. If you log out halfway through, export them again before you continue, or a later command will run with an empty database name.
Install Apache, PHP and MariaDB
GLPI needs a handful of PHP extensions beyond the defaults: intl, gd, mysqli, bcmath, curl and mbstring are mandatory, while ldap, zip and bz2 unlock LDAP logins and marketplace plugins. This one list installs cleanly on both releases:
sudo apt update
sudo apt install -y apache2 mariadb-server mariadb-client php php-cli php-common php-mbstring php-xml php-ldap php-intl php-gd php-mysql php-zip php-bcmath php-curl php-bz2 libapache2-mod-php unzip wget curl
Older guides, including the previous version of this one, also listed php-imap and php-opcache. On Ubuntu 26.04 that stops apt dead, which is covered in the troubleshooting section below. Confirm what you got and that OPcache, sodium and exif are loaded:
php --version | head -1
apache2 -v | head -1
mariadb --version
php -m | grep -iE "opcache|sodium|exif|bz2"
On the 26.04 VM that printed PHP 8.5, Apache 2.4.66 and MariaDB 11.8, with all four modules present. OPcache shows twice because it’s both a PHP and a Zend extension, which is normal:

On 24.04 the same commands report PHP 8.3, Apache 2.4.58 and MariaDB 10.11. Both pass GLPI’s PHP floor, so nothing from a third-party PPA is needed. If you want the stack explained piece by piece, the LAMP stack guide for Ubuntu 26.04 and its Ubuntu 24.04 counterpart go deeper.
Create the GLPI database
Ubuntu’s MariaDB already authenticates root through the Unix socket and ships without anonymous users or a test database, so the old mariadb-secure-installation round adds nothing here. We go straight to the database and a dedicated user. That user gets rights on one database only, so a leaked GLPI password does not expose anything else on the server:
sudo mariadb -e "CREATE DATABASE ${GLPI_DB} CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
sudo mariadb -e "CREATE USER '${GLPI_USER}'@'localhost' IDENTIFIED BY '${GLPI_PASS}';"
sudo mariadb -e "GRANT ALL PRIVILEGES ON ${GLPI_DB}.* TO '${GLPI_USER}'@'localhost';"
GLPI stores dates in UTC and converts them per user, which only works when MariaDB knows the time zone names. Load them from the system zoneinfo and restart the server so it picks them up:
sudo mariadb-tzinfo-to-sql /usr/share/zoneinfo | sudo mariadb mysql
sudo systemctl restart mariadb
Count the loaded zones as root. Querying as glpiuser returns ERROR 1142 SELECT command denied, and that is expected. The GLPI documentation dropped the old GRANT SELECT ON mysql.time_zone_name step, so you do not need to add it back.
sudo mariadb -e "SELECT COUNT(*) AS zones FROM mysql.time_zone_name;"
The 26.04 server reported 486 zones and the 24.04 server 1196. The newer tzdata simply carries fewer legacy alias names. Any non-zero number means the tables loaded.
zones
486
If you need more MariaDB background, such as tuning or remote access, the MariaDB on Ubuntu guide covers it. GLPI itself only needs the local socket.
Download and extract GLPI
Pull the tag of the latest release from the GitHub API, so the commands keep working after the next point release. The tarball comes from the official GLPI releases page:
GLPI_VER=$(curl -sL https://api.github.com/repos/glpi-project/glpi/releases/latest | grep '"tag_name"' | head -1 | cut -d '"' -f4)
echo "Installing GLPI ${GLPI_VER}"
cd /tmp
wget -q "https://github.com/glpi-project/glpi/releases/download/${GLPI_VER}/glpi-${GLPI_VER}.tgz" -O glpi.tgz
ls -lh glpi.tgz
sha256sum glpi.tgz
Compare the checksum with the one listed under the asset on the release page before you unpack anything. On both lab servers the download matched:
Installing GLPI 12.0.2
-rw-rw-r-- 1 josphat josphat 110M Nov 12 08:13 glpi.tgz
028d9d275cf747600bbbefe072fd0724c1d4e7eee18378e696fea60a73d50359 glpi.tgz
Releases from the 12 line onward refuse to start on anything older than PHP 8.3: the extracted tree defines GLPI_MIN_PHP as 8.3 in src/autoload/constants.php, and composer.json on the 12.0.2 tag requires php >=8.3. If you are stuck on an older release for a plugin, pin GLPI_VER to the last 11.x tag instead, whose composer.json still accepts PHP 8.2. Extract into /var/www and hand the tree to the web server user:
sudo tar -xzf /tmp/glpi.tgz -C /var/www/
sudo chown -R www-data:www-data "${GLPI_ROOT}"
ls "${GLPI_ROOT}/public"
The public directory is the only part of GLPI a browser should ever reach. It holds index.php plus the compiled CSS and JS, while config/, files/ and src/ stay one level above the document root.
Configure the Apache virtual host
Pointing Apache at ${GLPI_ROOT}/public rather than the GLPI root is what keeps the database password in config/config_db.php off the web. Create the vhost:
sudo vim /etc/apache2/sites-available/glpi.conf
Paste the following, with glpi.example.com replaced by your domain. The rewrite block sends every request that isn’t a real file to GLPI’s router, and the Authorization rules let API and CalDAV clients authenticate:
<VirtualHost *:80>
ServerName glpi.example.com
DocumentRoot /var/www/glpi/public
<Directory /var/www/glpi/public>
Require all granted
RewriteEngine On
# Pass Authorization headers to PHP for the API and CalDAV
RewriteCond %{HTTP:Authorization} ^(.+)$
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Send every request to the GLPI router unless the file exists
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</Directory>
ErrorLog ${APACHE_LOG_DIR}/glpi_error.log
CustomLog ${APACHE_LOG_DIR}/glpi_access.log combined
</VirtualHost>
Enable mod_rewrite, swap the default site for this one and check the syntax before reloading:
sudo a2enmod rewrite
sudo a2dissite 000-default.conf
sudo a2ensite glpi.conf
sudo apache2ctl configtest
sudo systemctl restart apache2
A request with your host name should now return 200 OK and set a glpi_ session cookie, which proves PHP and the router are answering:
curl -sI -H "Host: ${GLPI_DOMAIN}" http://127.0.0.1/ | head -5
The 26.04 server answered like this (the cookie name is shortened here):
HTTP/1.1 200 OK
Date: Sun, 22 Nov 2026 17:29:49 GMT
Server: Apache/2.4.66 (Ubuntu)
Set-Cookie: glpi_6874b7c9...; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Notice the cookie carries HttpOnly but not secure yet. A browser would send it over plain HTTP, which is exactly what the cookie section further down fixes once HTTPS is in place.
Open the firewall
Allow SSH before you enable UFW, or you will lock yourself out of a remote server. The Apache Full profile opens 80 and 443 together, and you need both, because Let’s Encrypt validates over port 80:
sudo ufw allow OpenSSH
sudo ufw allow "Apache Full"
sudo ufw --force enable
sudo ufw status
UFW writes a v6 twin for every rule because IPV6=yes is the default in /etc/default/ufw. The status should list both profiles for IPv4 and IPv6:
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
Apache Full ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Apache Full (v6) ALLOW Anywhere (v6)
On a cloud VM, the provider’s security group or firewall rule must allow 80 and 443 too. UFW alone will not help if traffic never reaches the instance, and the certbot step below fails with a timeout rather than a clear firewall error.
Enable HTTPS with Let’s Encrypt
GLPI holds passwords, asset serials and ticket history, so it should not be served over plain HTTP even on a LAN. Install the certbot Apache plugin and request a certificate with the HTTP-01 challenge:
sudo apt install -y certbot python3-certbot-apache
sudo certbot --apache -d "${GLPI_DOMAIN}" --non-interactive --agree-tos --redirect -m "${ADMIN_EMAIL}"
Certbot creates glpi-le-ssl.conf for port 443 and installs a renewal timer. Read the second-to-last line carefully, because it is the hint for the next fix:
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/glpi.example.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/glpi.example.com/privkey.pem
This certificate expires on 2027-02-20.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Successfully deployed certificate for glpi.example.com to /etc/apache2/sites-available/glpi-le-ssl.conf
Added an HTTP->HTTPS rewrite in addition to other RewriteRules; you may wish to check for overall consistency.
Congratulations! You have successfully enabled HTTPS on https://glpi.example.com
Renewal is handled by the certbot.timer systemd unit the package installs, so there is no cron entry to add for the certificate.
Fix the HTTP to HTTPS redirect
On both of our lab servers, curl -sI http://${GLPI_DOMAIN}/ still returned 200 OK after certbot claimed it had added the redirect. The cause is the vhost layout. Certbot appends its RewriteCond and RewriteRule at virtual host level, but the only RewriteEngine On lives inside the <Directory> block, so Apache ignores the new rules. Insert the missing line above certbot’s condition:
sudo sed -i "s/^RewriteCond %{SERVER_NAME}/RewriteEngine On\nRewriteCond %{SERVER_NAME}/" /etc/apache2/sites-available/glpi.conf
sudo apache2ctl configtest
sudo systemctl reload apache2
Check the tail of the vhost and request the plain HTTP address again:
tail -4 /etc/apache2/sites-available/glpi.conf
curl -sI "http://${GLPI_DOMAIN}/" | head -1
The three rewrite lines now sit together, and plain HTTP answers with HTTP/1.1 301 Moved Permanently:

Skipping this leaves logins working over plain HTTP for anyone who types the bare host name, which defeats the point of the certificate.
Alternative: DNS-01 for private or wildcard hosts
When the server sits on a private network with no inbound port 80, or you want a wildcard certificate, use a DNS-01 plugin instead. Certbot validates by creating a TXT record through your DNS provider’s API, so the server never needs to be reachable from the internet. Pick the plugin for your provider:
| DNS provider | Ubuntu package |
|---|---|
| Cloudflare | python3-certbot-dns-cloudflare |
| Route 53 | python3-certbot-dns-route53 |
| DigitalOcean | python3-certbot-dns-digitalocean |
| Google Cloud DNS | python3-certbot-dns-google |
| Linode | python3-certbot-dns-linode |
| OVH | python3-certbot-dns-ovh |
| BIND or other dynamic DNS | python3-certbot-dns-rfc2136 |
A Cloudflare run looks like the block below. Substitute your provider’s plugin and credentials file if you use another DNS host. With certonly, certbot does not touch Apache, so you then create a *:443 vhost yourself. Copy glpi.conf to glpi-ssl.conf, change the port to 443, add SSLEngine on with SSLCertificateFile and SSLCertificateKeyFile pointing at /etc/letsencrypt/live/glpi.example.com/fullchain.pem and privkey.pem, then run sudo a2enmod ssl and sudo a2ensite glpi-ssl.conf. The cookie and installer steps below assume HTTPS already answers.
sudo apt install -y python3-certbot-dns-cloudflare
echo "dns_cloudflare_api_token = your-token-here" | sudo tee /etc/letsencrypt/cloudflare.ini
sudo chmod 600 /etc/letsencrypt/cloudflare.ini
sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials /etc/letsencrypt/cloudflare.ini -d "${GLPI_DOMAIN}" --non-interactive --agree-tos -m "${ADMIN_EMAIL}"
Our lab used the HTTP-01 path above. This DNS-01 variant follows the documented certbot plugin usage and was not part of the test run, so check the plugin page for your provider before you rely on it.
Secure the PHP session cookies
With HTTPS live, the GLPI requirements check still flags one row, Security configuration for sessions. The reason is that session.cookie_secure is off, so the session cookie could still travel over plain HTTP and be read by anyone on the path. The installer marks it as a warning, not a blocker, which is exactly why most people click past it. Running the wizard without the fix produced this screen:

- 1Security configuration for sessions
- 2Try Again
Rather than edit the main php.ini, which package upgrades may want to replace, drop a small override into Apache’s PHP conf.d directory. The path contains the PHP version, so read it from PHP itself and the same commands work on 26.04 and 24.04:
PHP_VER=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')
sudo vim /etc/php/${PHP_VER}/apache2/conf.d/99-glpi.ini
Add the cookie flags the GLPI prerequisites page recommends, plus the upload, execution and memory limits from the vendor’s GLPI install procedure. Set date.timezone to your zone if you do not want UTC:
session.cookie_secure = on
session.cookie_httponly = on
session.cookie_samesite = Lax
upload_max_filesize = 20M
post_max_size = 20M
max_execution_time = 60
memory_limit = 256M
date.timezone = UTC
The vendor procedure also lists max_input_vars = 5000. The 12.0.2 requirements check did not ask for it on either lab install, so it is not in the file above, but add it as a ninth line if you expect very large forms. PHP’s default is 1000, and a POST with more fields than the limit loses the extra fields with only a warning in the log, so the save looks like it worked when part of it was dropped.
Restart Apache so mod_php rereads its configuration, then check the cookie flags over HTTPS:
sudo systemctl restart apache2
curl -sI "https://${GLPI_DOMAIN}/" | grep -i set-cookie
The cookie now carries all three flags:
Set-Cookie: glpi_<hash>=<id>; path=/; secure; HttpOnly; SameSite=Lax
If the wizard is already open on the requirements page, click Try Again and the session row turns into a green check.
Run the GLPI web installer
Open https://glpi.example.com in a browser. GLPI sees there is no database configuration yet and offers the install page. On our 26.04 server the wizard ran through these screens in order:
- Language and GPL licence
- Install or Upgrade choice
- Requirements check
- Database connection and database choice
- Schema creation, telemetry and the finish page
The first screen asks for a language. Pick yours and click OK, keeping in mind that the choice also becomes the default language for new GLPI users, the same setting the console installer takes as --default-language:

Accept the GPL licence with Continue, then choose Install (Upgrade is for an existing database). The requirements table should show only green checks now that the cookie fix is in. On step 1, enter localhost as the SQL server and the user and password you exported earlier:

Step 2 is where people trip. The form puts a Create a new database field on top, but glpiuser has no right to create databases, so typing a name there fails. Select the existing glpidb radio button under it instead:

Step 3 builds the schema, imports default data, generates the security keys and reports Installation done in under half a minute. Step 4 asks about telemetry, and the Send usage statistics box is ticked by default. Untick it if your organisation does not allow outbound reporting:

Step 5 is an advert for the commercial GLPI Network support plan. Click past it and the last screen lists the four default accounts the installer created:

Write those four down only long enough to change them. Anyone who knows GLPI knows glpi/glpi, and scanners try it.
Install from the command line instead
For Ansible, cloud-init or any rebuild you want to repeat, skip the wizard and run the console installer as www-data. It does the same work as steps 1 to 4, and --no-telemetry answers the statistics question up front:
sudo -u www-data php "${GLPI_ROOT}/bin/console" db:install --db-name="${GLPI_DB}" --db-user="${GLPI_USER}" --db-password="${GLPI_PASS}" --default-language=en_US --no-telemetry --no-interaction
On the 24.04 server it finished in 23 seconds of wall time:

The console also has a requirements check, system:check_requirements (older guides call it glpi:system:check_requirements, which no longer exists). Run from the CLI it marks the session row [SKIPPED], because the CLI is not serving HTTPS, so the browser check is still the one that tells you whether the cookie fix worked.
Log in and change the default passwords
Click Use GLPI or browse to your domain, then sign in as glpi with password glpi:

The dashboard opens with two banners. The orange one asks you to change the password for the default users and names every account still on its factory value, and it stays until all four are changed. The second says you are looking at demonstration data, which is why the counters already show thousands of computers on a server you installed a minute ago:

- 1change the password for the default users
- 2Disable demonstration
Click Disable demonstration so the dashboard reflects your own inventory. Then open Administration > Users and give glpi, tech, normal and post-only new passwords, or disable the three you will not use. Create a named admin account for yourself too, so the shared glpi login can be disabled later.
Schedule the GLPI cron job
A fresh GLPI runs most automatic actions in “GLPI” mode, triggered by people loading pages. On our lab install, 11 active actions were set to CLI mode instead, and those 11 never run at all until a system cron calls front/cron.php. The CLI group includes:
- Queued webhooks
- Domain expiry alerts
- Draft form purges
Without cron, those jobs sit idle and nothing warns you. Create a cron entry that runs the script every minute as the web server user:
sudo vim /etc/cron.d/glpi
The file takes a single line. The user field matters, since files written by cron as root would later be unreadable to Apache:
* * * * * www-data /usr/bin/php /var/www/glpi/front/cron.php
Give it a minute, then check that CLI mode actions (mode=2) have a last run time:
sudo mariadb glpidb -e "SELECT name, mode, lastrun FROM glpi_crontasks WHERE mode=2 AND state=1 ORDER BY lastrun DESC;"
On the 26.04 server, five of the eleven CLI tasks had run one minute after the cron file went in. Each run picks a few due tasks, so the NULL rows fill in over the next minutes:

The same list lives in the UI under Setup > Automatic actions, where you can switch busy tasks such as queuednotification to CLI mode so mail goes out even when nobody is logged in.
Troubleshoot GLPI on Ubuntu
These are the failures that came up in testing or that the old version of this guide caused, with the exact messages so you can match them.
E: Package ‘php-imap’ has no installation candidate
Ubuntu 26.04 printed both of these when asked for the two packages older guides list:
E: Package 'php-imap' has no installation candidate
E: Package 'php-opcache' has no installation candidate
OPcache is compiled into PHP 8.5, so there is nothing to install, and the IMAP extension was removed from PHP core and the 26.04 archive. GLPI does not need either to install. Drop both names and use the package list from the install step, which works on both releases.
500 error: kernel.secret has a dependency on a non-existent parameter
Some GLPI 11 installs died with a blank 500 page and this in files/_log/php-errors.log. The randomly generated config/glpicrypt.key happened to contain a % byte, which Symfony reads as a parameter placeholder. Users reported this on older GLPI 11 installs in the project’s issue tracker, while our 12.0.2 installs on 26.04 and 24.04 never hit it. If you do see it, a community workaround points the console away from the bad key file and rotates the key. We did not need it in the lab, so take a database backup first:
sudo -u www-data APP_SECRET_FILE=/nonexistent php "${GLPI_ROOT}/bin/console" security:change_key --no-interaction
The command re-encrypts stored secrets with the new key, which is safer than replacing the file by hand. Check afterwards that the new glpicrypt.key loads, because a fresh random key can, in principle, contain the same byte again.
The ACME server believes [email protected] is an invalid email address
Let’s Encrypt refuses reserved domains such as example.com in the account email. Export a real address in ADMIN_EMAIL and rerun certbot. If certbot instead reports a timeout or an unauthorized challenge, port 80 is not reachable or the A record does not point at this server yet. Check dig +short ${GLPI_DOMAIN} and the cloud firewall. On the DNS-01 path the usual failure is an API token without permission to edit the zone, so scope the token to DNS edit on that zone.
Harden GLPI for production
A few defaults are worth tightening before real data goes in, and a few steps from older guides are no longer needed:
- Config file mode 640
- The
install/directory left in place display_errorsalready off- A database backup before every upgrade
The installer writes config_db.php and glpicrypt.key with whatever mode the process umask gives them, which on a default system can leave them readable by every local account. They sit outside the document root, but the database password and the encryption key should not depend on a umask, so set the mode explicitly:
sudo chmod 640 "${GLPI_ROOT}/config/config_db.php" "${GLPI_ROOT}/config/glpicrypt.key"
ls -l "${GLPI_ROOT}/config/"
Both files now show -rw-r----- owned by www-data, matching the OAuth key pair GLPI already creates as 660:
-rw-r----- 1 www-data www-data 319 Nov 22 17:37 config_db.php
-rw-r----- 1 www-data www-data 32 Nov 22 17:37 glpicrypt.key
-rw-rw---- 1 www-data www-data 1704 Nov 22 17:38 oauth.pem
-rw-rw---- 1 www-data www-data 451 Nov 22 17:38 oauth.pub
Do not delete install/install.php the way older guides told you to. Once a database is configured, GLPI answers that URL with a 302 redirect to the login page, and the install/migrations folder next to it is what bin/console db:update uses on your next upgrade. Likewise, the Apache PHP config on Ubuntu already ships display_errors = Off and expose_php = Off on both releases, so there is nothing to change there. Back up the database and the config and files directories before each upgrade, because that is the one rollback path GLPI has.
That leaves a GLPI install on HTTPS with secure cookies, working cron and no default passwords. That is the state we would want before pointing a single GLPI Agent at it. If you also look after RHEL-family servers, our GLPI guide for Rocky Linux and AlmaLinux covers the same install with SELinux and firewalld. Ralph CMDB is the alternative to look at if you want a data-centre-first asset model rather than a helpdesk with inventory attached.
good tutoriel !
Great we are happy to learn this was helpful.