### Manual Installation: Clone and Setup Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/🔧-How-to-Install.md This section outlines the steps for manually installing Uptime Kuma. It involves cloning the repository, navigating into the directory, and running the setup script. ```bash git clone https://github.com/louislam/uptime-kuma.git cd uptime-kuma npm run setup ``` -------------------------------- ### Manual Installation: Run Server Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/🔧-How-to-Install.md This command starts the Uptime Kuma server for testing purposes. For production, it is recommended to use PM2 for background execution and process management. ```bash node server/server.js ``` -------------------------------- ### Configure Docker Daemon for Snap Installation Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/How-to-Monitor-Docker-Containers.md For Docker installations via snap, the daemon configuration file is located at a different path. This example shows how to add TCP host configuration to the snap's daemon.json. ```diff { "log-level": "error", "storage-driver": "overlay2", + "hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"] } ``` -------------------------------- ### Install Uptime Kuma via OCI Helm Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/🔧-How-to-Install.md This command installs the Uptime Kuma Helm chart directly from a container registry using the OCI format. This is an alternative to using a Helm repository. ```bash helm install uptime-kuma oci://ghcr.io/helmforgedev/helm/uptime-kuma ``` -------------------------------- ### Start and Enable Uptime Kuma OpenRC Service Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/OpenRC-Script.md Starts the Uptime Kuma service immediately and adds it to the default runlevel for automatic startup on boot. ```bash sudo rc-service uptime-kuma start sudo rc-update add uptime-kuma ``` -------------------------------- ### Systemd Unit File for Uptime-Kuma Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Systemd-Unit-File.md This is a systemd unit file configuration for running Uptime-Kuma as a service. It specifies dependencies, user, working directory, and the command to start the server. Ensure the 'User' and 'WorkingDirectory' match your setup. ```ini [Unit] Description=Uptime-Kuma - A free and open source uptime monitoring solution Documentation=https://github.com/louislam/uptime-kuma After=network.target [Service] Type=simple User=uptime WorkingDirectory=/home/uptime/uptime-kuma ExecStart=/usr/bin/npm run start-server Restart=on-failure [Install] WantedBy=multi-user.target ``` -------------------------------- ### Start Uptime Kuma Stack (Docker Compose) Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Migration-From-v1-To-v2.md Command to start the Uptime Kuma services after updating the Docker Compose configuration. ```bash docker compose up -d ``` -------------------------------- ### Install Uptime Kuma with Helm Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/🔧-How-to-Install.md This command adds the Helmforge Helm repository and installs the Uptime Kuma chart. This method is suitable for Kubernetes deployments. ```bash helm repo add helmforge https://repo.helmforge.dev helm install uptime-kuma helmforge/uptime-kuma ``` -------------------------------- ### Install Cloudflared Service Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reverse-Proxy-with-Cloudflare-Tunnel.md Command to install cloudflared as a service, typically used for Windows installations. Ensure you replace the placeholder token with your actual Cloudflare Tunnel token. ```cmd cloudflared.exe service install eyJhIjoiZDA4ZGNiMTUXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ``` -------------------------------- ### Check Node.js Version Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Migration-From-v1-To-v2.md Command to verify the installed Node.js version, ensuring it meets the minimum requirement of v20.4 for non-Docker installations. ```bash node --version ``` -------------------------------- ### Manual Installation: Run with PM2 Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/🔧-How-to-Install.md This is the recommended method for running Uptime Kuma in production. It uses PM2 to manage the process, ensuring it runs in the background and restarts automatically. PM2 log rotation is also installed. ```bash npm install pm2 -g && pm2 install pm2-logrotate pm2 start server/server.js --name uptime-kuma ``` -------------------------------- ### Update Uptime Kuma (Non-Docker) Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/🆙-How-to-Update.md Update the Uptime Kuma installation from Git, checkout the latest stable tag, install dependencies, download prebuilt assets, and restart the service using PM2. This method is for users who installed Uptime Kuma directly on a server without Docker. ```bash cd # Update from git git fetch --all --tags git checkout 2.4.0 --force # Install dependencies and prebuilt npm install --omit dev --no-audit npm run download-dist # Restart pm2 restart uptime-kuma ``` -------------------------------- ### PM2 Useful Commands Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/🔧-How-to-Install.md These commands provide helpful utilities for managing the Uptime Kuma process when using PM2. `pm2 monit` shows current console output, and `pm2 save && pm2 startup` configures PM2 to start on system boot. ```bash pm2 monit pm2 save && pm2 startup ``` -------------------------------- ### Synology Builtin Reverse Proxy Setup Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reverse-Proxy.md Instructions for configuring Synology's built-in reverse proxy to work with Uptime Kuma. This involves setting up the proxy entry and creating a custom header for WebSockets. ```bash docker run -d --restart=always -p 127.0.0.1:3002:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:2 ``` -------------------------------- ### Example PromQL Queries for Uptime Kuma Metrics Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Prometheus-Integration.md These PromQL queries can be used to retrieve and analyze monitoring metrics from Uptime Kuma. They demonstrate how to group by monitor name and filter by specific URLs or monitor names. ```promql # Show all response rates grouped by site sum(monitor_response_time) by (monitor_name) ``` ```promql # Show only the response time for BBC.co.uk sum(monitor_response_time{monitor_url="https://www.bbc.co.uk/"}) ``` ```promql # Show the current status of Google.com monitor_status{monitor_name="Google"} ``` -------------------------------- ### Install Curl in Uptime Kuma Container Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Troubleshooting.md Install the curl utility within the Uptime Kuma container to test network requests. This is necessary if curl is not already available. ```bash apt update && apt --yes install curl ``` -------------------------------- ### Systemd Commands for Uptime-Kuma Service Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Systemd-Unit-File.md These commands are used to reload systemd's configuration after creating or modifying a unit file, enable the Uptime-Kuma service to start automatically on boot, and start the service immediately. ```bash systemctl daemon-reload systemctl enable --now uptime-kuma ``` -------------------------------- ### OpenLiteSpeed Reverse Proxy Configuration Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reverse-Proxy.md Guide to setting up OpenLiteSpeed as a reverse proxy for Uptime Kuma, including WebSocket proxy configuration. Requires creating a virtual host, external app, and context. ```text Upgrade websocket Connection upgrade ``` -------------------------------- ### Caddy Reverse Proxy Configuration Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reverse-Proxy.md Configure Caddy as a reverse proxy for Uptime Kuma. Supports both standalone and Docker Compose setups. ```nginx subdomain.domain.com { reverse_proxy 127.0.0.1:3001 } ``` ```yaml version: "3" networks: default: name: "proxy_network" services: uptime-kuma: image: louislam/uptime-kuma:2 restart: unless-stopped volumes: - /srv/uptime:/app/data labels: caddy: status.example.org caddy.reverse_proxy: "* {{upstreams 3001}}" caddy: image: "lucaslorentz/caddy-docker-proxy:ci-alpine" ports: - "80:80" - "443:443" volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - /srv/caddy/:/data restart: unless-stopped environment: - CADDY_INGRESS_NETWORKS=proxy_network ``` -------------------------------- ### Update Docker Image Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Test-Pull-Requests.md If you encounter slow performance during `npm install`, update the Docker image to the latest version. ```bash docker pull louislam/uptime-kuma:pr-test2 ``` -------------------------------- ### Test PRs with npx Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Test-Pull-Requests.md Use this command if you have Node.js installed to test a specific pull request repository. ```bash npx kuma-pr # Example: npx kuma-pr Ionys320:fix/maintenance_drift ``` -------------------------------- ### Uptime Kuma .env Configuration Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Environment-Variables.md Define Uptime Kuma host and port using environment variables in a .env file for non-Docker installations. ```env UPTIME_KUMA_HOST=127.0.0.1 UPTIME_KUMA_PORT=8080 ``` -------------------------------- ### Edit Docker Service Startup Configuration Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/How-to-Monitor-Docker-Containers.md If the Docker daemon fails to start after configuration changes, you may need to edit its systemd service file to resolve duplicate properties, such as conflicting host configurations. ```toml [Service] #The blank ExecStart is required to clear the current entry point ExecStart= #Replace the existing ExecStart but only remove the properties that you have added into the daemon.json file, leave all else the same. ExecStart=/usr/bin/dockerd --containerd=/run/containerd/containerd.sock ``` -------------------------------- ### Reset Password Without Docker Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reset-Password-via-CLI.md Navigate to your Uptime Kuma installation directory and run this command to reset the password. ```bash cd to the working directory. npm run reset-password ``` -------------------------------- ### Restart Docker Snap Service Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/How-to-Monitor-Docker-Containers.md Restart the Docker service when installed via snap after modifying its configuration. This command ensures the new settings are applied. ```bash sudo systemctl restart snap.docker.dockerd.service ``` -------------------------------- ### Traefik Reverse Proxy Labels Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reverse-Proxy.md Configure Traefik as a reverse proxy for Uptime Kuma using Docker labels. This setup enables automatic HTTPS with Let's Encrypt. ```yaml labels: - "traefik.enable=true" - "traefik.http.routers.uptime-kuma.rule=Host(`YourOwnHostname`)" - "traefik.http.routers.uptime-kuma.entrypoints=https" - "traefik.http.routers.uptime-kuma.tls=true" - "traefik.http.routers.uptime-kuma.tls.certresolver=myresolver" - "traefik.http.services.uptime-kuma.loadBalancer.server.port=3001" ``` -------------------------------- ### Cloudflare WAF Custom Rule for Header Bypass Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Cloudflare-Side-Note.md This is an example of a Cloudflare WAF Custom Rule expression. It bypasses the JS challenge if the specified `kumaping` header is present and has the correct value. You can extend this rule with `or` conditions to include multiple domains. ```cloudflare-waf (http.host eq "domain1" and all(http.request.headers["kumaping"][*] ne "kuma-qwerty123456")) or (http.host eq "domain2" and all(http.request.headers["kumaping"][*] ne "qwerty123456")) ``` -------------------------------- ### Create OpenRC Init Script for Uptime Kuma Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/OpenRC-Script.md This script defines the Uptime Kuma service for OpenRC, including its description, working directory, PID file, logging, command, user, and dependencies. It also includes pre-start checks and database initialization. ```sh #!/sbin/openrc-run description="Uptime Kuma self-hosted monitoring tool" # Change $directory to path to uptime-kuma directory=${directory:-/usr/share/uptime-kuma} pidfile=${pidfile:-/run/$RC_SVCNAME.pid} log_dir="/var/log/$RC_SVCNAME" logfile=${logfile:-$log_dir/$RC_SVCNAME.log} output_log="${output_log:-$logfile}" error_log="${error_log:-$logfile}" command=${command:-/usr/bin/node} command_args="$directory/server/server.js" command_user=${command_user:-uptime-kuma:uptime-kuma} command_background=true depend() { need net } start_pre() { checkpath --owner=$command_user --directory $log_dir \ $directory/data \ $directory/data/upload checkpath --owner=$command_user --file $logfile \ $directory/data/error.log [ ! -e $directory/data/kuma.db ] && cp $directory/db/kuma.db $directory/data/ checkpath --owner=$command_user --mode 600 --file $directory/data/kuma.db* } start_post() { # Wait for the server to be started sleep 10 } ``` -------------------------------- ### Make OpenRC Init Script Executable Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/OpenRC-Script.md Sets the necessary execute permissions for the Uptime Kuma OpenRC init script. ```bash sudo chmod 755 /etc/init.d/uptime-kuma ``` -------------------------------- ### Monitor Docker Migration Logs Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Migration-From-v1-To-v2.md Command to follow the logs of the Uptime Kuma Docker container to observe the migration process in real-time. ```bash docker logs -f uptime-kuma ``` -------------------------------- ### Test v1.X PRs with Docker Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Test-Pull-Requests.md Use this command to test pull requests specifically for v1.X versions of Uptime Kuma. Replace `` with the target repository and branch. ```bash docker run --rm -it -p 3000:3000 -p 3001:3001 --pull always -e 'UPTIME_KUMA_GH_REPO=' louislam/uptime-kuma:pr-test ``` -------------------------------- ### Monitor Docker Compose Migration Logs Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Migration-From-v1-To-v2.md Command to follow the logs of all services in the current Docker Compose project to observe the migration process. ```bash docker compose logs -f ``` -------------------------------- ### Create Dedicated User and Group for Uptime Kuma Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/OpenRC-Script.md Creates a system user and group named 'uptime-kuma' with a nologin shell and home directory, to run the service securely. ```bash sudo addgroup -S uptime-kuma sudo adduser -S -D -h /var/lib/uptime-kuma -s /sbin/nologin -G uptime-kuma -g uptime-kuma uptime-kuma ``` -------------------------------- ### Update Uptime Kuma Image and Run (Docker) Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Migration-From-v1-To-v2.md Command to update the Uptime Kuma Docker image to v2 and restart the container, initiating the migration. Ensure to replace placeholders with your actual directory and port. ```bash docker run -d --restart=unless-stopped -p :3001 -v :/app/data --name uptime-kuma louislam/uptime-kuma:2 ``` -------------------------------- ### Apache Configuration with SSL Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reverse-Proxy.md This Apache configuration enables SSL for Uptime Kuma, including WebSocket support. It requires Apache 2.4.17 or newer for HTTP/2 protocol support. ```apache ServerName sub.domain.com SSLEngine On SSLCertificateFile /path/to/ssl/cert/crt SSLCertificateKeyFile /path/to/ssl/key/key # Protocol 'h2' is only supported on Apache 2.4.17 or newer. Protocols h2 http/1.1 ProxyPreserveHost on ProxyPass / http://localhost:3001/ RewriteEngine on RewriteCond %{HTTP:Upgrade} =websocket RewriteRule /(.*) ws://localhost:3001/$1 [P,L] RewriteCond %{HTTP:Upgrade} !=websocket RewriteRule /(.*) http://localhost:3001/$1 [P,L] ``` -------------------------------- ### Update Uptime Kuma with Docker Compose Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/🆙-How-to-Update.md Navigate to your Docker Compose directory, pull the latest images, and then recreate the containers to apply the updates. This is a streamlined process for managing Uptime Kuma with Docker Compose. ```bash cd "" docker compose pull docker compose up -d --force-recreate ``` -------------------------------- ### Nginx Configuration with SSL Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reverse-Proxy.md Use this configuration for Nginx when running Uptime Kuma with SSL enabled. Ensure your SSL certificates are correctly configured. ```nginx server { listen 443 ssl http2; # Remove '#' in the next line to enable IPv6 # listen [::]:443 ssl http2; server_name sub.domain.com; ssl_certificate /path/to/ssl/cert/crt; ssl_certificate_key /path/to/ssl/key/key; # *See "With SSL (Certbot)" below for details on automating ssl certificates location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_pass http://localhost:3001/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } ``` -------------------------------- ### Apache Configuration without SSL Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reverse-Proxy.md This Apache configuration is for running Uptime Kuma without SSL. It handles WebSocket connections using RewriteRule directives. ```apache ServerName sub.domain.com ProxyPreserveHost on ProxyPass / http://localhost:3001/ RewriteEngine on RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Connection} upgrade [NC] RewriteRule ^/?(.*) "ws://localhost:3001/$1" [P,L] ``` -------------------------------- ### Test Network Connectivity with Curl and Ping Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Troubleshooting.md Use curl and ping commands from within the Uptime Kuma container to verify network access to external services like google.com. ```bash curl https://google.com ``` ```bash ping google.com ``` -------------------------------- ### Uptime Kuma Server Argument Configuration Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Environment-Variables.md Configure Uptime Kuma host and port directly using server arguments when running the server script. ```bash node server/server.js --host=127.0.0.1 --port=8080 ``` -------------------------------- ### Https-Portal Docker Compose Configuration Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reverse-Proxy.md Set up Https-Portal as a reverse proxy for Uptime Kuma with WebSocket support enabled. Ensure 'WEBSOCKET=true' is set in the environment variables. ```yaml version: "3.3" services: https-portal: image: steveltn/https-portal:1 ports: - "80:80" - "443:443" links: - uptime-kuma restart: always environment: DOMAINS: "status.domain.com -> http://uptime-kuma:3001" STAGE: "production" # Don't use production until staging works # FORCE_RENEW: 'true' WEBSOCKET: "true" volumes: - https-portal-data:/var/lib/https-portal uptime-kuma: image: louislam/uptime-kuma:2 container_name: uptime-kuma volumes: - ./uptime-kuma:/app/data ports: - 3001:3001 volumes: https-portal-data: ``` -------------------------------- ### Run Uptime Kuma with Docker Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/🔧-How-to-Install.md This command runs Uptime Kuma in a detached mode, sets up automatic restarts, maps port 3001, and creates a persistent data volume. Ensure the data volume is mapped to a local directory or volume to avoid SQLite corruption. ```bash docker run -d --restart=unless-stopped -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:2 ``` -------------------------------- ### Set Cloudflare Tunnel Token via Environment Variable Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reverse-Proxy-with-Cloudflare-Tunnel.md Configure the Cloudflare Tunnel token using an environment variable for automatic startup. This method avoids exposing container ports to the host machine. ```bash UPTIME_KUMA_CLOUDFLARED_TOKEN=`` ``` -------------------------------- ### Prometheus Configuration for Uptime Kuma Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Prometheus-Integration.md Configure your Prometheus instance to scrape metrics from Uptime Kuma. Ensure the targets and authentication details are correctly set. ```yaml - job_name: "uptime" scrape_interval: 30s scheme: http metrics_path: "/metrics" static_configs: - targets: ["uptime-kuma.url"] basic_auth: # Only needed if authentication is enabled (default) username: password: ``` -------------------------------- ### Check Docker Snap Service Status Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/How-to-Monitor-Docker-Containers.md Verify that the Docker snap service is running correctly after a restart or configuration change. This command helps in troubleshooting. ```bash sudo systemctl status snap.docker.dockerd.service ``` -------------------------------- ### Run PR Test Docker Container Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Test-Pull-Requests.md Directly run the Docker container to test a pull request. Ensure to replace `` with the actual repository and branch name. The Vite dev server runs on port 3000. ```bash docker run --rm -it -p 3000:3000 -p 3001:3001 --pull always -e 'UPTIME_KUMA_GH_REPO=' louislam/uptime-kuma:pr-test2 ``` -------------------------------- ### Update Uptime Kuma with Docker Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/🆙-How-to-Update.md Re-pull the latest Docker image, stop and remove the existing container, and then create a new container with the same volume. This ensures your data is preserved during the update. ```bash docker pull louislam/uptime-kuma:2 docker stop uptime-kuma docker rm uptime-kuma # Default docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --name uptime-kuma louislam/uptime-kuma:2 # If you are not using default value # docker run -d --restart=always -p :3001 -v :/app/data --name uptime-kuma louislam/uptime-kuma:2 ``` -------------------------------- ### Access Uptime Kuma Container Bash Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Troubleshooting.md Execute this command to enter the bash shell of your running Uptime Kuma Docker container for debugging purposes. ```bash docker exec -it uptime-kuma bash ``` -------------------------------- ### Mount TLS Certificates for Docker Remote Access Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/How-to-Monitor-Docker-Containers.md When using TLS for secure Docker daemon connections, mount the directory containing your CA, server certificate, and key files into the Uptime Kuma container. This allows Uptime Kuma to establish a secure connection. ```bash -v /docker-cert:/app/data/docker-tls ``` -------------------------------- ### Configure Docker Daemon for TCP Monitoring (Insecure) Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/How-to-Monitor-Docker-Containers.md Modify the Docker daemon configuration to expose the Docker API over TCP without TLS. This method is suitable for closed networks but is not recommended for production environments due to security risks. ```json { #any additional parameters should be kept #Insecure option, only use this if you are running on a closed network "tls": false, "hosts": ["unix:///var/run/docker.sock", "tcp://:2375"] #Secure option "tls": true, "tlscacert": "/var/docker/ca.pem", "tlscert": "/var/docker/server.pem", "tlskey": "/var/docker/serverkey.pem", "hosts": ["unix:///var/run/docker.sock", "tcp://:2376"] } ``` -------------------------------- ### Authenticate to Metrics Endpoint with Curl Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Prometheus-API-Keys.md Use this curl command to authenticate to the metrics endpoint by passing the API key in the Authorization header. The colon before the key is required for basic authentication. ```bash curl -u":" uptime.kuma/metrics ``` -------------------------------- ### Prometheus Configuration for API Key Authentication Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Prometheus-API-Keys.md Configure Prometheus to scrape metrics from the Uptime Kuma endpoint using an API key for basic authentication. Ensure the password field is set to your API key. ```yaml - job_name: "uptime" scrape_interval: 30s scheme: http static_configs: - targets: ["uptime.url"] basic_auth: password: ``` -------------------------------- ### Nginx Configuration without SSL Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reverse-Proxy.md This Nginx configuration is for running Uptime Kuma without SSL, typically for internal networks or testing. It forwards HTTP traffic to the Uptime Kuma instance. ```nginx server { listen 80; # Remove '#' in the next line to enable IPv6 # listen [::]:80; server_name sub.domain.com; location / { proxy_pass http://localhost:3001; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; } } ``` -------------------------------- ### Uptime Badge Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Badge.md Generates an SVG badge showing the uptime percentage of a monitor over a specified duration. ```APIDOC ## GET /api/badge/:monitorID/uptime/:duration ### Description Generates an SVG badge displaying the uptime percentage of a monitor over a specified duration. ### Method GET ### Endpoint `/api/badge/:monitorID/uptime/:duration` ### Parameters #### Path Parameters - **monitorID** (integer) - Required - The ID of the monitor. - **duration** (integer) - Required - The time interval in hours for which to calculate uptime. #### Query Parameters - **labelPrefix** (string) - Optional - Prefix for the label. - **label** (string) - Optional - Custom label text. - **labelSuffix** (string) - Optional - Suffix for the label. Default: 'uptime'. - **prefix** (string) - Optional - Prefix for the value. - **suffix** (string) - Optional - Suffix for the value. Default: '%'. - **color** (string) - Optional - Custom color for the badge. Can be a predefined color name or HEX code. - **labelColor** (string) - Optional - Custom color for the label part of the badge. ### Response #### Success Response (200) - SVG graphic representing the monitor's uptime. ``` -------------------------------- ### Reset Password with Docker Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reset-Password-via-CLI.md Execute this command within your Uptime Kuma Docker container to reset the password. Ensure you replace '' with your actual container name. ```bash docker exec -it bash npm run reset-password ``` -------------------------------- ### Nginx Configuration with CertBot for SSL Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Reverse-Proxy.md This Nginx configuration is designed to work with CertBot for automatic SSL certificate generation and renewal. It includes instructions for setting up DNS records and running CertBot. ```nginx server { # If you don't have one yet, you can set up a subdomain with your domain registrar (e.g. Namecheap) # Just create a new host record with type='A Record', host='', value=''. server_name your_subdomain.your_domain.your_tld; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_pass http://localhost:3001/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } # Once that's completed, you can run # sudo apt install python3-certbot-nginx # sudo certbot --nginx -d your_domain -d your_subdomain.your_domain -d www.your_domain # And Certbot will auto-populate this nginx .conf file for you, while also renewing your certificates automatically in the future. ``` -------------------------------- ### Response Badge Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Badge.md Generates an SVG badge displaying the latest response time of a monitor. ```APIDOC ## GET /api/badge/:monitorID/response ### Description Generates an SVG badge displaying the latest response time of a monitor. ### Method GET ### Endpoint `/api/badge/:monitorID/response` ### Parameters #### Path Parameters - **monitorID** (integer) - Required - The ID of the monitor. #### Query Parameters - **labelPrefix** (string) - Optional - Prefix for the label. - **label** (string) - Optional - Custom label text. - **labelSuffix** (string) - Optional - Suffix for the label. Default: 'response'. - **prefix** (string) - Optional - Prefix for the value. - **suffix** (string) - Optional - Suffix for the value. Default: 'ms'. - **color** (string) - Optional - Custom color for the badge. Can be a predefined color name or HEX code. - **labelColor** (string) - Optional - Custom color for the label part of the badge. ### Response #### Success Response (200) - SVG graphic representing the monitor's latest response time. ``` -------------------------------- ### Update Uptime Kuma Image in Docker Compose Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Migration-From-v1-To-v2.md Configuration snippet for a Docker Compose file, showing how to update the Uptime Kuma image tag to v2. ```yaml services: uptime-kuma: image: louislam/uptime-kuma:2 .... ``` -------------------------------- ### Average Response Badge Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Badge.md Generates an SVG badge showing the average response time of a monitor over a specified duration. ```APIDOC ## GET /api/badge/:monitorID/avg-response/:duration ### Description Generates an SVG badge displaying the average response time of a monitor over a specified duration. ### Method GET ### Endpoint `/api/badge/:monitorID/avg-response/:duration` ### Parameters #### Path Parameters - **monitorID** (integer) - Required - The ID of the monitor. - **duration** (integer) - Required - The time interval in hours for which to calculate the average response time. #### Query Parameters - **labelPrefix** (string) - Optional - Prefix for the label. - **label** (string) - Optional - Custom label text. - **labelSuffix** (string) - Optional - Suffix for the label. Default: 'avg-response'. - **prefix** (string) - Optional - Prefix for the value. - **suffix** (string) - Optional - Suffix for the value. Default: 'ms'. - **color** (string) - Optional - Custom color for the badge. Can be a predefined color name or HEX code. - **labelColor** (string) - Optional - Custom color for the label part of the badge. ### Response #### Success Response (200) - SVG graphic representing the monitor's average response time. ``` -------------------------------- ### Stop Uptime Kuma Service (Non-Docker) Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Migration-From-v1-To-v2.md Command to stop the Uptime Kuma service managed by PM2. ```bash pm2 stop uptime-kuma ``` -------------------------------- ### Stop Uptime Kuma Container (Docker) Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Migration-From-v1-To-v2.md Command to stop the running Uptime Kuma Docker container before initiating the migration process. ```bash docker stop uptime-kuma ``` -------------------------------- ### Share Docker Socket with Uptime Kuma Container Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/How-to-Monitor-Docker-Containers.md Mount the Docker socket to the Uptime Kuma container to allow it to communicate with the Docker daemon. This is a common method for enabling Docker monitoring. ```bash -v /var/run/docker.sock:/var/run/docker.sock ``` ```yaml volumes: - /var/run/docker.sock:/var/run/docker.sock ``` -------------------------------- ### Status Badge Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Badge.md Generates an SVG badge displaying the current status (Up/Down) of a specific monitor. ```APIDOC ## GET /api/badge/:monitorID/status ### Description Generates an SVG badge indicating the status of a monitor. ### Method GET ### Endpoint `/api/badge/:monitorID/status` ### Parameters #### Path Parameters - **monitorID** (integer) - Required - The ID of the monitor. #### Query Parameters - **upLabel** (string) - Optional - Custom label for the 'Up' state. Default: 'Up'. - **downLabel** (string) - Optional - Custom label for the 'Down' state. Default: 'Down'. - **upColor** (string) - Optional - Custom color for the 'Up' state. - **downColor** (string) - Optional - Custom color for the 'Down' state. ### Response #### Success Response (200) - SVG graphic representing the monitor status. ``` -------------------------------- ### Stop Uptime Kuma Stack (Docker Compose) Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Migration-From-v1-To-v2.md Command to stop the Uptime Kuma services defined in a Docker Compose file. ```bash docker compose down ``` -------------------------------- ### Ping Badge Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Badge.md Generates an SVG badge displaying the average ping response time of a monitor over a specified duration. ```APIDOC ## GET /api/badge/:monitorID/ping/:duration ### Description Generates an SVG badge displaying the average ping response time of a monitor over a specified duration. ### Method GET ### Endpoint `/api/badge/:monitorID/ping/:duration` ### Parameters #### Path Parameters - **monitorID** (integer) - Required - The ID of the monitor. - **duration** (integer) - Required - The time interval in hours for which to calculate the ping. #### Query Parameters - **labelPrefix** (string) - Optional - Prefix for the label. - **label** (string) - Optional - Custom label text. - **labelSuffix** (string) - Optional - Suffix for the label. Default: 'ping'. - **prefix** (string) - Optional - Prefix for the value. - **suffix** (string) - Optional - Suffix for the value. Default: 'ms'. - **color** (string) - Optional - Custom color for the badge. Can be a predefined color name or HEX code. - **labelColor** (string) - Optional - Custom color for the label part of the badge. ### Response #### Success Response (200) - SVG graphic representing the monitor's ping response time. ``` -------------------------------- ### Restart Docker Daemon Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/How-to-Monitor-Docker-Containers.md Restart the Docker daemon to apply changes made to the daemon configuration. This command is used after modifying the daemon.json file. ```bash sudo systemctl restart docker.service ``` -------------------------------- ### Certificate Expiration Badge Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Badge.md Generates an SVG badge indicating the remaining days until a monitor's SSL certificate expires. ```APIDOC ## GET /api/badge/:monitorID/cert-exp ### Description Generates an SVG badge indicating the remaining days until a monitor's SSL certificate expires. ### Method GET ### Endpoint `/api/badge/:monitorID/cert-exp` ### Parameters #### Path Parameters - **monitorID** (integer) - Required - The ID of the monitor. #### Query Parameters - **upColor** (string) - Optional - Custom color for the 'Valid' state. - **downColor** (string) - Optional - Custom color for the 'Expired' or 'Invalid' state. - **warnDays** (integer) - Optional - Number of days before expiration to show a warning color. - **downDays** (integer) - Optional - Number of days before expiration to show the 'down' color. ### Response #### Success Response (200) - SVG graphic representing the SSL certificate expiration status. ``` -------------------------------- ### Embed Uptime Kuma Status Page with Iframe Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Status-Page.md Use this HTML structure to embed your Uptime Kuma status page within another webpage using an iframe. Ensure the environment variable `UPTIME_KUMA_DISABLE_FRAME_SAMEORIGIN=true` is set to allow this. This configuration may expose you to clickjacking. ```html INSERT_TITLE_HERE ``` -------------------------------- ### Add Custom Header for Cloudflare WAF Bypass Source: https://github.com/louislam/uptime-kuma-wiki/blob/master/Cloudflare-Side-Note.md Use this JSON payload to define a custom header for Uptime Kuma requests. This header can then be used in Cloudflare WAF Custom Rules to bypass the 'Browser Integrity Check'. Remember to replace `kuma-qwerty123456` with your own unique secret value. ```json { "kumaping": "kuma-qwerty123456" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.