How To Install Monit on Ubuntu 20.04 LTS

Install Monit On Ubuntu 20.04

In this tutorial, we will show you how to install Monit on Ubuntu 20.04 LTS. For those of you who didn’t know, Monit is an open-source program used to monitor services on Linux systems and ensure they are always online. Monit supervises the processes and restarts them on failure detection. Apart from the processes, Monit can also be used to monitor CPU, RAM, Disk, File Size, and trigger alerts on out-of-bound values. It also shows how to trigger alert emails using custom templates.

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 Monit on Ubuntu 20.04 (Focal Fossa). You can follow the same instructions for Ubuntu 18.04, 16.04, and any other Debian-based distribution like Linux Mint.

Install Monit on Ubuntu 20.04 LTS Focal Fossa

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

sudo apt update
sudo apt upgrade

Step 2. Installing Monit on Ubuntu 20.04.

By default, Monit is available in the Ubuntu 20.04 default repository. You can install it using the following command below:

sudo apt install monit

Once installed, the Monit service will be started automatically. You can check the status of Monit with the following command:

sudo systemctl status monit

Step 3. Enable Monit HTTP interface.

By default, the Monit web interface is disabled, so you will need to enable it and set the admin password. You can do this by editing the file /etc/monit/monitrc.

nano /etc/monit/monitrc

Uncomment and set the Monit admin password as shown below:

set httpd port 2812 and
allow admin:adminpassword

Save and close the editor. Now restart Monit using the command:

sudo monit -t
sudo systemctl restart monit

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

Step 4. Accessing Monit Web Interface.

Now, open your web browser and access the Monit web interface using the URL http://your-server-ip-address:2812. You should see the Monit login page. Log in with the username as “admin” and password as “monit”.

Install Monit on Ubuntu 20.04

Congratulations! You have successfully installed Monit. Thanks for using this tutorial for installing Monit on Ubuntu 20.04 LTS Focal Fossa system. For additional help or useful information, we recommend you check the official Monit 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!