Install GLPI on Ubuntu [Complete Guide]

Posted by

If you manage computers, printers, software licenses, or other IT resources, keeping track of everything manually can quickly become difficult. This is where GLPI (Gestionnaire Libre de Parc Informatique) comes in handy. It is an open-source IT asset management and service desk platform that helps businesses organize their IT infrastructure from one central location.

With GLPI, you can manage hardware inventories, track software licenses, handle technical support tickets, monitor IT assets, and organize maintenance activities. Instead of switching between multiple applications, your IT team can manage many everyday tasks through a single web interface.

Generally, you can install GLPI on an Ubuntu server using Apache, PHP, and MariaDB. The installation involves preparing your server, configuring the database, downloading GLPI, and completing the setup through a web browser.

For this guide, we will use Ubuntu 24.04 LTS and GLPI 12, which requires PHP 8.3 or later and MariaDB 10.11 or later, or MySQL 8.0 or later. Make sure your server meets these requirements before proceeding.

Let’s walk through the complete installation process.

Install GLPI on Ubuntu [Complete Guide]

Install GLPI on Ubuntu
Install GLPI on Ubuntu

To install GLPI on Ubuntu, follow these steps:

Step 1: Update Your Ubuntu System

Before installing GLPI, make sure your Ubuntu server is up to date. This helps prevent package conflicts and ensures that your system has the latest available security fixes and software updates.

First, log in to your Ubuntu server using an account with sudo privileges. You can access the server directly through its terminal or connect remotely using SSH.

Open the terminal and execute the following command:

sudo apt update && sudo apt upgrade -y

The apt update command refreshes the package information, while apt upgrade installs available package updates. The -y option automatically confirms the installation prompts.

Once the process finishes, check whether a system restart is recommended. If Ubuntu has installed a kernel update or another component that requires restarting, reboot the server before continuing.

Use this navigation path: Ubuntu Desktop or SSH > Terminal > Update Package Lists > Upgrade Packages.

Step 2: Install Apache, PHP, and Required Extensions

GLPI needs a web server and PHP to operate. In this guide, we will use Apache2 because it is straightforward to configure on Ubuntu.

Run the following command to install Apache:

sudo apt install apache2 -y

Next, install PHP 8.3 and the extensions required by GLPI 12. On Ubuntu 24.04, PHP 8.3 is available through the standard Ubuntu repositories.

Execute:

sudo apt install php8.3 libapache2-mod-php8.3 php8.3-cli php8.3-common php8.3-mysql php8.3-curl php8.3-gd php8.3-intl php8.3-mbstring php8.3-xml php8.3-zip php8.3-bcmath php8.3-openssl php8.3-ldap php8.3-apcu -y

These packages provide PHP database connectivity, image processing, internationalization, XML handling, compressed file support, and other application features. The LDAP and APCu extensions are useful for additional authentication and performance functionality.

Enable Apache’s rewrite module:

sudo a2enmod rewrite

Restart Apache to apply the changes:

sudo systemctl restart apache2

To confirm that PHP is installed, execute:

php -v

You should see PHP 8.3 or a compatible newer version. You can also check Apache’s status using:

sudo systemctl status apache2

Follow this path: Ubuntu Terminal > Install Apache > Install PHP 8.3 > Enable Rewrite Module > Verify Installation.

Step 3: Install and Configure MariaDB

GLPI requires a supported database server to store information about assets, users, tickets, configurations, and other application data.

For this installation, we will use MariaDB 10.11 or later.

Install MariaDB with:

sudo apt install mariadb-server -y

Start the database service and enable it to launch automatically:

sudo systemctl enable –now mariadb

You should also run the MariaDB security script:

sudo mariadb-secure-installation

Follow the prompts to review database security settings, remove anonymous accounts, disable remote root access where appropriate, and remove the test database.

Now open the MariaDB command-line interface:

sudo mariadb

Create a dedicated database for GLPI:

CREATE DATABASE glpi CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Next, create a separate database user and assign a strong password. Replace YourStrongPasswordHere with a unique password.

CREATE USER ‘glpiuser’@’localhost’ IDENTIFIED BY ‘YourStrongPasswordHere’;

Grant the necessary permissions:

GRANT ALL PRIVILEGES ON glpi.* TO ‘glpiuser’@’localhost’;

FLUSH PRIVILEGES;

EXIT;

Your database is now ready. Keep the database name, username, and password available because you will need them during the GLPI installation.

The navigation path is Ubuntu Terminal > MariaDB > Create Database > Create Database User > Assign Permissions.

Step 4: Download and Extract GLPI

Now that the web server, PHP, and database are ready, you can download the GLPI application files.

Visit the official GLPI release page and identify the latest stable GLPI 12 release. Download the archive named glpi-{version}.tgz. Avoid downloading the GitHub archives labeled Source code because the packaged release archive is the appropriate installation file.

You can download the release using wget. Replace the example filename and download address with the actual release asset.

wget -O glpi.tgz “OFFICIAL_GLPI_RELEASE_ASSET_URL”

Create the application directory:

sudo mkdir -p /var/www

Extract the downloaded archive:

sudo tar -xzf glpi.tgz -C /var/www/

The extracted application should be available at:

/var/www/glpi

Verify that the directory contains the GLPI application files, including its public directory and bin folder.

The navigation path is Official GLPI Releases > Download Stable Archive > Extract Files > /var/www/glpi.

Step 5: Configure Apache for GLPI

Apache needs to know where the GLPI application is stored and which directory it should serve to visitors.

An important security requirement is to configure Apache’s DocumentRoot to point to the GLPI public directory rather than the application root directory. This helps prevent sensitive application files from being directly exposed through the web server.

Create a new Apache configuration file:

sudo nano /etc/apache2/sites-available/glpi.conf

Add the following configuration:

<VirtualHost *:80>

    ServerName glpi.example.com

    DocumentRoot /var/www/glpi/public

    <Directory /var/www/glpi/public>

        Require all granted

        RewriteEngine On

        RewriteCond %{HTTP:Authorization} ^(.+)$

        RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

        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>

Replace glpi.example.com with your actual domain name. If you are testing through your server’s IP address, you can configure the appropriate default virtual host instead.

Save the file and exit the editor. Enable the new Apache site:

sudo a2ensite glpi.conf

Check the configuration for errors:

sudo apache2ctl configtest

If Apache reports Syntax OK, reload the service:

sudo systemctl reload apache2

Follow this path: Apache Configuration > Create glpi.conf > Set DocumentRoot > Enable Site > Reload Apache.

Step 6: Configure GLPI File Permissions

GLPI needs permission to write certain configuration and application data files. If the permissions are incorrect, you may encounter installation errors or problems when uploading documents and managing assets.

First, assign ownership of the application directory to the Apache service account:

sudo chown -R www-data:www-data /var/www/glpi

Next, set reasonable directory and file permissions:

sudo find /var/www/glpi -type d -exec chmod 755 {} \;

sudo find /var/www/glpi -type f -exec chmod 644 {} \;

The Apache user needs write access to the required configuration and data directories. For the initial installation, you can provide the necessary access to these directories:

sudo chmod -R 775 /var/www/glpi/config /var/www/glpi/files

Do not apply broad write permissions to the entire application directory. For production deployments, follow GLPI’s recommended directory separation and permission configuration so sensitive files remain protected.

The navigation path is Ubuntu Terminal > GLPI Directory > Set Ownership > Configure Directory Permissions.

Step 7: Complete the GLPI Installation in Your Browser

You have now completed the main server configuration. The next step is to finish installing GLPI through its web-based installation wizard.

Open your preferred browser and enter your server’s IP address or configured domain name.

For example:

http://your-server-ip/

If your domain is configured correctly, you can also visit:

http://glpi.example.com/

The GLPI installation screen should appear. Select your preferred language and continue.

Accept the license agreement, select Install, and allow GLPI to check your server environment. If the installer reports missing PHP extensions or configuration problems, resolve them before proceeding.

When prompted for database information, enter the following details:

Database server: localhost

Database user: glpiuser

Database password: YourStrongPasswordHere

After validating the database connection, select the glpi database you created earlier. The installer will initialize the database and create the necessary application tables.

Follow the remaining instructions until the installation is complete.

The navigation path is Browser > GLPI Server Address > Language Selection > License Agreement > Install > Database Configuration > Finish.

Step 8: Secure GLPI and Verify the Installation

Once GLPI is installed, take a few minutes to secure your new application.

The installation wizard provides default accounts, including the administrator account. Change the default passwords immediately and create a separate administrator account with an appropriate profile before removing or disabling the original account.

Next, configure HTTPS using a trusted TLS certificate. You can use Certbot with Let’s Encrypt if your domain points to the server and the required network ports are accessible.

For an Apache server, install Certbot and its Apache integration:

sudo apt install certbot python3-certbot-apache -y

Then request a certificate:

sudo certbot –apache -d glpi.example.com

Replace the example domain with your actual domain.

You should also configure GLPI’s scheduled tasks. GLPI relies on automated background actions for activities such as notifications and recurring maintenance. Configure the system cron to execute the GLPI cron script as the www-data user, following the application’s documentation.

Finally, create regular backups of both the GLPI database and application data directories. Store backup copies somewhere separate from your Ubuntu server.

Follow this path: GLPI Dashboard > Change Default Passwords > Configure HTTPS > Set Up Cron > Schedule Backups.

FAQs

1. Can I install GLPI on Ubuntu 22.04?

Yes. However, GLPI 12 requires PHP 8.3 or later. Ubuntu 22.04 does not provide PHP 8.3 through its standard repositories, so you will need a compatible PHP repository or another supported deployment method.

2. Is GLPI free to install on Ubuntu?

Yes. GLPI is an open-source application distributed under the GNU General Public License. You can install and use its community version without purchasing a software license.

3. Which database works with GLPI?

GLPI supports MariaDB and MySQL. For GLPI 12, use MariaDB 10.11 or later or MySQL 8.0 or later.

4. Can I install GLPI without Apache?

Yes. GLPI also supports other web servers, including Nginx, Lighttpd, and IIS. However, their configuration requirements differ from Apache.

5. How do I access GLPI after installation?

Open a browser and enter your Ubuntu server’s IP address or configured domain name. If DNS and Apache are configured correctly, the GLPI login page will appear.

6. What should I do if GLPI shows a PHP extension error?

Check the missing extension named in the installation wizard. Install its matching PHP package, restart or reload Apache, and refresh the installation page. Also verify that the Apache PHP version matches the PHP version used by your command-line interface.

7. How do I update GLPI on Ubuntu?

Before updating, back up the database, configuration, application data, and plugins. Download the appropriate stable release, follow GLPI’s official upgrade procedure, and run the required database migration. Test major upgrades in a separate environment whenever possible.

Final Words

Installing GLPI on Ubuntu is a practical way to organize your IT assets, manage support tickets, and keep track of your organization’s technology infrastructure.

By setting up Apache, PHP, and MariaDB correctly, downloading the official GLPI release, configuring the web server, and completing the installation wizard, you can get your GLPI environment up and running.

For a successful deployment, pay particular attention to PHP compatibility, database permissions, Apache’s DocumentRoot, and application security. Also, configure HTTPS, scheduled tasks, and regular backups before using GLPI to manage important business information.

Once everything is configured, you can start adding IT assets, creating user accounts, managing support requests, and organizing your IT operations from one central dashboard.

Leave a Reply

Your email address will not be published. Required fields are marked *