How To Install Icinga 2 on Debian 10

Install Icinga 2 on Debian 10

In this tutorial, we will show you how to install Icinga 2 on Debian 10. For those of you who didn’t know, Icinga 2 is a free, open-source, and most widely used monitoring system that can be used to monitor the health of networked hosts and services. With Icinga 2 you can monitor CPU load, Memory usage, Disk usage, IMAP, POP3, SMTP, HTTP, Routers, Switches, and many more.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation of the Icinga 2 monitoring server on a Debian 10 (Buster).

Install Icinga 2 on Debian 10 Buster

Step 1. Before running the tutorial below, it’s important to make sure your system is up to date by running the following apt commands in the terminal:

sudo apt update
sudo apt install apt-transport-https wget gnupg

Step 2. Installing LAMP stack.

A Debian 10 LAMP server is required. If you do not have LAMP installed, you can follow our guide here.

Step 3. Installing Icinga 2 on Debian 10.

Now we add the Icinga repository to our system:

wget -O - https://packages.icinga.com/icinga.key | apt-key add -
echo "deb https://packages.icinga.com/debian icinga-buster main" > /etc/apt/sources.list.d/icinga.list
echo "deb-src https://packages.icinga.com/debian icinga-buster main" >> /etc/a

Then, you can install it using the following command:

sudo apt update
sudo apt install icingaweb2 icingacli

Once all the packages are installed, start the Icinga 2 service and enable it to start after system reboot with the following command:

sudo systemctl start icinga2
sudo systemctl enable icinga2

Step 4. Configure MariaDB and IDO Modules.

Now we install IDO modules on your system. You can install them by running the following command:

sudo apt install icinga2-ido-mysql

Install Icinga 2 on Debian 10

Next, select yes and hit enter. You will be prompt to configure the database  icinga2-ido-mysql with dbconfig-common as shown in the following screen:

Install Icinga 2 on Debian 10

Next, you will need to create a database and user for Icinga. First, log in to the MariaDB shell with the following command:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

Next, we will need to log in to the MariaDB console and create a database for Icinga 2. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Icinga 2 installation:

MariaDB [(none)]> create database icingaweb2;
MariaDB [(none)]> grant all privileges on icingaweb.* to icingaweb2@localhost identified by 'icinga123';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

Step 5. Installing Icinga 2 Web.

Now we install Icinga Web 2 using the following commands:

sudo apt install icingaweb2

Then, create a system group for Icinga web 2:

addgroup --system icingaweb2
usermod -a -G icingaweb2 www-data

Next, you will need to generate a new setup token for Icinga Web 2:

icingacli setup config directory --group icingaweb2
icingacli setup token create

Output:

36ab1012042gdtb9c

Finally, restart the Apache and Icinga2 service to apply all the configuration changes:

sudo systemctl restart apache2
sudo systemctl restart icinga

Step 6. Accessing Icinga 2 Web Interface.

Icinga2 will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://your-ip-address/icingaweb2/setup and complete the required steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Install Icinga 2 on Debian 10

Congratulations! You have successfully installed Icinga. Thanks for using this tutorial for installing the latest version of the Icinga 2 monitoring server on the Debian system. For additional help or useful information, we recommend you check the official Icinga website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!