Installing and configuring Munin
Guide to setting up the Munin resource monitoring system.
Munin is an efficient and highly popular tool for server monitoring. It collects comprehensive data on system performance—including CPU load, memory usage, disk I/O, network throughput, and service health—presenting it in clear, easy-to-read graphs. The system operates with a simple two-part architecture:
- munin: The central master server that gathers, aggregates, and stores statistics.
- munin-node: A lightweight agent installed on every server you wish to monitor.
Munin polls data every 5 minutes and stores it in RRD (Round Robin Database) format using rrdtool. Because it doesn't require a MySQL database, it is exceptionally resource-efficient and perfect for monitoring VPS and dedicated servers.
Installation on Debian / Ubuntu
-
Install the necessary packages:
sudo apt-get update sudo apt-get install munin munin-node -
Edit the main configuration file:
sudo nano /etc/munin/munin.confLocate the line
[localhost.localdomain], change it to[localhost], and save the file. -
Configure the Apache web interface: Open the configuration file:
sudo nano /etc/apache2/conf-enabled/munin.conf(Note: On newer versions, the path may be
/etc/apache2/conf.d/munin).Change the restriction line
Allow from localhost 127.0.0.0/8 ::1toAllow from all. If the file is missing, create it with the following content:Alias /munin /var/cache/munin/www <Directory /var/cache/munin/www> Order allow,deny Allow from all Options None <IfModule mod_expires.c> ExpiresActive On ExpiresDefault M310 </IfModule> </Directory> ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph <Location /munin-cgi/munin-cgi-graph> Order allow,deny Allow from all <IfModule mod_fastcgi.c> SetHandler fastcgi-script </IfModule> </Location> ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html <Location /munin-cgi/munin-cgi-html> Order allow,deny Allow from all <IfModule mod_fastcgi.c> SetHandler fastcgi-script </IfModule> </Location> -
Restart Apache to apply changes:
sudo service apache2 restart
Installation on CentOS / Rocky Linux / AlmaLinux
-
Install the packages:
sudo yum install munin munin-node -
Prepare the web directory for graphs:
sudo mkdir -p /var/www/html/munin sudo chown munin:munin /var/www/html/munin -
Modify the Munin configuration:
sudo nano /etc/munin/munin.confUncomment (remove the
#) from the following line:htmldir /var/www/html/munin -
Enable and start the node service:
sudo systemctl start munin-node sudo systemctl enable munin-node -
Create the Apache configuration:
sudo nano /etc/httpd/conf.d/munin.confAdd the following content:
Alias /munin /var/www/html/munin <Directory /var/www/html/munin> ExpiresActive On ExpiresDefault M310 </Directory> ScriptAlias /munin-cgi/munin-cgi-graph /var/www/cgi-bin/munin-cgi-graph <Location /munin-cgi/munin-cgi-graph> Order allow,deny Allow from all </Location> -
Restart the web server:
sudo systemctl restart httpd
Accessing your statistics
Once the installation is complete, you can view your monitoring dashboard by visiting:
http://YOUR_SERVER_IP/munin
You will find detailed, real-time visual representations of your CPU, memory, disk, and network performance.
Security and best practices
- Polling interval: Munin updates its graphs every 5 minutes. Be patient if the data doesn't appear immediately after installation.
- Secure your interface: by default, the web interface may be accessible to the public. For better security, we highly recommend setting up Basic Authentication (htpasswd) or restricting access to specific IP addresses.
- Multi-server monitoring: to monitor several nodes from one master server, simply install
munin-nodeon each remote server and add their IP addresses to the/etc/munin/munin.conffile on your central master server.
Help
If you have any questions or need assistance, please contact us through the ticket system — we're always here to help!