Why Choose Uptime Kuma?

In the world of website monitoring, Uptime Kuma stands out as a powerful open-source solution that puts you in control. Unlike cloud-based services, this self-hosted tool gives you complete privacy and customization while monitoring your web services, servers, and APIs. With its clean dashboard and extensive notification options, you’ll always know the status of your critical infrastructure.

1. Setting Up the Foundation: Node.js Installation

Since Uptime Kuma is built on Node.js, we first need to set up the runtime environment:

Add the NodeSource repository for stable Node.js versions
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -

# Install Node.js and npm
sudo apt-get install -y nodejs

# Verify successful installation
node -v
npm -v

2. Deploying Uptime Kuma

With Node.js ready, let’s install the monitoring solution:

# Clone the official repository
git clone https://github.com/louislam/uptime-kuma.git

# Navigate to project directory
cd uptime-kuma

# Install dependencies and prepare the application
npm run setup

3. Ensuring Reliability with PM2

To keep Uptime Kuma running continuously, we’ll use PM2 as our process manager:

# Install PM2 globally
sudo npm install pm2 -g

# Add log rotation to prevent disk space issues
pm2 install pm2-logrotate

# Launch Uptime Kuma through PM2
pm2 start server/server.js --name uptime-kuma

# Configure automatic startup on boot
pm2 startup
pm2 save

4. Web Access via Nginx Reverse Proxy

Make your monitoring dashboard securely accessible through a web interface:

# Install Nginx web server
sudo apt install nginx -y

# Create configuration file
sudo nano /etc/nginx/sites-available/uptime-kuma

Add this configuration (customize with your domain):

server {
    listen 80;
    server_name status.yourdomain.com;

    location / {
        proxy_pass http://127.0.0.1:3001;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # WebSocket support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Then enable the configuration:

# Create symbolic link
sudo ln -s /etc/nginx/sites-available/uptime-kuma /etc/nginx/sites-enabled/

# Test configuration
sudo nginx -t

# Reload Nginx
sudo systemctl reload nginx

5. Securing Your Installation (Recommended)

For production use, consider these additional steps:

# Install Let's Encrypt SSL certificate
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d status.yourdomain.com

# Configure firewall
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable

Accessing Your Monitoring Dashboard

Navigate to your configured domain (like https://status.yourdomain.com) to complete setup:

  1. Create your admin account
  2. Configure your first monitor
  3. Set up notification methods (Email, Telegram, Slack, etc.)
  4. Customize your dashboard

Maintenance Tips

  • Updates: Regularly pull the latest changes from GitHub and rerun npm run setup
  • Backups: Backup the uptime-kuma/data directory regularly
  • Monitoring: Consider monitoring Uptime Kuma itself with a second instance

Final Thoughts

You’ve now deployed a powerful, self-hosted monitoring solution that rivals commercial alternatives. Uptime Kuma’s active development community ensures regular updates with new features. Enjoy the peace of mind that comes with knowing you’ll be the first to know about any service interruptions.

For advanced configuration options, check these resources: