As a developer, there's nothing worse than finding out from an angry user that your website is down. Usually, you don't know your server crashed until someone complains.
And while many SaaS tools can monitor your site, they often charge high monthly fees for simple alerts.
My goal with this article is to help you stop paying those expensive fees by showing you a powerful, free, open-source alternative called Uptime Kuma.
In this guide, you'll learn how to use Docker to deploy Uptime Kuma safely on a local Ubuntu machine.
By the end of this tutorial, you'll have set up your own private server monitoring dashboard in less than 10 minutes and created an automated Discord alert to ping your phone if your website goes offline.
Table of Contents
Prerequisites
Before you start, make sure you have:
An Ubuntu machine (like a local server, VM, or desktop).
Docker and Docker Compose installed.
Basic knowledge of the Linux terminal.
Step 1: Update Packages and Prepare the Firewall
First, you'll want to make sure your system has the newest updates. Then, you'll install the Uncomplicated Firewall (UFW) and open the network "door" (port) that Uptime Kuma uses for the dashboard. You'll also need to allow SSH so you don't lock yourself out.
Run these commands in your terminal:
- Update your packages:
sudo apt update && sudo apt upgrade -y
- Install the firewall:
sudo apt install ufw -y
- Allow SSH and open port 3001:
sudo ufw allow ssh
sudo ufw allow 3001/tcp
- Enable the firewall:
sudo ufw enable
sudo ufw reload
Step 2: Create the Docker Compose File
Using a docker-compose.yml file is the professional way to manage Docker containers. It keeps your setup organised in one single place.
To start, create a new folder for your project and enter it:
mkdir uptime-kuma && cd uptime-kuma
Then create the configuration file:
nano docker-compose.yml
Paste the following code into the editor:
services:
uptime-kuma:
image: louislam/uptime-kuma:2
restart: unless-stopped
volumes:
- ./data:/app/data
ports:
- "3001:3001"
Note: The ./data:/app/data line is very important. It saves your database in a normal folder on your machine, making it easy to back up later.
Finally, save and exit: Press CTRL + X, then Y, then Enter.
Step 3: Start the Application
Now, tell Docker to read your file and start the monitoring service in the background.
docker compose up -d
How to verify: Docker will download the files. When it finishes, your terminal should print Started uptime-kuma.
Step 4: Access the Dashboard
To access the dashboard, first open your web browser and go to http://localhost:3001 (or your machine's local IP address).
When asked to choose the database, select SQLite. It's simple, fast, and requires no extra setup.
Then create an account and choose a secure admin username and password.
Step 5: Use Case – Monitor a Website and Send Discord Alerts
Now you'll put Uptime Kuma to work by monitoring a live website and setting up an alert. Just follow these steps:
Click Add New Monitor.
Set the Monitor Type to
HTTP(s).Give it a Friendly Name (e.g., "My Blog") and enter your website's URL.
Pro-Tip: How to Fix "Down" Errors (Bot Protection)
If your site uses strict security, it might block Uptime Kuma and say your site is "Down" with a 403 Forbidden error.
The Fix: Scroll down to Advanced, find the User Agent box, and paste this text to make Uptime Kuma look like a normal Chrome browser:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Add a Discord Alert
To get a message on your phone when your site goes down:
On the right side of the monitor screen, click Setup Notification.
Select Discord from the dropdown list.
Paste a Discord Webhook URL (you can create one in your Discord server settings under Integrations).
Click Test to receive a test ping, then click Save.
Conclusion
Congratulations! You just took control of your server health. By deploying Uptime Kuma, you replaced an expensive SaaS subscription with a powerful, free monitoring tool that alerts you the second a project goes offline.
Let’s connect! I am a developer and technical writer specialising in writing step-by-step guides and workflows. You can find my latest projects on my Technical Writing Portfolio or reach out to me directly on LinkedIn.