Prerequisites
Before you install Watchtower, make sure your host meets these three requirements — they're the same whether you use docker run, Compose, or Swarm:
- Docker Engine 20.10 or newer. Run
docker versionto confirm. Watchtower talks to the Docker API, so anything reasonably modern works. (If you're on Docker 29 with the old image, see our Docker 29 fix guide — one more reason to use the fork.) - Access to
/var/run/docker.sock. Watchtower must talk to the Docker daemon, and the socket is how it does that. Root or a user in thedockergroup works. On Docker Desktop (Mac/Windows), the socket is mounted the same way from your perspective. - Registry access. If your containers come from private registries, log in first (
docker login) — Watchtower reads the same credential store your host already uses, as covered in our environment variables reference.
containrrr/watchtower on new setups. The original image was archived on December 17, 2025 and is frozen at v1.7.1 — it receives no security patches and is already showing compatibility issues with newer Docker Engine releases. Every command on this page uses nickfedor/watchtower, the actively maintained fork where all configuration is identical. See the 2026 fork-era guide for the full story.One decision to make before you start: watch everything, or opt in? By default Watchtower updates all running containers. For a homelab that's usually what you want. For anything with databases or stateful services, you'll want opt-in labels (explained in the first-time config section below).
Which method should you pick? All three install the same image with identical behavior — the difference is how the config lives:
| Method | Best for | Config lives in | Effort |
|---|---|---|---|
| docker run | Trying Watchtower out, single-host homelabs | Your shell history | ~1 minute |
| Docker Compose | Anything you'll keep — version-controlled, reproducible | docker-compose.yml | ~3 minutes |
| Docker Swarm | Multi-node clusters | Swarm service spec | ~5 minutes |
If you're unsure, start with Method 1 to confirm everything works, then move the exact same flags into a Compose file for the long term. There is no wrong answer — only the archived image would be one.
Method 1: docker run (Fastest)
One command, one container, done. This is the fastest way to get Watchtower monitoring your host — ideal for trying it out or for a single-host homelab:
docker run -d \
--name watchtower \
--restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_CLEANUP=true \
-e WATCHTOWER_POLL_INTERVAL=86400 \
-e TZ=Asia/Riyadh \
nickfedor/watchtower
What each flag does:
--restart unless-stopped— Watchtower survives host reboots, which matters because a stopped Watchtower silently stops watching.-v /var/run/docker.sock:/var/run/docker.sock— the non-negotiable socket mount. Without it, Watchtower can't see or manage anything.WATCHTOWER_CLEANUP=true— removes the old image after each successful update so disk usage doesn't grow forever.WATCHTOWER_POLL_INTERVAL=86400— check for updates once every 24 hours (value in seconds). Drop this to3600for hourly checks.TZ=Asia/Riyadh— sets the container timezone so log timestamps and cron schedules match your local time. Use your own zone (e.g.Europe/Riga,America/New_York).
Prefer nightly checks at 3 AM instead of a flat interval? Swap the poll interval for a cron schedule:
docker run -d \
--name watchtower \
--restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_CLEANUP=true \
-e WATCHTOWER_SCHEDULE="0 0 3 * * *" \
-e TZ=Asia/Riyadh \
nickfedor/watchtower
WATCHTOWER_SCHEDULE uses a 6-field cron (seconds first): "0 0 3 * * *" means 3:00:00 AM every day. Keep TZ set or that 3 AM won't be the 3 AM you think it is. Full variable details live in our environment variables reference.
Method 2: Docker Compose (Production)
For anything you'll keep, Compose is the right home for Watchtower — the config is version-controlled, reproducible, and deploys with one command. This is a production-ready snippet with opt-in labels, a cron schedule, cleanup, and notifications wired up:
services:
watchtower:
image: nickfedor/watchtower
container_name: watchtower
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- TZ=Asia/Riyadh
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_LABEL_ENABLE=true
- WATCHTOWER_SCHEDULE=0 0 4 * * *
- WATCHTOWER_NOTIFICATION_URL=discord://token@channel
- WATCHTOWER_NOTIFICATION_REPORT=true
labels:
- "com.centurylinklabs.watchtower.enable=true"
What makes this production-grade:
WATCHTOWER_LABEL_ENABLE=true— the opt-in model. Watchtower ignores every container except ones you tag with thecom.centurylinklabs.watchtower.enable=truelabel. This is the single most important safety setting for shared or production hosts.WATCHTOWER_SCHEDULE=0 0 4 * * *— nightly 4 AM checks instead of a rolling interval. Predictable, and it keeps update restarts inside your maintenance window.WATCHTOWER_CLEANUP=true— prunes replaced images automatically.WATCHTOWER_NOTIFICATION_URL— a Shoutrrr URL so you hear about every update. The example uses Discord; Slack, Telegram, email SMTP, Gotify, and generic webhooks all work — see our notifications setup guide for copy-paste URLs per provider.WATCHTOWER_NOTIFICATION_REPORT=true— sends a summary report of what was checked and updated, not just bare event pings.
Deploy it with:
docker compose up -d
Tagging containers for opt-in: with WATCHTOWER_LABEL_ENABLE=true, add this label to any service you want Watchtower to manage:
services:
nginx:
image: nginx:1.27
labels:
- "com.centurylinklabs.watchtower.enable=true"
Containers without the label are skipped entirely — including databases you never want auto-restarted. This label-based scoping is explained step-by-step in the first-time config section below.
Method 3: Docker Swarm (Global Service)
On a Swarm cluster, deploy Watchtower as a global service so exactly one instance runs on every node and each node keeps its own containers current:
docker service create \
--name watchtower \
--mode global \
--restart-condition any \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--env WATCHTOWER_CLEANUP=true \
--env WATCHTOWER_LABEL_ENABLE=true \
--env WATCHTOWER_SCHEDULE="0 0 4 * * *" \
--env TZ=Asia/Riyadh \
nickfedor/watchtower
Notes specific to Swarm:
--mode globalputs one Watchtower task on every node — including nodes you add later. No per-node installs.- The socket bind mount gives each task access to its local node's daemon, which is exactly what you want.
- Run this from a manager node. Combine with
WATCHTOWER_LABEL_ENABLE=trueso Swarm services only update when you've tagged them — Swarm redeploys can be more disruptive than single-host restarts. - To update Watchtower itself later:
docker service update --image nickfedor/watchtower:latest watchtower.
Prefer a stack file instead? The same Compose service definition from Method 2 deploys with docker stack deploy -c docker-compose.yml wt — just add deploy: { mode: global } to the service.
Verify the Install
Don't assume it works — confirm it in 60 seconds with these three checks:
1. Is it running?
docker ps --filter "name=watchtower" --format "table {{.Names}}\t{{.Status}}\t{{.Image}}"
You should see watchtower with status Up ... and image nickfedor/watchtower. If it's restarting in a loop, check the logs next.
2. What does it see?
docker logs watchtower
A healthy start looks like this:
time="2026-10-19T10:00:01+05:00" level=info msg="Watchtower v1.20.0"
time="2026-10-19T10:00:01+05:00" level=info msg="Using no notifications"
time="2026-10-19T10:00:01+05:00" level=info msg="Checking all containers (except explicitly disabled with label)"
Key things to look for: the version line (confirms which image you're actually running), and whether it says "Checking all containers" vs. "Checking containers with label" — that tells you whether your opt-in setting took effect. If you see Cannot connect to the Docker daemon, the socket mount is wrong or your user lacks permissions.
3. Force a dry test with --run-once
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_CLEANUP=true \
nickfedor/watchtower --run-once
--run-once performs a single update check and exits — perfect for confirming Watchtower can reach your registries and sees your containers without waiting for the next scheduled poll. Pair it with --debug for verbose output if something looks off.
First-Time Config: Opt-In Labels Explained
The default behavior — update everything — is aggressive. Here's the configuration pattern we recommend for every first install, and how it works:
The opt-in model (recommended)
- Set
WATCHTOWER_LABEL_ENABLE=trueon the Watchtower container itself (shown in the Method 2 snippet above). - Add
com.centurylinklabs.watchtower.enable=trueas a label on each container you want auto-updated. - Watchtower now skips everything else — databases, reverse proxies, anything you didn't explicitly tag.
For docker run containers, the label goes on the target container:
docker run -d --name my-app \
--label com.centurylinklabs.watchtower.enable=true \
myregistry/my-app:1.4
The disable label (alternative)
If you'd rather watch everything except a few critical containers, skip WATCHTOWER_LABEL_ENABLE and tag the exceptions instead:
docker run -d --name postgres \
--label com.centurylinklabs.watchtower.enable=false \
postgres:16
Monitor-only mode (observe before you automate)
Not sure you trust auto-restarts yet? WATCHTOWER_MONITOR_ONLY=true makes Watchtower check for updates and notify you without pulling or restarting anything. Run in this mode for a week, read the reports, then flip it off when you're comfortable:
docker run -d \
--name watchtower \
--restart unless-stopped \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_MONITOR_ONLY=true \
-e WATCHTOWER_NOTIFICATION_URL=discord://token@channel \
nickfedor/watchtower
For the full catalog of every variable — WATCHTOWER_TIMEOUT, rolling-restart delays, lifecycle hooks, HTTP API, and more — see our complete environment variables reference and the notifications setup guide.
Uninstalling Watchtower
Removing Watchtower is clean — it leaves your other containers untouched. Match the method you installed with:
docker run install
docker stop watchtower && docker rm watchtower
docker rmi nickfedor/watchtower
Docker Compose install
docker compose stop watchtower && docker compose rm -f watchtower
(Or remove the service from your compose file and run docker compose up -d.)
Docker Swarm install
docker service rm watchtower
Note: uninstalling Watchtower does not revert any container updates it already performed — those containers keep running their updated images. It also doesn't remove the opt-in labels from your other containers' definitions; they're harmless metadata, but tidy them up if you like.
If Something Goes Wrong
Most install problems fall into three buckets: the socket mount is wrong (Cannot connect to the Docker daemon), permissions are missing (user not in the docker group), or the image tag is pinned to the archived release. If Watchtower runs but never updates anything, the usual suspects are label misconfiguration, WATCHTOWER_MONITOR_ONLY left on, or a schedule expression that never fires — all covered in our troubleshooting guide, plus the client-version error fix and Docker 29 fix for version-specific issues.
Still on the original image and weighing the switch? The 5-minute migration guide and the 2026 fork-era hub walk you through it. And if you're rethinking auto-updates entirely, Watchtower vs Diun compares the notify-first alternative.
Ready to migrate instead?
Already running the archived image? Switch to the fork with one line — zero config changes.
Migration Guide →