Watchtower is a Docker application that monitors your running containers for changes to the image. When an update is available in the Docker registry, Watchtower detects the changes and pulls down the new copy of the image. It will then restart the container using the new image and the same start options of the original, without you losing any data. In this step by step guide I will show you how to install WatchtowerĀ on yourĀ UGREEN NAS using Docker & Portainer.ā ļøWarning: Watchtower will do upgrades of your docker containers automatically. This means that, if a docker image has a bug, it might destroy some containers you already have installed. For this reason, it is vital that you make Backups of your Docker folders.
Watchtower v1.7.1 release.
This guide works perfectly with the latestSTEP 1
Please Support My work by Making a Donation.
STEP 2
InstallĀ Portainer using my step by step guide. If you already have Portainer installed on your UGREEN NAS, skip this STEP. Attention: Make sure you have installed the latest Portainer version.
STEP 3
Add Read & Write Permissions to the Docker Folder. If you have already added the Read and Write Permissions to the Docker Folder, skip this STEP.
STEP 4
Log into Portainer using your username and password. On the left sidebar in Portainer, click on StacksĀ thenĀ + Add stack. Follow the instructions in the image below.
STEP 5
In the Name field type in watchtower. Follow the instructions in the image below.
version: "3.9" services: watchtower: image: containrrr/watchtower:latest container_name: WATCHTOWER hostname: watchtower mem_limit: 512m mem_reservation: 128m cpu_shares: 512 security_opt: - no-new-privileges=true read_only: true volumes: - /var/run/docker.sock:/var/run/docker.sock:ro environment: TZ: Europe/Bucharest WATCHTOWER_CLEANUP: true # Remove old images after updating WATCHTOWER_REMOVE_VOLUMES: false # Remove attached volumes after updating DOCKER_API_VERSION: 1.45 # SSH docker version 1.41 for Docker engine version 20.10 - 1.43 for Docker engine version 24 - 1.45 for Docker engine version 26.1 WATCHTOWER_INCLUDE_RESTARTING: true # Restart containers after update WATCHTOWER_INCLUDE_STOPPED: false # Update stopped containers WATCHTOWER_SCHEDULE: "0 0 */2 * * *" # Update & Scan containers every 2 hours WATCHTOWER_LABEL_ENABLE: false WATCHTOWER_ROLLING_RESTART: true WATCHTOWER_TIMEOUT: 30s WATCHTOWER_LOG_FORMAT: pretty restart: on-failure:5
Note: Before you paste the code above in the Web editor area below, change the value for TZĀ (Select your current Time Zone from this list).
Note: Before you paste the code above in the Web editor area below, change the value for DOCKER_API_VERSION. 1.41 is for Docker engine 20.10 – 1.43 is for Docker engine 24 – 1.45 for Docker engine 26.1. Check the exact version on the official Docker engine API websiteĀ or check the following screenshot to find it in Portainer.
Note: If you want, you can change some parameters in the code above such as the frequency with which your containers get scanned and updated.
STEP 6
Scroll down on the page until you see a button namedĀ Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.
STEP 7
If everything goes right, you will see the following message at the top right of your screen: āSuccess Stack successfully deployedā.
Enjoy Watchtower!
š”Note: Watchtower does not have a graphical interface. To see which container was updated, you can check the logs for the Watchtower container. On the Portainer left sidebar, click Containers, then click the little log icon on the WATCHTOWER container.
After you click on the little log icon, you can see which container has been updated.
This post was updated on Wednesday / December 11th, 2024 at 3:54 PM