How To Install Nagios on Ubuntu 20.04 LTS

Install Nagios on Ubuntu 20.04

In this tutorial we will show you how to install Nagios on Ubuntu 20.04 LTS. For those of you who didn’t know, Nagios is an open source monitoring tool used to monitor different Linux Machines or different client hosts. It monitors the HTTP, FTP, SSH, SMTP etc along-with the CPU usage, RAM, Disk Usage and different process that are being running.

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 Nagios on a Ubuntu 20.04 (Focal Fossa) server.

Install Nagios on Ubuntu 20.04 LTS Focal Fossa

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

Step 2. Create users and Groups.

Add the user to the Apache web server group:

Step 3. Installing Nagios on Ubuntu 20.04.

Now, download the Nagios from official page or you can get it by the below command through terminal:

Then, Compile the Nagios from the source code:

Step 4. Configure Nagios.

Nagios places configuration files in the /usr/local/nagios/etc directory. Now, with the help of your favorite editor edit the file:

Change the email address field to receive the notification:

Step 5. Installing Nagios Web Interface.

Install the Nagios web interface using the below command:

Then create a user account as “nagiosadmin” for accessing the Nagios web interface. Make sure to save the password you provided on safe place or keep in mind as it will be needed later:

After it run the below command:

Next, Restart Apache for the changes to take effect:

Step 6. Installing Nagios Plugin.

Next steps, Download latest nagios-plugins source and install using following commands:

Compile and install the plugins:

Step 7. Starting Nagios on Ubuntu 20.04.

Double check the configuration done above by hitting the given command and make sure all configuration pre-checks are okay:

Then, enable Nagios service to start automatically at system startup:

Step 8. Accessing Nagios.

Nagios will be available on HTTP port 80 by default. Open your favorite browser and navigate to or http://your-server-ip/nagios and complete the required the steps to finish the installation. When prompted for username and password you will introduce the username “nagiosadmin” and the password that you entered in step 5.

Install Nagios on Ubuntu 20.04

Congratulation’s! You have successfully installed Nagios. Thanks for using this tutorial for installting Nagios monitoring tool in Ubuntu 20.04 LTS (Focal Fossa) systems. For additional help or useful information, we recommend you to check the official Nagios 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 a best deal!