Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Add a Compose healthcheck that requests Uptime Kuma’s internal listener at http://localhost:3001. The probe runs inside the container, so it should not use the host’s published address. A healthcheck reports whether the process is responding; it does not restart an unhealthy container by itself. Keep a separate restart policy such as unless-stopped when you want Docker to restart a process that exits.

Use this Docker Compose healthcheck

The following service follows Uptime Kuma’s documented Compose layout: the louislam/uptime-kuma:2 image, persistent data at /app/data, and port 3001 published for clients outside the container. The healthcheck uses curl -f and gives the application time to start before failures count.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
services:
  uptime-kuma:
    image: louislam/uptime-kuma:2
    ports:
      - "3001:3001"
    volumes:
      - uptime-kuma-data:/app/data
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3001"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 30s

volumes:
  uptime-kuma-data:

Place the healthcheck block at the same indentation level as image, ports, and volumes. If you already have an Uptime Kuma service, add only the healthcheck and retain your existing volume, network, and environment settings.

Why the probe uses localhost:3001

Compose executes test from inside the Uptime Kuma container. In the documented deployment, Kuma listens on port 3001 in that container, making http://localhost:3001 the direct path to the process being checked.

#1 Best Overall
Sale
TP-Link OC200 V3, Hardware Controller
  • Hardware Controller with Professional Network Management-Centralized management for up to 100 Omada devices including Omada access points, Omada Security Gateways and Jetstream switches.
  • Premium Hardware Design-Industry-leading flexible Rackmount/Desktop design with a powerful chipset, durable metal casing, 2 fast ethernet ports and 1 USB 2.0 port for auto backup.
  • Dual power selection-Support PoE (802.3af/802.3at) and micro USB for flexible installations.
  • Easy Network Monitor & Maintenance-The easy-to-use dashboard makes it simple to see your real-time network status and improve network maintenance for peace of mind.
  • Cloud Access with No License Fee-Enjoy cloud service with no license fee with the use of OC200. Remote Cloud access and Omada app brings centralized cloud management of the whole network from different sites—all controlled from a single interface anywhere, anytime.

The mapping "3001:3001" means “host port 3001 to container port 3001.” It lets a browser or another machine reach Kuma through the Docker host. It is not required for a healthcheck running in the container. Using the host’s LAN address, public DNS name, or a reverse-proxy URL would test a different path and could fail because of firewall rules, proxy configuration, or name resolution even when Kuma itself is healthy.

curl -f is significant: it exits with a failure status for HTTP error responses, so a server response such as 500 can make the container unhealthy. A normal successful HTTP response produces a successful probe. Verify that the exact Uptime Kuma image tag you deploy contains curl; healthchecks fail when the command is absent, even if the web application is working.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What each healthcheck setting controls

Docker’s Compose file reference defines healthcheck.test as the command used to determine whether a service container is healthy. List syntax begins with CMD, CMD-SHELL, or NONE. The example uses CMD, which runs curl directly without a shell.

Setting Example Effect
test ["CMD", "curl", "-f", "http://localhost:3001"] Runs the HTTP probe inside the container. The command must exist in the image.
interval 30s Waits 30 seconds between scheduled probes after the container has started.
timeout 10s Marks an individual probe failed if it does not finish within 10 seconds.
retries 5 Requires five consecutive failures before Docker reports unhealthy.
start_period 30s Provides startup grace time. Failures during this period do not count toward the retry limit unless a probe succeeds first.

These numbers are practical starting values, not performance measurements or universal defaults. One published Compose example uses the same 30-second interval, 10-second timeout, and five retries but allows a two-minute startup period. Another uses three retries, a 10-second startup period, and a five-second timeout. Choose values from the startup time you actually observe on your host: increase start_period for a slow disk or first-run initialization, and keep timeout long enough for normal response latency without hiding a genuinely stuck process.

Rank #2
Sale
Keep Connect MAX Router Rebooter, Wi-Fi Reset Device, Monitors Connectivity and Resets When Required. No App Necessary. If You Enter a Phone Number it Will Send Texts Upon resets.
  • Automatic Router Rebooter / Reset - Stop manually restarting your router! Automate the process to ensure highly reliable internet connection uptime
  • Constantly Monitors Router and/or Modem Internet Health. Keep Connect provides 24/7/365 protection to ensure that your smart home and connected devices are always online and available.
  • Notifications - Free Texts or Emails from Keep Connect notifying you of detected eventsif you choose to enter your phone number/email. You may also choose No Notifications.
  • Perfect for Smart Home Reliability - Schedule Periodic Resets to keep your connection fresh and fast.
  • Premium Cloud Services App Available (iOS App Store and Google Play Store) - Our Premium Keep Connect Cloud Services platform allows using our Online/Mobile App to monitor many locations in one place as well. Cloud Services allows remote management of devices at all locations as well as heartbeat monitoring of your Keep Connects to notify you in the event of an ISP internet outage at one of your sites.

Compose versions that support it may also accept start_interval, which controls the interval during the startup period. It is optional; the four settings in the example work on broadly supported Compose implementations.

Apply the change and verify health

  1. Save the edited file as your Compose project’s YAML file, commonly compose.yaml or docker-compose.yml.
  2. From that directory, recreate or update the service:
    docker compose up -d
  3. Check the summary status:
    docker compose ps

    Look for a health indication such as healthy after the startup grace period. During initialization, the state may be starting.

  4. For the complete health record, first identify the container name with docker compose ps, then run:
    docker inspect <container> --format '{{json .State.Health}}'

    This displays recent probe output, exit codes, timestamps, and the current status.

  5. If the service remains unhealthy, inspect application output:
    docker compose logs uptime-kuma

    Use the service name from your file if it differs from uptime-kuma.

The commands above are verification steps to run on your host. A health result is based on the command’s exit status, not on whether the container is merely running.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Health status is not automatic recovery

A healthcheck adds a state—starting, healthy, or unhealthy—to the container. It does not, by itself, restart a container that is responding incorrectly. The restart: unless-stopped line addresses a different event: Docker can restart the container when its main process exits, while still respecting an explicit stop by an administrator.

An application can therefore be unhealthy while its process continues running. If you need an orchestrator, watchdog, or external automation to react to that state, configure it separately and define what action is safe. Do not assume that adding healthcheck changes restart behavior.

Rank #3
LANProbe 10/100/1000 Gigabit Ethernet/USB Bypass Network Tap
  • (10/100/1G) Gigabit Bypass network tap / sniffer equivalent to port mirror on a switch.
  • The two monitor/sniff ports are isolated from the network being monitored.
  • Automatic bypass of device on power fail.
  • Power-over-Ethernet (POE) pass-through. Rated at .75A max at 57vdc
  • 5v power through USB3 port or 5v wall transformer (or both). ~500ma consumption.

Make other Compose services wait for Kuma

Healthchecks become useful for startup ordering when another service must not be created until Uptime Kuma answers successfully. Docker Compose supports a long-form dependency with condition: service_healthy:

services:
  uptime-kuma:
    image: louislam/uptime-kuma:2
    ports:
      - "3001:3001"
    volumes:
      - uptime-kuma-data:/app/data
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3001"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 30s

  reporting-job:
    image: your-reporting-image
    depends_on:
      uptime-kuma:
        condition: service_healthy

volumes:
  uptime-kuma-data:

Compose waits for the dependency’s healthcheck to pass before creating the dependent service. This controls creation order; it does not guarantee that Kuma will remain healthy forever or that an already-created dependent process will be restarted when Kuma later becomes unhealthy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choosing between common probe commands

curl -f

This is the clearest option when the image includes curl. The -f flag turns HTTP error responses into a nonzero exit code, allowing Docker to distinguish an error response from a successful request.

curl -L

One published Uptime Kuma Compose example uses curl -L localhost:3001. The -L option follows redirects. This can be useful if the endpoint redirects during startup, but it does not provide the same explicit HTTP-error handling as -f unless you combine the flags, for example curl -fL http://localhost:3001. Use the form that matches the response behavior you want to treat as healthy.

Rank #4
ConnectSense Rebooter Pro – Smart Automatic Router & Modem Rebooter | Internet Monitor, Power Cycle Scheduler, Remote Reboot via App, Local HTTPS API - MPN: CS-REBOOTER-PRO
  • NEVER MANUALLY REBOOT YOUR ROUTER AGAIN – The ConnectSense Rebooter Pro plugs between your modem or router and the wall outlet, automatically detecting lost internet connectivity across up to 5 network targets and power cycling your equipment instantly — keeping your home, office, or remote location always online 24/7.
  • SCHEDULED & AUTOMATIC REBOOTS – Set up to 10 custom reboot schedules to proactively clear memory leaks, prevent slowdowns, and keep your connection fresh — even before problems occur. Perfect for smart homes, security cameras, smart locks, thermostats, and any device that depends on a stable internet connection.
  • REMOTE CONTROL FROM ANYWHERE – Trigger a manual reboot anytime from the free ConnectSense app (iOS & Android) or directly from your home network. Whether you're traveling, at work, or managing a vacation rental or remote office, you stay in control of your network without needing to be on-site.
  • AUTOMATIC POWER OUTAGE RECOVERY – When the power goes out, the Rebooter Pro automatically restores and reboots your networking equipment once power returns, eliminating downtime and the need for manual intervention. Ideal for unattended locations, rental properties, and small business networks.
  • INTEGRATOR & PRO-GRADE FEATURES – The only router rebooter with a built-in local HTTPS API, giving IT professionals, smart home integrators, and power users advanced automation, monitoring, and remote management capabilities — no cloud subscription required for local control.

CMD-SHELL

Use CMD-SHELL only when you need shell operators, environment expansion, or a compound command. Shell syntax adds another failure point and should not be used merely because it is familiar. In every form, confirm that the selected client and its options are installed in the image.

External URL probes

An external route through a proxy or host address answers a different question: whether the entire network path works. It is not a substitute for the in-container check when your goal is to verify Kuma’s own listener. If you need both guarantees, keep the container healthcheck local and monitor the externally reachable URL as a separate monitor.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot an unhealthy Uptime Kuma container

The healthcheck says the command is missing

An error such as “executable file not found” means the image does not contain curl at the expected path. Inspect the image’s available HTTP client and change test to a command that is actually installed, or select an image variant that includes the required client. Do not leave a known-missing command in the Compose file: it will report failure continuously.

The container is still starting when probes fail

Increase start_period to cover the slowest normal startup, including database initialization and filesystem latency. Keep interval, timeout, and retries aligned with the detection delay you can tolerate. A longer grace period prevents false alarms but also delays detection of a real startup failure.

Best Value
Sale
[Upgraded] AURSINC NanoVNA-H Vector Network Analyzer 9KHz -1.5GHz Latest HW V3.7 HF VHF UHF Antenna Analyzer, Measuring S Parameters, SWR, Phase, Delay, Smith Chart
  • [UPGRADED NanoVNA-H] New HW Version V3.7. It is upgradeable as new firmware is developed. With MicroSD card port now can have the measurement data or the screenshots saved in the it at anytime. Added battery circuit management, more secure. Redesigned PCB, you can connect to mobile phone with Type C-Type C cable (original PCB needs OTG cable), see a clear HD image on your phone. Added a ABS case, which is protective and dust-proof. Disply: 2.8 inch TFT (320 x240).
  • [IMPROVED FREQUENCY ALGORITHM] The improved frequency algorithm can use the odd harmonic extension of si5351 to support the measurement frequency up to 1.5GHz. The 9KHz-300MHz frequency range of the si5351 direct output provides better than 70dB dynamic, The extended 300M-900MHz band provides better than 60dB of dynamics, and the 900M-1.5GHz band is better than 40dB of dynamics.
  • [MULTIPLE FUNCTIONS] The default firmware main function is used for antenna performance measurement. The TX/RX method can measure the complete S11 and S21 parameters. If you need to obtain S12 and S22, you need to manually replace the transceiver port wiring. The CH0 output level is increased to 0dBm when using the fundamental wave, resulting in more accurate reflection measurement.
  • [SUPPORT ANDROID PHONE & PC SOFTSARE CONTROL] Designed a practical and simple control application on PC, you can download touchstone(SNP) files for radio design and simulation software. There is a PC interface that adds functionality and lets you work interactively on a bigger screen. Supports time domain analysis function (TDR). Compatible with most Android mobile phones, convenient for connecting to mobile phones. Support Windows Computer Control.
  • [STRONG AND SECURE POWER SUPPLY] This VNA is battery powered or USB powered. Built in 650mAh battery, could work for 2 hours continuously. For longer measurement time, kindly connect an external power source. The product interface displays battery usage, providing a clear understanding of the power status.

The probe returns an HTTP error

Run an interactive request from inside the container or review the health log shown by docker inspect. Confirm that Kuma is listening on port 3001, then inspect docker compose logs for application errors. A 4xx or 5xx response is expected to fail when -f is present; removing -f would hide those HTTP errors rather than fix them.

The app responds, but data operations fail

Uptime Kuma stores its data under /app/data. The project README warns that NFS filesystems are not supported for this data directory and recommends a local directory or Docker volume. A passing HTTP healthcheck cannot detect or repair database corruption, unsupported filesystem behavior, or intermittent storage. Treat storage reliability as a separate operational check and keep the data volume on supported local storage.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The host port is unavailable

A host-port conflict affects external access but is not normally the reason for an in-container probe to fail. Check the published port mapping and any other service already binding host port 3001. The healthcheck should continue to target localhost:3001 inside the Kuma container.

Operational checklist

  • Use louislam/uptime-kuma:2 or the image tag you have intentionally selected.
  • Persist /app/data on a supported local directory or Docker volume; avoid NFS for this path.
  • Target http://localhost:3001 from the container, not the host-published address.
  • Use -f when HTTP error responses should make the probe fail.
  • Confirm the image contains the client command used by test.
  • Set start_period from observed startup time rather than copying a value blindly.
  • Keep restart policy separate from health status.
  • Run docker compose up -d, then verify with docker compose ps and docker inspect.
  • Use depends_on: condition: service_healthy only when a dependent service genuinely must wait for Kuma.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.