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

  1. Install the necessary packages:

    sudo apt-get update
    sudo apt-get install munin munin-node
    
  2. Edit the main configuration file:

    sudo nano /etc/munin/munin.conf
    

    Locate the line [localhost.localdomain], change it to [localhost], and save the file.

  3. 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 ::1 to Allow 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>
    
  4. Restart Apache to apply changes:

    sudo service apache2 restart
    

Installation on CentOS / Rocky Linux / AlmaLinux

  1. Install the packages:

    sudo yum install munin munin-node
    
  2. Prepare the web directory for graphs:

    sudo mkdir -p /var/www/html/munin
    sudo chown munin:munin /var/www/html/munin
    
  3. Modify the Munin configuration:

    sudo nano /etc/munin/munin.conf
    

    Uncomment (remove the #) from the following line:

    htmldir /var/www/html/munin
    
  4. Enable and start the node service:

    sudo systemctl start munin-node
    sudo systemctl enable munin-node
    
  5. Create the Apache configuration:

    sudo nano /etc/httpd/conf.d/munin.conf
    

    Add 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>
    
  6. 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-node on each remote server and add their IP addresses to the /etc/munin/munin.conf file 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!

Need help?Our engineers will help you free of charge with any question in minutesContact us