How To Install Monit on Ubuntu 16.04 LTS

Install Monit on Ubuntu 16.04 LTS

In this tutorial we will show you how to install and configuration Monit on Ubuntu 16.04 LTS server. For those of you who didn’t know, Monit is a opensource process tool for Linux operating system which helps you to monitor system process using web browser and also when ever requires it automatically do the maintenance or repair of particular process in such a way that it can be brought back online. The monitoring can be directly on the command line or on the web. You can assign Monit multiple tasks (not only monitoring), so if a certain service fails the check, Monit can alert or do something about it (try to restart the service for example).

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 Monit monitoring tool on a Ubuntu 16.04 (Xenial Xerus) server.

Install Monit on Ubuntu 16.04 LTS

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

Step 2. Installing Monit and Apache web server.

Run the following commands in Terminal:

Step 3. Configure Monit monitoring tool.

After the installation is complete, edit the main config file to resemble the example below using your favorite text editor and set your own username and password:

Once you’ve configured it, you need to start the monit service to reload the new configuration settings:

Step 4. Configuring Programs Self Monitoring using Monit.

Once the initial config is completed, we can configure some of the services we want to monitor. To do this, we will create separate files for every service located within the /etc/monit.d/ directory. Following are some useful configuration examples for monit, that can be very helpful to see how a service is running, where it keeps its pidfile and how to start and stop a service etc:

After adding required services in monit monitoring configuration file, Use the below command to verify syntax of file:

Finally, restart monit service:

The configuration file is pretty self-explaining, if you are unsure about an option, take a look at the Monit documentation.

Step 5. Accessing Monit.

Monit will be available on HTTP port 2812 by default. Open your favorite browser and navigate to or http://server-ip:2812 and and then enter the credentials you created in conf above.

Congratulation’s! You have successfully installed Monit. Thanks for using this tutorial for installing Monit monitoring tool on Ubuntu 16.04 LTS  (Xenial Xerus) system. For additional help or useful information, we recommend you to check the official Monit web site.

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 a best deal!