How to Install Statping on Ubuntu 20.04
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:
- Deploy a fresh Ubuntu 20.04 server. It's not recommended to install Statping on the same server you monitor because if the server goes down, you will not receive any alerts. Be sure to deploy a fresh server dedicated to running the service.
- Set up a domain pointing to the server.
- Use SSH to access the server.
- Login as a non-root user with sudo rights.
- Install Nginx.
1. Installation
Using Snap
The easiest way to install Statping is through the Snapcraft manager. Install the application by running the following command.
$ sudo snap install statping-ng
Start Statping.
$ sudo snap start statping-ng
Enable Statping to start at boot time.
$ sudo systemctl enable snap.statping-ng.statping.service
Check the service status to verify that Statping is running.
$ sudo systemctl status snap.statping-ng.statping.service
Using Docker
Pull the Statping-ng image from Docker hub.
$ sudo docker pull adamboutcher/statping-ng
Create the Statping container running on port
8080
.$ sudo docker run -it -d --name statping -p 8080:8080 adamboutcher/statping-ng
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
Create a new Nginx configuration file.
$ sudo touch /etc/nginx/conf.d/statping.conf
Using a text editor of your choice, edit the configuration file.
$ sudo vim /etc/nginx/conf.d/statping.conf
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.
Test the Nginx configuration for errors.
$ sudo nginx -t
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.
Allow Nginx to send traffic on HTTP port
80
.$ sudo ufw allow 80/tcp
Allow HTTPS traffic on port
443
.$ sudo ufw allow 443/tcp
Restart the firewall.
$ sudo ufw reload
For more information on configuring UFW, please visit the following article:
4. Setup SSL
Install the Certbot Let's Encrypt Client.
$ sudo snap install --classic certbot
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
Restart Nginx to save changes.
$ sudo systemctl restart nginx
5. Test
Visit your configured server domain name.
https://statping.example.com
In the open Statping configuration screen, complete the following steps.
Enter your preferred Statping web page title in the Status Page Name field.
Enter a Description for your Statping application.
Enter your configured server domain name in the Domain field.
Create a new Administrator Username assigned with a strong Password.
Enter your email address in the Email field and toggle Newsletter field if you wish to receive update emails from Statping.
Click Save Settings to finish the setup process.
On the main Statping status page, click Dashboard to log in with your administrator account.
Navigate to Services to create new websites and applications to track.
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.