In this guide, we'll walk you through setting up GLPI (Gestionnaire Libre de Parc Informatique) using Docker. This powerful tool allows you to manage your IT assets and support requests efficiently. We'll cover everything from the initial setup to configuring email notifications and cron jobs.
Before you begin, ensure you have Docker and Docker Compose installed on your system. If you haven’t installed them yet, refer to the official Docker documentation for installation instructions.
Create a directory for GLPI:
mkdir glpiPull the GLPI Docker image:
docker pull diouxx/glpiCreate a docker-compose.yml file:
touch docker-compose.ymldocker-compose.yml
Open the docker-compose.yml file in a text editor and add the following configuration:
version: "3.2"
services:
# MariaDB Container
mariadb:
image: mariadb:10.7
container_name: mariadb
hostname: mariadb
volumes:
- /var/lib/mysql:/var/lib/mysql
env_file:
- .mariadb.env
restart: always
# GLPI Container
glpi:
image: diouxx/glpi
container_name: glpi
hostname: glpi
ports:
- "3001:80"
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/www/html/glpi/:/var/www/html/glpi
environment:
- TIMEZONE=America/Los_Angeles
restart: always
Create a .mariadb.env file for MariaDB settings:
sudo nano .mariadb.env
Add the following configuration, replacing YOURPASSWORDHERE with your chosen password:
MARIADB_ROOT_PASSWORD=YOURPASSWORDHERE
MARIADB_DATABASE=glpidb
MARIADB_USER=glpidatabseuser
MARIADB_PASSWORD=YOURPASSWORDHERE
Run the following command to start the Docker containers in detached mode:
sudo docker-compose up -dAccess the MariaDB container:
sudo docker exec -it mariadb shSwitch to the root user:
su rootRun the following commands to enable timezone support:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -p -u root mysql
mysql -u root -p
GRANT SELECT ON mysql.time_zone_name TO 'glpidatabseuser'@'%';
flush privileges;
exitRestart the containers:
sudo docker-compose restartEnable timezone in GLPI:
sudo docker exec -it glpi sh
su root
php /var/www/html/glpi/bin/console glpi:database:enable_timezonesTo allow users to create tickets via email, follow these steps:
[email protected]) using Google Workspace.Go to Setup > Receivers.
Click the plus button and enter:
Name: [email protected]
Server: imap.gmail.com
Connection options: IMAP, SSL, NO-TLS, NO-VALIDATE-CERT.
Port: 993
Login: [email protected]
Password: xxxxxx
Click + Add button.
[email protected] and checking the inbox. Then click the Get email tickets now button in GLPI.To configure automatic email notifications for users:
Configure email settings:
Administrator email: your email address
Administrator name: your name
From email: [email protected]
From name: Helpdesk
Reply to address: [email protected]
Reply to name: Helpdesk
No-Reply address: [email protected]
No-Reply name: Do not reply
Way of sending emails: SMTP+SSL
Check certificate: No
SMTP host: smtp.gmail.com
Port: 465
SMTP login: [email protected]
SMTP password: xxxxx
Click Save.To automate tasks in GLPI, configure cron jobs:
Access your hosting control panel and configure a new cron job:
Command: php /path_to_your_root_directory/front/cron.php
Interval: */1 * * * *This configuration runs the cron job every minute, which is useful for testing.
To configure OAUTH with Office 365: