Skip to content
Quickstart

Quickstart

Prerequisites

Overview

Watchtower is designed to run as a Docker container. It only requires access to the Docker host’s Docker socket in order to interact with the Docker engine. By default, Watchtower will review the monitored containers for image updates. If a container has an updated image, then Watchtower will perform the update task by pulling the new image, stopping the old container, rebuilding the container with the new image, and starting the new container.

Running Watchtower

Watchtower can be run using either a Docker Compose file or via the Docker CLI.

  1. Obtain the example Docker Compose file:

    services:
        watchtower:
            image: nickfedor/watchtower:latest
            restart: unless-stopped
            volumes:
                - /var/run/docker.sock:/var/run/docker.sock
  2. Run the Compose file:

    docker compose up -d

    Docker Compose File Reference

Expected Behavior

When running Watchtower with default settings:

  • It will monitor all running containers on the host
  • Every 24 hours, it will poll if the monitored containers have updated image digests

If an updated image digest is detected, then Watchtower will:

  • Pull the updated container image
  • Perform a graceful shutdown of the target container and its dependencies
  • Start a new container with the updated image while maintaining the previous container’s configuration
Last updated on