DEV Community

Cover image for GLPI with Docker + Portainer: Complete Setup Guide (Self-Hosted IT Asset Management)
Jonas Oliveira
Jonas Oliveira

Posted on • Originally published at tecmestre.com.br

GLPI with Docker + Portainer: Complete Setup Guide (Self-Hosted IT Asset Management)

Why Self-Host GLPI with Docker?

GLPI is one of the best open-source IT asset management tools — it handles inventory, helpdesk, CMDB, and much more. But installing it the traditional way (Apache + PHP + MySQL) is painful to maintain.

Docker solves this:

  • One docker-compose up to deploy everything
  • Easy upgrades (just pull new image)
  • Portainer gives you a web UI to manage containers
  • Isolated environment, no dependency conflicts

In this guide, I'll show you how to deploy GLPI 10.x with Docker Compose, MariaDB, and Portainer — ready for production.


Prerequisites

  • Linux server (Ubuntu 22.04+ recommended) or WSL2 on Windows
  • Docker and Docker Compose installed
  • Portainer (optional but recommended for web management)
  • 2GB RAM minimum, 4GB recommended
# Install Docker (if not already)
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER

# Install Docker Compose
sudo apt install docker-compose-plugin
Enter fullscreen mode Exit fullscreen mode

The Docker Compose Stack

Create a docker-compose.yml:

version: '3.8'

services:
  mariadb:
    image: mariadb:10.11
    container_name: glpi-db
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-StrongRootPass123}
      MYSQL_DATABASE: glpi
      MYSQL_USER: glpi
      MYSQL_PASSWORD: ${DB_PASSWORD:-GlpiPass456}
    volumes:
      - glpi-db-data:/var/lib/mysql
    networks:
      - glpi-net

  glpi:
    image: diouxx/glpi:latest
    container_name: glpi-app
    restart: unless-stopped
    ports:
      - "8080:80"
    environment:
      TIMEZONE: America/Sao_Paulo
    volumes:
      - glpi-data:/var/www/html/glpi
    depends_on:
      - mariadb
    networks:
      - glpi-net

  portainer:
    image: portainer/portainer-ce:latest
    container_name: portainer
    restart: unless-stopped
    ports:
      - "9443:9443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer-data:/data

volumes:
  glpi-db-data:
  glpi-data:
  portainer-data:

networks:
  glpi-net:
    driver: bridge
Enter fullscreen mode Exit fullscreen mode

Deploy

# Create project directory
mkdir ~/glpi-docker && cd ~/glpi-docker

# Save the docker-compose.yml above, then:
docker compose up -d

# Check everything is running
docker compose ps
Enter fullscreen mode Exit fullscreen mode

Access:

  • GLPI: http://your-server:8080
  • Portainer: https://your-server:9443

Initial GLPI Setup

  1. Open http://your-server:8080 in your browser
  2. Select language → Continue
  3. Accept license → Continue
  4. Choose Install
  5. Database connection:
    • Server: mariadb (the container name)
    • User: glpi
    • Password: GlpiPass456
  6. Select the glpi database → Continue
  7. Wait for setup to complete

Default credentials:
| User | Password | Role |
|------|----------|------|
| glpi | glpi | Super-Admin |
| tech | tech | Technician |
| normal | normal | Normal User |
| post-only | postonly | Post-Only |

⚠️ IMPORTANT: Change all default passwords immediately!


Post-Installation Security

# Remove install file (GLPI will warn you about this)
docker exec glpi-app rm /var/www/html/glpi/install/install.php
Enter fullscreen mode Exit fullscreen mode

Upgrading GLPI

One of the biggest advantages of Docker:

cd ~/glpi-docker
docker compose pull
docker compose up -d
Enter fullscreen mode Exit fullscreen mode

Your data persists in Docker volumes — the upgrade is seamless.


Why Not Just Use a SaaS?

GLPI Cloud exists, but:

  • Data sovereignty: Your inventory data stays on YOUR servers
  • Cost: Free for unlimited users/assets (open source)
  • Customization: Full access to plugins, themes, APIs
  • Compliance: Some organizations require on-premise solutions

Next Steps

  • Configure GLPI plugins (FusionInventory for auto-discovery)
  • Set up automated backups with docker exec + mysqldump
  • Add Traefik or Nginx reverse proxy for SSL

I wrote a detailed guide in Portuguese with screenshots and SSL setup: GLPI com Docker no TecMestre.

If you're using Bacula Enterprise for backups, I also have guides on parallel device configuration and cloud migration to OCI.

Happy self-hosting! 🐳

Top comments (0)