How to Install Statping on Ubuntu 20.04

Updated on July 25, 2024
How to Install Statping on Ubuntu 20.04 header image

Introduction

Statping is an open-source uptime monitor that keeps track of your websites and applications hosted on multiple servers. It works by fetching your application's real-time data and displaying its status on a simple web dashboard. This guide explains how you can install Statping and keep track of multiple web applications on Ubuntu 20.04.

Prerequisites

Before your start, make sure you:

1. Installation

Using Snap

  1. The easiest way to install Statping is through the Snapcraft manager. Install the application by running the following command.

     $ sudo snap install statping-ng
  2. Start Statping.

     $ sudo snap start statping-ng
  3. Enable Statping to start at boot time.

     $ sudo systemctl enable snap.statping-ng.statping.service
  4. Check the service status to verify that Statping is running.

     $ sudo systemctl status snap.statping-ng.statping.service

Using Docker

  1. Pull the Statping-ng image from Docker hub.

     $ sudo docker pull adamboutcher/statping-ng
  2. Create the Statping container running on port 8080.

     $ sudo docker run -it -d --name statping -p 8080:8080 adamboutcher/statping-ng
  3. Verify that the container is running.

     $ sudo docker ps

    Output:

     CONTAINER ID   IMAGE                      COMMAND                  CREATED          STATUS                    PORTS                                       NAMES
     bee9c7ee2c3e   adamboutcher/statping-ng   "/bin/sh -c 'statpin…"   11 minutes ago   Up 11 minutes (healthy)   0.0.0.0:8080->8080/tcp, :::8080->8080/tcp   statping

2. Configure Nginx as a Reverse Proxy

  1. Create a new Nginx configuration file.

     $ sudo touch /etc/nginx/conf.d/statping.conf
  2. Using a text editor of your choice, edit the configuration file.

     $ sudo vim /etc/nginx/conf.d/statping.conf
  3. Add the following contents to the file. Replace statping.example.com with your domain name.

      server {
           listen 80;
           listen [::]:80;
    
           server_name statping.example.com;
    
           access_log /var/log/nginx/statping.access;
           error_log /var/log/nginx/statping.error;
    
    
           location / {
             proxy_pass http://localhost:8080;
             proxy_set_header Host $host;
             proxy_set_header X-Real-IP $remote_addr;
    
           }
       }

    Save the file.

  4. Test the Nginx configuration for errors.

     $ sudo nginx -t
  5. Restart Nginx to save changes.

     $ sudo systemctl restart nginx

3. Security

By default, Uncomplicated Firewall (UFW) is active on Ubuntu 20.04. Configure it to allow web access to the server.

  1. Allow Nginx to send traffic on HTTP port 80.

     $ sudo ufw allow 80/tcp
  2. Allow HTTPS traffic on port 443.

     $ sudo ufw allow 443/tcp
  3. Restart the firewall.

     $ sudo ufw reload

For more information on configuring UFW, please visit the following article:

4. Setup SSL

  1. Install the Certbot Let's Encrypt Client.

     $ sudo snap install --classic certbot
  2. Request a new Let's Encrypt SSL certificate. Replace statping.example.com with your domain name.

     $ sudo certbot -d statping.example.com -m user@example.com --agree-tos
  3. Restart Nginx to save changes.

     $ sudo systemctl restart nginx

5. Test

  1. Visit your configured server domain name.

     https://statping.example.com  
  2. In the open Statping configuration screen, complete the following steps.

    Statping configuration screen

  3. Enter your preferred Statping web page title in the Status Page Name field.

  4. Enter a Description for your Statping application.

  5. Enter your configured server domain name in the Domain field.

  6. Create a new Administrator Username assigned with a strong Password.

  7. Enter your email address in the Email field and toggle Newsletter field if you wish to receive update emails from Statping.

  8. Click Save Settings to finish the setup process.

  9. On the main Statping status page, click Dashboard to log in with your administrator account.

  10. Navigate to Services to create new websites and applications to track.

    Add Statping services

Next Steps

You have successfully installed Statping on a Ubuntu 20.04 server. Please visit the following articles to create Statping email notifiers and set up web applications to track on other servers.