### Clone and Setup Uptime Kuma from Source Source: https://github.com/louislam/uptime-kuma/wiki/πŸ”§-How-to-Install This sequence clones the Uptime Kuma repository, navigates into the directory, and installs dependencies using npm. This is the first step for manual installation. ```bash git clone https://github.com/louislam/uptime-kuma.git cd uptime-kuma npm run setup ``` -------------------------------- ### Start Uptime Kuma Stack (Docker Compose) Source: https://github.com/louislam/uptime-kuma/wiki/Migration-From-v1-To-v2 Start your Uptime Kuma services with the updated image tag. ```bash docker compose up -d ``` -------------------------------- ### OpenLiteSpeed Web Socket Proxy Setup Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy Configure the Web Socket Proxy setup in OpenLiteSpeed for Uptime Kuma. ```text Add a `Web Socket Proxy Setup` URI:`/ Address: `127.0.0.1:3001` ``` -------------------------------- ### Knex Schema Creation Example Source: https://github.com/louislam/uptime-kuma/blob/master/db/knex_migrations/README.md An example migration demonstrating how to create tables and seed data using Knex.js schema builder methods. It ensures compatibility by using 'increments' for primary keys and avoiding raw SQL. ```javascript exports.up = function (knex) { return knex.schema .createTable("user", function (table) { table.increments("id"); table.string("first_name", 255).notNullable(); table.string("last_name", 255).notNullable(); }) .createTable("product", function (table) { table.increments("id"); table.decimal("price").notNullable(); table.string("name", 1000).notNullable(); }) .then(() => { knex("products").insert([ { price: 10, name: "Apple" }, { price: 20, name: "Orange" }, ]); }); }; exports.down = function (knex) { return knex.schema.dropTable("product").dropTable("user"); }; ``` -------------------------------- ### Install Uptime Kuma with Helm via OCI Source: https://github.com/louislam/uptime-kuma/wiki/πŸ”§-How-to-Install This command installs the Uptime Kuma Helm chart using OCI registry. This is an alternative unofficial method for Kubernetes deployments. ```bash helm install uptime-kuma oci://ghcr.io/helmforgedev/helm/uptime-kuma ``` -------------------------------- ### Install Uptime Kuma with Helm Source: https://github.com/louislam/uptime-kuma/wiki/πŸ”§-How-to-Install This command adds the HelmForge repository and installs the Uptime Kuma Helm chart. This is an unofficial method for Kubernetes deployments. ```bash helm repo add helmforge https://repo.helmforge.dev helm install uptime-kuma helmforge/uptime-kuma ``` -------------------------------- ### Configure Docker Daemon for Snap Installation (TCP) Source: https://github.com/louislam/uptime-kuma/wiki/How-to-Monitor-Docker-Containers Modify the daemon.json file for Docker installations via snap to expose the Docker API over TCP. Note the different path for the configuration file. ```diff { "log-level": "error", "storage-driver": "overlay2", + "hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"] } ``` -------------------------------- ### Run Uptime Kuma with Bun.js Source: https://github.com/louislam/uptime-kuma/blob/master/extra/push-examples/typescript-fetch/README.md This command runs Uptime Kuma using the Bun.js runtime. Ensure Bun.js is installed. ```bash bun index.ts ``` -------------------------------- ### Run Uptime Kuma v2 Container (Docker) Source: https://github.com/louislam/uptime-kuma/wiki/Migration-From-v1-To-v2 After backing up data, use this command to start the Uptime Kuma v2 container, mapping ports and volumes. ```bash docker run -d --restart=unless-stopped -p :3001 -v :/app/data --name uptime-kuma louislam/uptime-kuma:2 ``` -------------------------------- ### Uptime Kuma Server Arguments Source: https://github.com/louislam/uptime-kuma/wiki/Environment-Variables Alternatively, configure Uptime Kuma by passing host and port as command-line arguments when starting the server. ```bash node server/server.js --host=127.0.0.1 --port=8080 ``` -------------------------------- ### Start and Enable Uptime Kuma Service Source: https://github.com/louislam/uptime-kuma/wiki/OpenRC-Script These commands start the Uptime Kuma service using the OpenRC init system and optionally add it to the default runlevel, ensuring it starts automatically on system boot. ```bash sudo rc-service uptime-kuma start sudo rc-update add uptime-kuma ``` -------------------------------- ### Run Uptime Kuma with ts-node Source: https://github.com/louislam/uptime-kuma/blob/master/extra/push-examples/typescript-fetch/README.md Use this command to run Uptime Kuma with ts-node. Ensure Node.js and ts-node are installed. ```bash ts-node index.ts ``` -------------------------------- ### Monitor Uptime Kuma Migration Logs (Docker) Source: https://github.com/louislam/uptime-kuma/wiki/Migration-From-v1-To-v2 View the migration process logs in real-time after starting the v2 container. ```bash docker logs -f uptime-kuma ``` -------------------------------- ### Run Uptime Kuma Locally (Development) Source: https://github.com/louislam/uptime-kuma/wiki/πŸ”§-How-to-Install This command starts the Uptime Kuma server directly using Node.js. It's useful for development and testing purposes. ```bash node server/server.js ``` -------------------------------- ### PromQL Queries for Uptime Kuma Metrics Source: https://github.com/louislam/uptime-kuma/wiki/Prometheus-Integration Example PromQL queries to retrieve and analyze Uptime Kuma monitoring metrics. These queries can help visualize response times and status across different monitors. ```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"} ``` -------------------------------- ### Run Uptime Kuma with Localhost Binding for Synology Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy Start Uptime Kuma using Docker, binding the port to localhost. This is the first step for configuring Synology's built-in reverse proxy. ```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 ``` -------------------------------- ### Update Uptime Kuma without Docker Source: https://github.com/louislam/uptime-kuma/wiki/πŸ†™-How-to-Update For non-Docker installations, change to your Uptime Kuma directory and use Git to fetch the latest tags, checkout a specific version, install dependencies, and download prebuilt assets. Finally, restart the service using PM2. ```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 ``` -------------------------------- ### Monitor Uptime Kuma Migration Logs (Docker Compose) Source: https://github.com/louislam/uptime-kuma/wiki/Migration-From-v1-To-v2 Check the logs for the migration process after starting the stack with the new image. ```bash docker compose logs -f ``` -------------------------------- ### Check Docker Snap Service Status Source: https://github.com/louislam/uptime-kuma/wiki/How-to-Monitor-Docker-Containers Verify that the Docker service for snap installations is running correctly after restarting. ```bash sudo systemctl status snap.docker.dockerd.service ``` -------------------------------- ### OpenLiteSpeed External App Configuration Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy Configure an external web server app in OpenLiteSpeed to proxy requests to Uptime Kuma. This setup includes WebSocket proxying. ```text Add a `web server` app type Name: `uptime-kuma` Address:`http://localhost:3001` ``` -------------------------------- ### Edit Docker Service Startup Configuration Source: https://github.com/louislam/uptime-kuma/wiki/How-to-Monitor-Docker-Containers If the Docker daemon fails to start, edit its service startup configuration to resolve duplicate properties, such as the 'hosts' entry. ```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 ``` -------------------------------- ### Install Cloudflared Service (Windows) Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy-with-Cloudflare-Tunnel This command installs the Cloudflared service on Windows, using a provided token to connect to Cloudflare Tunnel. Ensure you replace the placeholder token with your actual Cloudflare Tunnel token. ```cmd cloudflared.exe service install eyJhIjoiZDA4ZGNiMTUXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ``` -------------------------------- ### Restart Docker Snap Service Source: https://github.com/louislam/uptime-kuma/wiki/How-to-Monitor-Docker-Containers Restart the Docker service specifically for snap installations to apply configuration changes. ```bash sudo systemctl restart snap.docker.dockerd.service ``` -------------------------------- ### Internationalization Translation Syntax Source: https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md Examples of how to implement translatable strings within the Uptime Kuma codebase using Vue i18n. These patterns ensure that text is correctly extracted for the Weblate localization platform. ```vue {{ $t("Translation key") }} ``` -------------------------------- ### Share Docker Socket via Command Argument Source: https://github.com/louislam/uptime-kuma/wiki/How-to-Monitor-Docker-Containers Mount the Docker socket to allow Uptime Kuma to communicate with the Docker daemon. This is a common method for Docker installations. ```bash -v /var/run/docker.sock:/var/run/docker.sock ``` -------------------------------- ### Run Uptime Kuma in Background with PM2 Source: https://github.com/louislam/uptime-kuma/wiki/πŸ”§-How-to-Install 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 if necessary. PM2 log rotation is also installed. ```bash npm install pm2 -g && pm2 install pm2-logrotate # Start Server pm2 start server/server.js --name uptime-kuma ``` -------------------------------- ### OpenRC Script for Uptime Kuma Source: https://github.com/louislam/uptime-kuma/wiki/_Sidebar This code snippet provides an OpenRC script for managing Uptime Kuma as a service on systems using OpenRC init system. It includes start, stop, and status commands for the service. ```bash #!/sbin/openrc-run command="/usr/bin/node /opt/uptime-kuma/server/server.js" pidfile="/run/uptime-kuma.pid" def start() { ebegin "Starting Uptime Kuma" start-stop-daemon --start --pidfile $pidfile --make-pidfile --background --exec $command eend $? } def stop() { ebegin "Stopping Uptime Kuma" start-stop-daemon --stop --pidfile $pidfile eend $? } ``` -------------------------------- ### Systemd Unit File for Uptime Kuma Source: https://github.com/louislam/uptime-kuma/wiki/_Sidebar This code snippet provides a systemd unit file configuration for running Uptime Kuma as a service on Linux systems. It defines how the service should be started, stopped, and managed by systemd. ```systemd [Unit] Description=Uptime Kuma After=network.target [Service] User=node WorkingDirectory=/opt/uptime-kuma ExecStart=/usr/bin/node server/server.js Restart=always [Install] WantedBy=multi-user.target ``` -------------------------------- ### Configure Uptime Kuma OpenRC Service Script Source: https://github.com/louislam/uptime-kuma/wiki/OpenRC-Script This script defines the OpenRC service for Uptime Kuma. It specifies the description, working directory, log files, command to execute, user, and dependencies. It also includes pre-start and post-start hooks for setup and verification. ```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 } ``` -------------------------------- ### Docker Compose for Uptime Kuma Source: https://github.com/louislam/uptime-kuma/wiki/_Sidebar This snippet shows a Docker Compose configuration for deploying Uptime Kuma. It defines the service, image, ports, and volume for persistent data storage, simplifying setup and management. ```yaml version: "3.8" services: uptime-kuma: image: louislam/uptime-kuma:1 container_name: uptime-kuma ports: - "3001:3001" volumes: - ./data:/app/data restart: unless-stopped ``` -------------------------------- ### Run Uptime Kuma PR Test with npx Source: https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests Executes the Uptime Kuma pull request test environment using npx. This command requires Node.js and npm to be installed. It takes the PR repository name as an argument. ```bash npx kuma-pr # Example: npx kuma-pr Ionys320:fix/maintenance_drift ``` -------------------------------- ### Run Uptime Kuma with Deno Source: https://github.com/louislam/uptime-kuma/blob/master/extra/push-examples/typescript-fetch/README.md Execute Uptime Kuma using Deno. The --allow-net flag is required for network access. ```bash deno run --allow-net index.ts ``` -------------------------------- ### Configure Multi-Platform Docker Builder Source: https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md Commands to set up a Docker buildx environment that supports cross-compilation for amd64, armv7, and arm64 architectures. It involves creating a remote context and appending it to a multi-platform builder. ```bash docker context create oracle-arm64-jp --docker "host=ssh://root@100.107.174.88" docker buildx create --name kuma-builder --platform linux/amd64,linux/arm/v7 docker buildx use kuma-builder docker buildx inspect --bootstrap docker buildx create --append --name kuma-builder --platform linux/arm64 oracle-arm64-jp ``` -------------------------------- ### Install Curl in Uptime Kuma Docker Container Source: https://github.com/louislam/uptime-kuma/wiki/Troubleshooting This command updates the package list and installs the `curl` utility within the Uptime Kuma Docker container. `curl` is essential for making HTTP requests to test service accessibility. It requires root privileges within the container and has no direct output other than package installation messages. ```bash apt update && apt --yes install curl ``` -------------------------------- ### GET /api/badge/:monitorID/:type Source: https://github.com/louislam/uptime-kuma/wiki/Badge Retrieves an SVG badge for a specific monitor based on the requested metric type. ```APIDOC ## GET /api/badge/:monitorID/:type ### Description Generates and returns an SVG graphic representing a specific metric for a public monitor. ### Method GET ### Endpoint `/api/badge/:monitorID/:type` ### Parameters #### Path Parameters - **monitorID** (integer) - Required - The ID of the monitor. - **type** (string) - Required - The badge type: `status`, `uptime`, `ping`, `avg-response`, `cert-exp`, or `response`. #### Query Parameters - **upLabel** (string) - Optional - Custom label for status badge when up. - **downLabel** (string) - Optional - Custom label for status badge when down. - **upColor** (string) - Optional - Color for up state. - **downColor** (string) - Optional - Color for down state. - **label** (string) - Optional - Custom text for the label. - **prefix** (string) - Optional - Prefix for the value. - **suffix** (string) - Optional - Suffix for the value. - **color** (string) - Optional - Badge color. ### Request Example `GET /api/badge/1/status?upColor=green&downColor=red` ### Response #### Success Response (200) - **Content-Type** (image/svg+xml) - The SVG image data representing the badge. #### Response Example `...` ``` -------------------------------- ### Manage Wiki Synchronization Source: https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md Commands to clone the wiki repository, configure the production remote, and push local updates to the live GitHub wiki. ```bash git clone https://github.com/louislam/uptime-kuma-wiki.git cd uptime-kuma-wiki git remote add production https://github.com/louislam/uptime-kuma.wiki.git git pull git push production master ``` -------------------------------- ### Check Node.js Version Source: https://github.com/louislam/uptime-kuma/wiki/Migration-From-v1-To-v2 Verify that your Node.js version meets the minimum requirement of 20.4 for Uptime Kuma v2. ```bash node --version ``` -------------------------------- ### Useful PM2 Commands Source: https://github.com/louislam/uptime-kuma/wiki/πŸ”§-How-to-Install These commands provide essential management functions for Uptime Kuma when run with PM2, including monitoring logs and setting up startup services. ```bash # If you want to see the current console output pm2 monit # If you want to add it to startup pm2 save && pm2 startup ``` -------------------------------- ### OpenLiteSpeed Context Proxy Configuration Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy Configure a proxy context in OpenLiteSpeed for Uptime Kuma, including header operations for WebSocket support. ```text Add a `proxy` context URI:`/ Web Server:`[VHost Level]: uptime-kuma` Header Operations: Upgrade websocket Connection upgrade Access Allowed:`*` ``` -------------------------------- ### Update Uptime Kuma with Docker Compose Source: https://github.com/louislam/uptime-kuma/wiki/πŸ†™-How-to-Update Navigate to your Docker Compose directory and run these commands to pull the latest image and recreate the container. Ensure you are in the directory containing your `docker-compose.yml` file. ```bash cd "" docker compose pull docker compose up -d --force-recreate ``` -------------------------------- ### Apache Configuration with SSL Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy This Apache configuration enables SSL for Uptime Kuma. It includes directives for WebSocket support and proxying traffic. ```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] ``` -------------------------------- ### Caddy Reverse Proxy Configuration (No Docker) Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy Configure Caddy to proxy requests to Uptime Kuma when not using Docker. ```nginx subdomain.domain.com { reverse_proxy 127.0.0.1:3001 } ``` -------------------------------- ### Uptime Kuma Environment Variables Source: https://github.com/louislam/uptime-kuma/wiki/Environment-Variables Configure Uptime Kuma by creating a .env file in the root directory. These variables set the host and port for the application. ```env UPTIME_KUMA_HOST=127.0.0.1 UPTIME_KUMA_PORT=8080 ``` -------------------------------- ### Authenticate with Prometheus Metrics API Source: https://github.com/louislam/uptime-kuma/wiki/Prometheus-API-Keys Examples of how to authenticate requests to the Uptime Kuma metrics endpoint using an API key. The key is passed via the Authorization header or basic authentication configuration. ```bash curl -u":" uptime.kuma/metrics ``` ```yaml - job_name: "uptime" scrape_interval: 30s scheme: http static_configs: - targets: ["uptime.url"] basic_auth: password: ``` -------------------------------- ### Register new language in i18n.js Source: https://github.com/louislam/uptime-kuma/blob/master/src/lang/README.md To add a new language to the application dropdown, developers must update the languageList object in src/i18n.js. The entry requires a language code key and a localized display name value. ```javascript const languageList = { "en": "English", "zh-TW": "繁體中文 (台灣)", // Add your language here }; ``` -------------------------------- ### Caddy Reverse Proxy with Docker Compose Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy Set up Caddy as a reverse proxy for Uptime Kuma using Docker Compose. This configuration assumes Uptime Kuma is running in a separate container and uses a shared network. ```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 ``` -------------------------------- ### Reset Admin Password via CLI Source: https://github.com/louislam/uptime-kuma/wiki/Reset-Password-via-CLI This command triggers the password reset utility for Uptime Kuma. It can be executed directly within a Docker container or from the application's root directory in a standard installation. ```bash docker exec -it bash npm run reset-password ``` ```bash cd npm run reset-password ``` -------------------------------- ### Update Uptime Kuma with Docker Source: https://github.com/louislam/uptime-kuma/wiki/πŸ†™-How-to-Update Use these commands to pull the latest Docker image, stop and remove the old container, and then create a new container with the same volume. This is the recommended method for Docker users. ```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 ``` -------------------------------- ### Update Uptime Kuma Docker Image Source: https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests Pulls the latest version of the Uptime Kuma Docker image. This is recommended to resolve potential issues with slow `npm install` commands due to outdated dependencies in the test image. ```bash docker pull louislam/uptime-kuma:pr-test2 ``` -------------------------------- ### Running Node.js Backend Tests Source: https://github.com/louislam/uptime-kuma/blob/master/test/backend-test/README.md Command to execute backend tests using npm. This assumes a 'test-backend' script is defined in the project's package.json file. ```bash npm run test-backend ``` -------------------------------- ### Set Cloudflare Tunnel Token via Environment Variable Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy-with-Cloudflare-Tunnel This environment variable can be used to configure the Cloudflare Tunnel token for Uptime Kuma, especially useful in Docker environments. Setting this variable allows cloudflared to start automatically without manual configuration. ```bash UPTIME_KUMA_CLOUDFLARED_TOKEN=`` ``` -------------------------------- ### Implement Notification Provider Axios Request Source: https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md Standard pattern for implementing notification provider network requests in Uptime Kuma. It requires wrapping axios calls in a try-catch block and utilizing the internal throwGeneralAxiosError method for consistent error handling. ```javascript try { let result = await axios.post(...); if (result.status === ...) ... } catch (error) { this.throwGeneralAxiosError(error); } ``` -------------------------------- ### Run Uptime Kuma PR Test with Docker (Latest) Source: https://github.com/louislam/uptime-kuma/wiki/Test-Pull-Requests Runs the Uptime Kuma pull request test environment using a Docker container. This method is useful if Node.js is not installed. It requires the `UPTIME_KUMA_GH_REPO` environment variable to be set with the PR repository name. Ports 3000 and 3001 are exposed. ```bash docker run --rm -it -p 3000:3000 -p 3001:3001 --pull always -e 'UPTIME_KUMA_GH_REPO=' louislam/uptime-kuma:pr-test2 # Example: UPTIME_KUMA_GH_REPO=`chakflying:fix/beat-schedule-delay` ``` -------------------------------- ### Knex Migration Template Source: https://github.com/louislam/uptime-kuma/blob/master/db/knex_migrations/README.md A standard boilerplate for defining Knex migration files. It includes the required 'up' and 'down' functions for applying and reverting database changes. ```javascript exports.up = function (knex) {}; exports.down = function (knex) {}; // exports.config = { transaction: false }; ``` -------------------------------- ### Apache Configuration without SSL Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy This Apache configuration is for proxying Uptime Kuma without SSL. It handles WebSocket connections and forwards HTTP traffic. ```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] ``` -------------------------------- ### Nginx Configuration with SSL Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy Use this Nginx configuration when proxying 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"; } } ``` -------------------------------- ### Configure Docker Daemon for TCP Monitoring (Insecure) Source: https://github.com/louislam/uptime-kuma/wiki/How-to-Monitor-Docker-Containers Update the Docker daemon's configuration file to expose the Docker API over TCP without TLS. Use this only on closed networks. ```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"] } ``` -------------------------------- ### Https-Portal Docker Compose Configuration Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy Configure Https-Portal with Docker Compose to act as a reverse proxy for Uptime Kuma, enabling WebSocket support. Ensure to replace 'status.domain.com' with your actual domain. ```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: ``` -------------------------------- ### Traefik Reverse Proxy Labels for Docker Compose Source: https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy Add these labels to your docker-compose.yml file to configure Traefik as a reverse proxy for Uptime Kuma. Replace 'YourOwnHostname' with your desired hostname. Traefik can automatically manage Let's Encrypt certificates. ```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" ``` -------------------------------- ### Update Uptime Kuma Image (Docker Compose) Source: https://github.com/louislam/uptime-kuma/wiki/Migration-From-v1-To-v2 Modify the `image` tag in your docker-compose.yml file to `louislam/uptime-kuma:2` to use the new version. ```yaml services: uptime-kuma: image: louislam/uptime-kuma:2 .... ``` -------------------------------- ### Prometheus Job Configuration Source: https://github.com/louislam/uptime-kuma/wiki/Prometheus-Integration Configure a Prometheus job to scrape metrics from Uptime Kuma. Ensure the target address 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: ```