How to install Munin on an Ubuntu 14.04 VPS

munin vpsMunin is an open source system monitoring, network monitoring and infrastructure monitoring application written in Perl, used to monitor the performance of your server, applications and more. Munin uses the RRDtool to create graphs which are accessible over a web browser. Also, Munin can be configured to send alerts when some service/application etc. is not working and Munin will automatically send an additional email alert once the problem has been resolved.
To install Munin on an Ubuntu VPS follow the very easy steps described below.

Make sure your Ubuntu 14.04 Linux VPS is fully up to date using:

apt-get update
apt-get upgrade

Munin requires that Apache2 is installed and running on the VPS you will use for monitoring, so if it is not installed, run the following command to install it:

apt-get install apache2

Install Munin

Install Munin and extra plugins using the following command:

apt-get install munin munin-node munin-plugins-extra

Create a backup of the original Apache configuration file for Munin, or rename it:

mv /etc/munin/apache.conf /etc/munin/apache.conf.orig

Edit the ‘/etc/munin/apache.conf’ configuration file and add the following lines:

vi /etc/munin/apache.conf
<VirtualHost *:80>
      DocumentRoot "/var/cache/munin/www"
      DirectoryIndex index.html

   <Directory "/var/cache/munin/www">
      Options Indexes Includes FollowSymLinks MultiViews
      AllowOverride AuthConfig
      AuthUserFile /etc/munin/htpasswd
      AuthName "munin"
      AuthType Basic
      Require valid-user
      Order allow,deny
      Allow from all

   CustomLog /var/log/apache2/ combined
   ErrorLog /var/log/apache2/

   <Directory "/etc/munin/static">
      Require all granted

   <Directory "/usr/lib/munin/cgi">
      Options +ExecCGI
      Require all granted
   <IfModule mod_fcgid.c>
      SetHandler fcgid-script
   <IfModule !mod_fcgid.c>
      SetHandler cgi-script

Create an output directory for the Munin graphs and data:

mkdir -p /var/cache/munin/www/

The Munin user needs to be able to write to files and directories inside the ‘/var/cache/munin/www’ directory, so it can easily be accomplished by executing the following command:

chown munin:munin -R /var/cache/munin/www

Create a backup of the original Munin configuration file:

cp /etc/munin/munin.conf /etc/munin/munin.conf.orig

Edit the Munin configuration file and add/modify the following lines:

vi /etc/munin/munin.conf
dbdir /var/lib/munin
htmldir /var/cache/munin/www
logdir /var/log/munin
rundir /var/run/munin
tmpldir /etc/munin/templates

includedir /etc/munin/conf.d

graph_strategy cron
cgiurl_graph /munin-cgi/munin-cgi-graph
html_strategy cron

    use_node_name yes

Run the following command to set a password for the Munin administrator user:

htpasswd -c /etc/munin/htpasswd munin

This is important to keep your Munin output directory and the files in it private from search engines and unauthorized users.

Restart Munin and Apache services for the changes to take effect:

service munin-node restart
service apache2 restart

It might take a couple of minutes for Munin to generate the graphs and html files. Then, open Munin at using ‘munin’ as username and the previously generated munin password as password and you will be able to access Munin graphs and data:

munin web interface

That is it. The Munin installation is now complete. Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install Munin for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Install PrestaShop on a CentOS VPS
How to install Logaholic on CentOS
How to secure your LEMP stack
  • Von


    Author Reply

    Thanks for the configuration! Everything works except the scripts.

    • admin


      Author Reply

      What exactly is not working? What error message do you get?

  • Von


    Author Reply

    The cgi-scripts i mean

Free Migration to RoseHosting. Award Winning Linux VPS Hosting with Fully Managed Support. Coupon RHBLOG50 for 50% offOrder Now