Installing a Simple Icinga2 Instance with Docker

In modern IT infrastructure, a reliable monitoring system is essential. Icinga2 is a powerful open-source solution perfect for this task. This article will show you how to install a simple Icinga2 instance using Docker and Docker Compose on Ubuntu 24.04.

Prerequisites

Before we begin, ensure you have:

  • Ubuntu 24.04 Server
  • Docker

If you haven’t installed Docker yet, you can do so with the following command:

curl -fsSL https://get.docker.com | sudo sh

Step 1: Create Project Directory

First, create a directory for your Icinga2 project:

mkdir ~/icinga2-docker
cd ~/icinga2-docker

Step 2: Create Docker Compose File

Create a docker-compose.yml file in this directory:

vi docker-compose.yml

Add the following content to the file:

version: '3.7'

services:
icinga2:
image: icinga/icinga2:latest
ports:
- "5665:5665"
volumes:
- ./icinga2-data:/data

icingaweb2:
image: icinga/icingaweb2:latest
ports:
- "8080:80"
volumes:
- ./icingaweb2-data:/data
depends_on:
- icinga2

networks:
default:
name: icinga-network

This configuration creates two containers: one for Icinga2 and one for IcingaWeb2.

Step 3: Run Docke

Start the containers with the following command:

docker compose up -d

Step 4: Configure Icinga2

Access the Icinga2 container and perform basic configuration:

docker exec -it icinga2-docker_icinga2_1 /bin/bash
icinga2 node setup --master
icinga2 feature enable api
exit
docker compose restart icinga2

Step 5: Set Up IcingaWeb2

Generate a setup token for IcingaWeb2:

docker exec -it icinga2-docker_icingaweb2_1 icingacli setup token create

Note down the generated token.

Step 6: Access IcingaWeb2

Open your web browser and navigate to http://your-server-ip:8080. Use the generated token to complete the setup.

Conclusion

You have now successfully installed a simple Icinga2 instance with Docker Compose on Ubuntu 24.04. This configuration provides a solid foundation for your network monitoring. For production environments, we recommend additional security and configuration steps.

Icinga2 is a powerful tool that helps you effectively monitor your IT infrastructure. With this Docker-based installation, you can quickly get started and leverage the benefits of container technology.

If you need assistance with your Icinga2 monitoring, please don’t hesitate to contact us.

Is Icinga2 too complex for you, and you don’t have time to maintain the configuration yourself? Then check out our SAAS monitoring product ADMIN-BOX on our website www.admin-box.de.

If you’re interested in more Icinga2 blog posts, head this way!