Self-hosting

GLPI on a VPS: IT asset management and ITIL helpdesk with Docker

Requests come in by email, by phone or in passing in a corridor; the inventory lives in a spreadsheet nobody updates any more. GLPI brings both together: an ITIL service desk that tracks every ticket and an asset inventory fed by agents. This guide installs the official Docker image on a VPS with MariaDB, locks down the factory accounts, publishes GLPI over HTTPS behind nginx, then wires up ticket collection by email and automatic machine inventory.

Deploy on a VPS Cloud →
6 min read4 steps

Orbi AI agentThe contents follow the article; related articles wait at the bottom.

Contents· What GLPI does1/11
  1. 01What GLPI does
  2. 02What GLPI gives you
  3. 03Spreadsheet and shared mailbox, or GLPI on your VPS
  4. 04Prepare the server
  5. 05Install GLPI with Docker Compose
  6. 06Never leave glpi/glpi, tech/tech and the like active
  7. 07Publish GLPI over HTTPS behind nginx
  8. 08Collect tickets by email
  9. 09Inventory machines with the GLPI Agent
  10. 10Backup and upgrade
  11. 11GLPI in one click on ServOrbit

What GLPI does

GLPI is free, open-source software for IT service and asset management. On the service desk side, it tracks tickets with ITIL vocabulary — incidents and requests, then problems and changes —, measures response times with SLAs and keeps answers in a knowledge base. On the asset side, it records computers, network equipment and software, and attaches contracts, suppliers and licences to each device.

GLPI is released under the GPL-3.0 licence and published by Teclib', a French company. It is very widespread in French-speaking companies and public administrations: your technicians may well know it already.

What GLPI gives you

  • A single front door — every request becomes a ticket, with its requester, its technician and its history.
  • Measured commitments — SLAs for time to own and time to resolve, tracked ticket by ticket.
  • An inventory that keeps itself current — the GLPI Agent reports each machine's hardware and software, with no data entry.
  • Context on every ticket — the computer involved, its licences and its maintenance contract, one click away.
  • A knowledge base — recurring fixes, published for technicians or for end users.
  • Your data stays with you — tickets, inventory and attachments remain on your VPS.

Spreadsheet and shared mailbox, or GLPI on your VPS

Scroll the table

Spreadsheet and shared mailboxGLPI on your VPS
Request trackingEmail threads to rereadOne ticket per request, with its status
Who handles itWhoever read the messageAn assigned technician or group
Response timesUnknownSLAs tracked ticket by ticket
Asset inventoryTyped by hand, soon outdatedReported by the GLPI Agent
A machine's historyScatteredTickets, licences and contracts on its record

Prepare the server

An Ubuntu 24.04 VPS with 2 GB of RAM and 2 vCPUs is enough for a small team: GLPI is a PHP application backed by a MariaDB database. Install Docker and the Compose plugin, then point a domain name at the VPS's IP address, for example glpi.example.com: it will carry the HTTPS certificate and the links in notifications.

The official glpi/glpi image is maintained by the GLPI project. Once its five GLPI_DB_* variables are set, it installs the database on first start, then runs GLPI's automatic actions every minute inside the container: no cron job to set up on the host.

Install GLPI with Docker Compose

  1. Prepare the folder and the .env file

    The file holds both MariaDB passwords: the glpi user's and root's.

    mkdir -p /opt/glpi && cd /opt/glpi
    cat > .env <<EOF
    DB_PASSWORD=$(openssl rand -hex 16)
    DB_ROOT_PASSWORD=$(openssl rand -hex 16)
    EOF
    chmod 600 .env
  2. Write the docker-compose.yml file

    Two services: MariaDB and GLPI. GLPI waits until the database is ready, and its port is published on the loopback interface only: nginx alone will face the Internet.

    services:
      db:
        image: mariadb:11.4
        restart: unless-stopped
        environment:
          MARIADB_DATABASE: glpi
          MARIADB_USER: glpi
          MARIADB_PASSWORD: ${DB_PASSWORD}
          MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
        volumes:
          - glpi-db:/var/lib/mysql
        healthcheck:
          test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
          interval: 10s
          retries: 30
      glpi:
        image: glpi/glpi:12.0.2
        restart: unless-stopped
        depends_on:
          db:
            condition: service_healthy
        environment:
          GLPI_DB_HOST: db
          GLPI_DB_PORT: "3306"
          GLPI_DB_NAME: glpi
          GLPI_DB_USER: glpi
          GLPI_DB_PASSWORD: ${DB_PASSWORD}
        ports:
          - "127.0.0.1:8124:80"
        volumes:
          - glpi-data:/var/glpi
    volumes:
      glpi-db: {}
      glpi-data: {}
  3. Start and check

    On first start, the image creates the database schema: allow one to two minutes. GLPI must then answer locally.

    docker compose up -d
    docker compose logs -f glpi
    curl -sI http://127.0.0.1:8124/ | head -n 1
  4. Lock down the factory accounts

    The automatic install creates four accounts with public passwords: glpi/glpi (super-admin), tech/tech, normal/normal and post-only/postonly. Give the glpi account a strong password and disable the other three.

    docker compose exec glpi php bin/console user:reset_password glpi --password='<strong-password>'
    docker compose exec glpi php bin/console user:disable tech
    docker compose exec glpi php bin/console user:disable normal
    docker compose exec glpi php bin/console user:disable post-only

Never leave glpi/glpi, tech/tech and the like active

These credentials are public: anyone can try them on your address. The glpi account has every right, configuration, tickets and inventory included. Lock down all four factory accounts before opening the reverse proxy, then create one named account per technician under Administration, Users.

Publish GLPI over HTTPS behind nginx

Get a certificate with certbot (certbot certonly --nginx -d glpi.example.com), then declare a server block that forwards the X-Forwarded-Proto header:

server {
    listen 443 ssl;
    server_name glpi.example.com;
    ssl_certificate     /etc/letsencrypt/live/glpi.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/glpi.example.com/privkey.pem;
    client_max_body_size 100m;

    location / {
        proxy_pass http://127.0.0.1:8124;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
    }
}

Then declare the public URL: GLPI writes it into the links of its notifications and of tickets created by email.

docker compose exec glpi php bin/console config:set url_base https://glpi.example.com

Collect tickets by email

Create a dedicated mailbox, for example [email protected], reachable over IMAP. Under Setup, Receivers, add a receiver: IMAP server, port, SSL encryption, and the mailbox's login and password. Every incoming message becomes a ticket with the sender as requester, and a reply to a notification is added to the existing ticket instead of opening a new one.

Checking the mailbox is one of GLPI's automatic actions: the image already runs them every minute, so there is nothing to schedule. For notifications to go out, also set an SMTP server under Setup, Notifications.

Inventory machines with the GLPI Agent

Under Administration, Inventory, enable the inventory. Then install the GLPI Agent on every workstation and server — MSI installer on Windows, package on Linux and macOS — and point it at your instance:

glpi-agent --server https://glpi.example.com/

This command sends a first inventory: the machine shows up under Assets, Computers, with its processor, memory, disks, operating system and installed software. Put the same address in the server option of the agent's configuration: its service will then send the inventory at regular intervals, with no action on your part.

Backup and upgrade

All of GLPI's state lives in two places: the MariaDB database and the glpi-data volume, which holds GLPI's configuration and files, attachments included.

cd /opt/glpi
docker compose exec -T db sh -c 'mariadb-dump -uroot -p"$MARIADB_ROOT_PASSWORD" glpi' | gzip > glpi-$(date +%F).sql.gz
docker run --rm -v glpi_glpi-data:/src -v "$PWD:/dst" alpine \
  tar czf /dst/glpi-data-$(date +%F).tar.gz -C /src .

To upgrade, back up first, change the image tag in docker-compose.yml, then run docker compose pull && docker compose up -d. On restart, the image applies the database schema update itself: GLPI_SKIP_AUTOUPDATE defaults to false.

GLPI in one click on ServOrbit

The ServOrbit Marketplace installs exactly this stack: the official glpi/glpi image and MariaDB, port published on 127.0.0.1 only, HTTPS on a subdomain of your domain or on the VPS's free subdomain, of the form glpi.<identifier>.servorbit-dns.com — no need to buy a domain. The glpi account's password is replaced with a generated one, shown in your client area; the tech, normal and post-only accounts are disabled and the public URL is declared.

Share this articleservorbit.com/ma-en/blog/self-host-glpi-vps-itsm-asset-management

Your service desk on your VPS

Prices shown excluding VAT, with their renewal price.