October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Add a Healthcheck to Uptime Kuma in Docker Compose

Configure Uptime Kuma’s Docker Compose healthcheck correctly: probe localhost:3001 inside the container, tune timing values, verify health, and understand why unhealthy does not automatically mean restarted.
WorldDocker Compose Length8 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Add a Docker Compose healthcheck that probes Uptime Kuma from inside its own container. The usual target is http://localhost:3001, and a practical starting policy is a 30-second interval, 10-second timeout, five retries and a 30-second startup grace period. The healthcheck reports whether Kuma is responding; it does not, by itself, restart an unhealthy container.

Use this Compose configuration

Uptime Kuma’s documented Compose deployment uses the louislam/uptime-kuma:2 image, stores application data at /app/data, and listens on container port 3001. Add the healthcheck alongside the existing port, volume and restart settings:

As an Amazon Associate I earn from qualifying purchases.

Free tools Windows power users keep installed

One-click scans. No signup required.

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:

Save the change in your Compose file, then recreate or update the service with docker compose up -d. The values above are a reasonable policy for many installations, not a performance benchmark. If your host takes longer to start Kuma, increase start_period rather than declaring the container unhealthy during normal startup.

Why the probe uses localhost:3001

Compose executes a service healthcheck inside that service’s container. Inside the Uptime Kuma container, the application’s listener is on port 3001, so the probe should call http://localhost:3001. It does not need to use the host-published address.

#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 has two sides: the first port is on the Docker host and the second is inside the container. A browser or monitoring system outside Docker uses the host side. The healthcheck is already inside the container and can reach the second side directly through its loopback interface.

Using the host address in an in-container check adds unnecessary routing and can fail because of firewall rules, hairpin NAT, DNS differences or a host address that is not reachable from the container. It also tests a different path from the one Kuma itself uses. Probe the process where it actually listens unless you deliberately want to test an external route.

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

What the test command does

Docker defines healthcheck.test as the command used to determine whether a container is healthy. In list form, the first element selects the execution mode. CMD runs the following arguments directly, while CMD-SHELL runs a shell command. NONE disables a healthcheck inherited from an image.

The recommended entry is:

test: ["CMD", "curl", "-f", "http://localhost:3001"]

curl makes an HTTP request. The -f (fail) option causes curl to return a failure status for an HTTP error response, allowing Docker to count that probe as failed. Without -f, curl can return success after receiving an HTTP error page, which would make the health signal less useful.

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.

Check that the exact Uptime Kuma image tag you deploy contains curl before relying on this command. A healthcheck cannot run a binary that is absent from the image. If your chosen image variant does not include curl, select another HTTP client that is actually installed and express its command in the same test field. Do not copy a command merely because it works in a different image.

Healthcheck settings and how to tune them

Each timing field changes how quickly Docker changes the reported state:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Setting Meaning Starting value What changing it does
interval Time between completed probes during normal operation. 30s A shorter interval detects failures sooner but generates more requests and log activity.
timeout Maximum time allowed for one probe. 10s A shorter timeout is more sensitive to latency; a longer one tolerates slow disks, CPU pressure or congested hosts.
retries Consecutive failures required before Docker marks the container unhealthy. 5 More retries reduce false alarms from transient failures but delay the unhealthy state.
start_period Startup grace period during which failures do not count toward the retry limit. 30s Increase it when Kuma’s observed startup time is longer than 30 seconds.
start_interval Optional startup probe interval in Compose versions that support it. Not set Use it when you need a different probe cadence during startup; confirm your installed Compose version supports the field.

These controls are independent. For example, five failures at a 30-second interval can take roughly two and a half minutes to reach an unhealthy state, depending on probe timing and startup rules. That delay is intentional tolerance, not a promise that every failure will be detected on an exact schedule.

Apply the change and inspect the result

  1. Edit the Compose file and add the healthcheck under the uptime-kuma service. Keep the indentation under healthcheck correct; YAML indentation determines which service owns the setting.
  2. Apply the configuration with docker compose up -d. Compose will create the container or replace it when the service definition requires recreation.
  3. Check the summarized state with docker compose ps. The service should eventually show a healthy status after successful probes.
  4. For the complete health record, first obtain the container ID and then inspect its health state:
docker compose ps -q uptime-kuma
docker inspect $(docker compose ps -q uptime-kuma) --format '{{json .State.Health}}'

The detailed output includes the current status, failing streak and recent probe results. Run these commands yourself on the host; the configuration is not considered verified merely because Compose accepted the YAML.

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.

Health status is not an automatic restart mechanism

A healthcheck reports state. It does not restart a process simply because Docker labels the container unhealthy. Keep a separate restart policy when you want Docker to start the container again after its main process exits. The example uses restart: unless-stopped, which is a restart-policy choice and should be evaluated separately from probe timing.

An unhealthy status can therefore coexist with a running container. Kuma’s process may still exist while its HTTP listener is unavailable, it is blocked on storage, or it is returning HTTP errors. Conversely, a process that exits may be restarted by the restart policy before a healthcheck can provide useful information. Treat the two signals as different diagnostic channels:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Process/restart state: whether Docker’s restart policy brings back the container after its main process exits.
  • Health state: whether the configured command can complete successfully within its timeout and retry policy.

Make another Compose service wait for Kuma

If a dependent service must not be created until Uptime Kuma is responding, Docker Compose supports a health-based dependency condition. Put the condition on the dependent service’s depends_on entry:

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

  dependent-service:
    image: example/dependent-service
    depends_on:
      uptime-kuma:
        condition: service_healthy

volumes:
  uptime-kuma-data:

With condition: service_healthy, Compose waits for the dependency’s healthcheck to pass before creating the dependent service. This coordinates startup; it does not continuously restart the dependent service if Kuma later becomes unhealthy. The dependent service still needs its own failure handling.

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.

Choosing between common probe patterns

Pattern Use when Trade-off
curl -f http://localhost:3001 You want HTTP errors to count as probe failures and curl is installed. Requires curl in the image; strict about HTTP error responses.
curl -L localhost:3001 You are following a published example that allows redirects and your image has curl. Without -f, an HTTP error response may not produce a failing exit status.
A different installed HTTP client Your image does not contain curl but includes another suitable client. The exact flags and failure behavior depend on that client; verify them inside the image.
An external host route You intentionally need to test reachability through a proxy, published port or external DNS path. It tests networking outside Kuma’s own listener and can fail for reasons unrelated to the application.

The two published Uptime Kuma Compose examples use the same in-container port but different policies: one uses curl -L localhost:3001 with a 30-second interval, 10-second timeout, five retries and a two-minute startup period; another uses curl -f http://localhost:3001 with a 30-second interval, three retries, a 10-second startup period and a five-second timeout. These are tolerance choices, not universal constants. Pick values based on observed startup and the cost of delayed failure detection.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot an unhealthy Kuma container

The probe reports “executable file not found”

The image does not contain the command named in test, or the command is not on the image’s executable path. Confirm the tools available in the exact image tag you run, then change the probe to an installed client. Do not solve this by probing the host, because that would hide the missing in-container dependency.

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

The probe times out during startup

Compare the host’s observed startup time with start_period. Increase the grace period when startup is legitimately slow, and use docker compose ps plus the detailed health output to distinguish startup delay from a persistent failure. Increasing timeout helps only when the application eventually responds slowly; it does not fix a listener that never starts.

The container stays unhealthy after startup

Check the health log from docker inspect, then test the same endpoint from inside the container with the same client and URL. A failed HTTP request can indicate that Kuma is not listening on port 3001, the process is still initializing, or the application is returning an error. Keep the target as localhost:3001 unless you have intentionally changed Kuma’s listening configuration.

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 container restarts but health never becomes healthy

Inspect both the restart count and health output. A restart policy may be reacting to process exits while the healthcheck is reporting a separate HTTP problem. Review container logs and storage errors rather than assuming that changing retries will repair the underlying failure.

Keep storage reliability separate from HTTP health

Uptime Kuma stores its application data under /app/data. The project warns that NFS (Network File System) filesystems are not supported for this data directory and recommends mapping it to a local directory or Docker volume. The named volume in the example keeps that data separate from the container lifecycle.

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

A passing HTTP probe does not prove that every database operation is safe, and a failing probe cannot repair a filesystem problem. When diagnosing incidents, check the health output, container logs and the reliability of the volume independently. If the data directory is on unsupported NFS storage, move it to supported local storage before tuning probe thresholds.

Practical checklist

  • Use the documented image tag louislam/uptime-kuma:2 or confirm the healthcheck command for the image you actually selected.
  • Persist /app/data on a local directory or Docker volume, not NFS.
  • Probe http://localhost:3001 from inside the container.
  • Use curl -f when curl is present and you want HTTP errors to fail the check.
  • Set interval, timeout, retries and start_period according to observed startup and acceptable detection delay.
  • Keep a separate restart policy if you need automatic recovery after process exit.
  • Run docker compose up -d, then verify with docker compose ps and docker inspect.
  • Use condition: service_healthy only when a dependent Compose service must wait for Kuma during creation.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.