How I Monitor Website with Uptime Kuma
Yogesh Kumar
DevOps Engineer | AWS | Azure | CI/CD | Docker | K8s | Linux OS | Deployment | Terraform | Grafana & Prometheus
Why Uptime Kuma
Uptime Kuma is an open-source monitoring tool.?It enables you to monitor services over HTTP/S, TCP, DNS, and other protocols. You can receive notification alerts of downtime and even create custom status pages for your users.
Uptime Kuma Features
In this guide, you will learn how to install Uptime Kuma self-hosted monitoring tool and how you can monitor websites using the tool.
Installation
For demonstration, we will install the?Uptime Kuma Monitoring?tool on?Ubuntu 22.04
Docker
To run Uptime Kuma with Docker, use the following ???? command to run Uptime Kuma as a Docker container.
docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:1
Uptime Kuma is now running on ?https://localhost:3001 or https://server-ip:3001
Non-Docker
Step 1: Installing Node.JS >= 14 and npm >= 7
Log into your server and update the local package index to get started.
sudo apt update
From your home directory, use?curl?to retrieve the installation script for your preferred version, making sure to replace?14.x?with your preferred version string (if different).
cd
curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh;
You can inspect the contents of the downloaded script with?nano?(or your preferred text editor):
nano nodesource_setup.sh
If you are satisfied that the script is safe to run, exit your editor, then run the script with?sudo:
sudo bash nodesource_setup.sh
You can now install the Node.js package. It may be a good idea to fully remove your older Node.js packages before installing the new version, by using?sudo apt remove nodejs npm. This will not affect your configurations at all, only the installed versions.
sudo apt install nodejs
Check that the installation was successful by querying?node?for its version number:
node -v
The NodeSource?nodejs?package contains both the?node?binary and?npm, so you don’t need to install?npm?separately.
If you have to update your npm to the latest version use this command
领英推荐
npm install npm -g
Step 2: Install pm2 to run Uptime Kuma in the background
PM2?is a production process manager for?NodeJS?applications that provide a load balancer and helps keeps applications alive indefinitely and reload them without any interruption or service downtime.
sudo npm install pm2@latest -g
Step 3: Install Uptime Kuma
Once?Node.JS, npm & Pm2 is installed, you can now proceed to install the?Uptime Kuma?monitoring tool. First, clone the?Uptime Kuma?repository from?GitHub
git clone https://github.com/louislam/uptime-kuma.git
Now, navigate to the?Uptime Kuma?directory
cd uptime-kuma/
Then, set up the Uptime Kuma using the following command:
npm run setup
Now, Everything is in your hand. You have to run the Uptime Kuma with PM2.
Run Uptime Kuma with pm2
Run the Uptime Kuma with?pm2?daemon as shown.
pm2 start npm --name uptime-kuma -- run start-server -- --port=3001 --hostname=127.0.0.1
Now, You'll see the following screen as output. Means Kuma is ready to use.
Setup Uptime Kuma
To access the Uptime Kuma dashboard open your browser and visit for your domain name and public IP address.
https://serverip:3001
or
https://domain-name
The?WebUI?will appear as shown and you will be required to create an?Admin?account. Therefore, provide the username and password and click ‘Create’ to create an Administrator account.
This will log you into Uptime Kuma’s dashboard. To start monitoring a website, click the Add New Monitor button. Fill out the details of the site that you want to monitor.
There are lots of settings you can configure, like Certificate Expiry Notification, and Accepted Status Codes.
Also, you can setup notification alerts. It'll send you a notification on your preferred Notification Type when your service may be down.
And that’s it! We have successfully installed and configured?Uptime Kuma?and managed to monitor a website. Your feedback on this guide is welcome.