{"id":6391,"date":"2023-08-24T17:13:46","date_gmt":"2023-08-24T17:13:46","guid":{"rendered":"https:\/\/www.webhi.com\/how-to\/?p=6391"},"modified":"2023-12-07T16:02:29","modified_gmt":"2023-12-07T16:02:29","slug":"update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04","status":"publish","type":"post","link":"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/","title":{"rendered":"Update automatically Docker containers with Watchtower on Ubuntu"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/08\/watchtower_docker_en.jpg\" alt=\"automatically update docker containers watchtower ubuntu 18.04 20.04 22.04\" class=\"wp-image-6427\" srcset=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/08\/watchtower_docker_en.jpg 1200w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/08\/watchtower_docker_en-300x169.jpg 300w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/08\/watchtower_docker_en-1024x576.jpg 1024w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/08\/watchtower_docker_en-768x432.jpg 768w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/08\/watchtower_docker_en-150x84.jpg 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>Using Docker provides many benefits like allowing you to package applications into standardized units for software development. This makes it easier to deploy and scale your applications.<\/p>\n\n\n\n<p>However, managing updates of the Docker images on a server can become tedious. You have to manually pull new versions of an image and restart each container every time an update is released.<\/p>\n\n\n\n<p>This is where Watchtower comes in handy! Watchtower is a container-based solution that will monitor your running Docker containers and watch for changes to the images that those containers were originally started from.<\/p>\n\n\n\n<p>When Watchtower detects that an image has changed, it will automatically restart the related containers to pull down the new image and run with the latest version.<\/p>\n\n\n\n<p>In this comprehensive guide, we will cover how to install Watchtower and configure it to automatically update containers on Ubuntu 20.04\/22.04.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<p>Before we get started with setting up Watchtower, there are a few prerequisites you need:<\/p>\n\n\n\n<ul>\n<li>A Ubuntu 20.04\/22.04 server with Docker installed <\/li>\n\n\n\n<li>You can follow the&nbsp;<a href=\"https:\/\/www.webhi.com\/how-to\/how-to-install-and-use-docker-on-ubuntu-lts\/\" target=\"_blank\" rel=\"noreferrer noopener\">Docker installation guide<\/a>&nbsp;for Ubuntu 20.04\/22.04<\/li>\n\n\n\n<li>Docker configured to auto-start on boot (should be default)<\/li>\n\n\n\n<li>A few Docker containers already running on the server that you wish to keep updated<\/li>\n<\/ul>\n\n\n\n<p>Once you have your Ubuntu server ready with Docker active and some containers running, we can move on to installing Watchtower.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-1---install-watchtower\">Step 1 &#8211; Install Watchtower<\/h2>\n\n\n\n<p>Watchtower is distributed as a Docker image, so installation is as simple as running a container from that image. The Watchtower image is hosted on Docker Hub.<\/p>\n\n\n\n<p>Pull down the latest Watchtower image:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker pull containrrr\/watchtower<\/code><\/pre>\n\n\n\n<p>Once the image finishes downloading, you can run a Watchtower container:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --name watchtower -v \/var\/run\/docker.sock:\/var\/run\/docker.sock containrrr\/watchtower<\/code><\/pre>\n\n\n\n<p>Let&#8217;s go over the options we are passing to the&nbsp;<code>docker run<\/code>&nbsp;command:<\/p>\n\n\n\n<ul>\n<li><code>-d<\/code>&nbsp;&#8211; Runs the Watchtower container in detached mode<\/li>\n\n\n\n<li><code>--name watchtower<\/code>&nbsp;&#8211; Names the container &#8220;watchtower&#8221; for easier identification<\/li>\n\n\n\n<li><code>-v \/var\/run\/docker.sock:\/var\/run\/docker.sock<\/code>&nbsp;&#8211; Mounts the Docker socket into the Watchtower container so it can communicate with the Docker daemon<\/li>\n\n\n\n<li><code>containrrr\/watchtower<\/code>&nbsp;&#8211; The Watchtower Docker image to use<\/li>\n<\/ul>\n\n\n\n<p>This will create and start up a Watchtower container in the background that is ready to start monitoring your other containers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-2---configure-watchtower-notification-options\">Step 2 &#8211; Configure Watchtower Notification Options<\/h2>\n\n\n\n<p>By default, Watchtower will silently check for container image updates in the background without notifying you. You can change this behavior by setting a few environment variables when launching Watchtower:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"notifications-on-containers-updated\">Notifications on Containers Updated<\/h3>\n\n\n\n<p>To get notifications when Watchtower updates containers, pass in the&nbsp;<code>-e WATCHTOWER_NOTIFICATIONS=email<\/code>&nbsp;environment variable.<\/p>\n\n\n\n<p>There are a few options for notifications:<\/p>\n\n\n\n<ul>\n<li><strong>email<\/strong>&nbsp;&#8211; Will send email notifications. Requires additional configuration.<\/li>\n\n\n\n<li><strong>slack<\/strong>&nbsp;&#8211; Can post notifications to Slack. Requires webhook URL and channel.<\/li>\n\n\n\n<li><strong>msteams<\/strong>&nbsp;&#8211; Send notifications to MS Teams. Requires webhook URL.<\/li>\n\n\n\n<li><strong>gotify<\/strong>&nbsp;&#8211; Send notifications through Gotify. Requires app token and server URL.<\/li>\n<\/ul>\n\n\n\n<p>For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --name watchtower -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -e WATCHTOWER_NOTIFICATIONS=email containrrr\/watchtower<\/code><\/pre>\n\n\n\n<p>This will enable email notifications when containers are updated.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"notifications-on-watchtower-startexit\">Notifications on Watchtower Start\/Exit<\/h3>\n\n\n\n<p>You can also get notifications when the Watchtower container starts up or shuts down by passing in&nbsp;<code>-e WATCHTOWER_NOTIFICATIONS_LEVEL=start-exit<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --name watchtower -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -e WATCHTOWER_NOTIFICATIONS=email -e WATCHTOWER_NOTIFICATIONS_LEVEL=start-exit containrrr\/watchtower<\/code><\/pre>\n\n\n\n<p>This will send notifications on both container updates and when Watchtower starts\/stops.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"notification-services-configuration\">Notification Services Configuration<\/h3>\n\n\n\n<p>If you enable notifications, you will need to provide configuration for the notification services.<\/p>\n\n\n\n<p>This is done by passing in additional environment variables or by mounting YAML configuration files into the container.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"email-configuration\">Email Configuration<\/h4>\n\n\n\n<p>To receive email notifications, you must provide:<\/p>\n\n\n\n<ul>\n<li><code>WATCHTOWER_EMAIL_FROM<\/code>&nbsp;&#8211; The address to send notification emails from<\/li>\n\n\n\n<li><code>WATCHTOWER_EMAIL_TO<\/code>&nbsp;&#8211; The address to send notifications to<\/li>\n\n\n\n<li><code>WATCHTOWER_EMAIL_SERVER<\/code>&nbsp;&#8211; SMTP server address<\/li>\n\n\n\n<li><code>WATCHTOWER_EMAIL_SERVER_PORT<\/code>&nbsp;&#8211; SMTP server port<\/li>\n\n\n\n<li><code>WATCHTOWER_EMAIL_SERVER_USER<\/code>&nbsp;&#8211; SMTP user name<\/li>\n\n\n\n<li><code>WATCHTOWER_EMAIL_SERVER_PASSWORD<\/code>&nbsp;&#8211; SMTP password<\/li>\n<\/ul>\n\n\n\n<p>For Gmail, it would look something like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --name watchtower -v \/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n  -e WATCHTOWER_NOTIFICATIONS=email \\\n  -e WATCHTOWER_EMAIL_FROM=fromaddress@gmail.com \\ \n  -e WATCHTOWER_EMAIL_TO=toaddress@example.com \\\n  -e WATCHTOWER_EMAIL_SERVER=smtp.gmail.com \\\n  -e WATCHTOWER_EMAIL_SERVER_PORT=587 \\\n  -e WATCHTOWER_EMAIL_SERVER_USER=fromaddress@gmail.com \\\n  -e WATCHTOWER_EMAIL_SERVER_PASSWORD=gmail_password \\\n  containrrr\/watchtower <\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"slack-configuration\">Slack Configuration<\/h4>\n\n\n\n<p>To post to Slack, you need:<\/p>\n\n\n\n<ul>\n<li><code>WATCHTOWER_NOTIFICATIONS_SLACK_WEBHOOK_URL<\/code>&nbsp;&#8211; Your Slack webhook URL<\/li>\n\n\n\n<li><code>WATCHTOWER_NOTIFICATIONS_SLACK_CHANNEL<\/code>&nbsp;&#8211; The Slack channel to post to<\/li>\n<\/ul>\n\n\n\n<p>For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --name watchtower -v \/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n  -e WATCHTOWER_NOTIFICATIONS=slack \\\n  -e WATCHTOWER_NOTIFICATIONS_SLACK_WEBHOOK_URL=https:\/\/hooks.slack.com\/services\/xxx \\\n  -e WATCHTOWER_NOTIFICATIONS_SLACK_CHANNEL=\"#channel-name\" \\\n  containrrr\/watchtower<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"ms-teams-configuration\">MS Teams Configuration<\/h4>\n\n\n\n<p>For MS Teams notifications, you only need to provide:<\/p>\n\n\n\n<ul>\n<li><code>WATCHTOWER_NOTIFICATIONS_MSTEAMS_WEBHOOK_URL<\/code>&nbsp;&#8211; Your MS Teams webhook URL<\/li>\n<\/ul>\n\n\n\n<p>For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --name watchtower -v \/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n  -e WATCHTOWER_NOTIFICATIONS=msteams \\\n  -e WATCHTOWER_NOTIFICATIONS_MSTEAMS_WEBHOOK_URL=https:\/\/webhook.teams.microsoft.com\/xxx \\\n  containrrr\/watchtower<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"using-configuration-files\">Using Configuration Files<\/h3>\n\n\n\n<p>Instead of passing environment variables, you can define your notification configurations in YAML files and mount them into the Watchtower container.<\/p>\n\n\n\n<p>This allows you to keep your configurations externally and not have to pass long command strings.<\/p>\n\n\n\n<p>The configuration file paths:<\/p>\n\n\n\n<ul>\n<li><code>\/config\/email.yaml<\/code>&nbsp;&#8211; Email configuration<\/li>\n\n\n\n<li><code>\/config\/slack.yaml<\/code>&nbsp;&#8211; Slack configuration<\/li>\n\n\n\n<li><code>\/config\/msteams.yaml<\/code>&nbsp;&#8211; MS Teams configuration<\/li>\n<\/ul>\n\n\n\n<p>Just mount your custom YAML files over top of the default empty files.<\/p>\n\n\n\n<p>For example for email notifications:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --name watchtower \\\n  -v \/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n  -v \/path\/to\/email.yaml:\/config\/email.yaml \\\n  containrrr\/watchtower<\/code><\/pre>\n\n\n\n<p>Where your&nbsp;<code>email.yaml<\/code>&nbsp;would contain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">email:\n  from: fromaddress@gmail.com\n  to: toaddress@example.com\n  server: smtp.gmail.com\n  port: 587\n  user: fromaddress@gmail.com\n  password: gmail_password<\/code><\/pre>\n\n\n\n<p>This keeps your notification configurations external and detachable from the Watchtower container itself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-3---control-which-containers-are-updated\">Step 3 &#8211; Control Which Containers Are Updated<\/h2>\n\n\n\n<p>By default, Watchtower will monitor all containers running on the Docker daemon and update any containers where the image is refreshed.<\/p>\n\n\n\n<p>You can exclude containers by name or label to prevent Watchtower from updating them automatically:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"exclude-by-container-name\">Exclude by Container Name<\/h3>\n\n\n\n<p>Pass the&nbsp;<code>--exclude<\/code>&nbsp;option with a regex filter for names:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --name watchtower \\\n  -v \/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n  containrrr\/watchtower --exclude \"my-container-name|another-container\"<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"exclude-by-container-label\">Exclude by Container Label<\/h3>\n\n\n\n<p>Label containers with&nbsp;<code>com.centurylinklabs.watchtower.enable=false<\/code>&nbsp;to exclude:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --label com.centurylinklabs.watchtower.enable=false nginx<\/code><\/pre>\n\n\n\n<p>Containers with that label will be ignored by Watchtower.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"include-only-matching-containers\">Include Only Matching Containers<\/h3>\n\n\n\n<p>You can also whitelist containers to&nbsp;<em>only<\/em>&nbsp;update containers matching a pattern by using&nbsp;<code>--include<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --name watchtower \\\n  -v \/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n  containrrr\/watchtower --include \"container-a|container-b\" <\/code><\/pre>\n\n\n\n<p>Now Watchtower will only automatically update containers named&nbsp;<code>container-a<\/code>&nbsp;or&nbsp;<code>container-b<\/code>, ignoring all others.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-4---change-the-watchtower-polling-intervals\">Step 4 &#8211; Change the Watchtower Polling Intervals<\/h2>\n\n\n\n<p>Watchtower will check for new images every few minutes by default. You can change how frequently Watchtower polls for new images.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"check-for-new-images\">Check for New Images<\/h3>\n\n\n\n<p>To change how often Watchtower checks for new images, pass the&nbsp;<code>--interval<\/code>&nbsp;option with a duration string:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --name watchtower \\\n  -v \/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n  containrrr\/watchtower --interval 5m<\/code><\/pre>\n\n\n\n<p>This will make Watchtower check for new images every 5 minutes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"restart-containers\">Restart Containers<\/h3>\n\n\n\n<p>By default, Watchtower will wait 10 minutes after an image update before restarting containers. You can modify the duration Watchtower waits before restarting with&nbsp;<code>--restart-delay<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ docker run -d --name watchtower \\\n -v \/var\/run\/docker.sock:\/var\/run\/docker.sock \\\n containrrr\/watchtower --restart-delay 2m<\/code><\/pre>\n\n\n\n<p>This will set the restart delay to 2 minutes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-5---automate-watchtower-startup\">Step 5 &#8211; Automate Watchtower Startup<\/h2>\n\n\n\n<p>The last step is to make sure Watchtower is automatically started when the Docker daemon starts up. This will run Watchtower each time you reboot the server.<\/p>\n\n\n\n<p>You can create a simple systemd unit file to start Watchtower on boot.<\/p>\n\n\n\n<p>Create a unit file at&nbsp;<code>\/etc\/systemd\/system\/watchtower.service<\/code>&nbsp;with this definition:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"properties\" class=\"language-properties\">[Unit]\nDescription=Watchtower - Auto update Docker containers\nRequires=docker.service\nAfter=docker.service\n\n[Service]\nRestart=always\nExecStart=\/usr\/bin\/docker start -a watchtower\nExecStop=\/usr\/bin\/docker stop -t 2 watchtower\n\n[Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p>This will start the Watchtower container we created when the Docker daemon starts up.<\/p>\n\n\n\n<p>Reload systemd and enable the Watchtower service to start on boot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo systemctl daemon-reload\n$ sudo systemctl enable watchtower<\/code><\/pre>\n\n\n\n<p>Watchtower will now automatically run each time you restart the server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-6---set-up-watchtower-in-docker-compose\">Step 6 &#8211; Set Up Watchtower in Docker Compose<\/h2>\n\n\n\n<p>You can also run Watchtower as part of a Docker Compose stack.<\/p>\n\n\n\n<p>Add a watchtower service to your docker-compose.yml file like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">version: \"3\"\n\nservices:\n\n  app:\n    image: myapp\n    ports:\n      - \"8080:80\"\n\n  watchtower:\n    image: containrrr\/watchtower\n    volumes:\n      - \/var\/run\/docker.sock:\/var\/run\/docker.sock\n    command: --interval 30<\/code><\/pre>\n\n\n\n<p>This will start Watchtower along with the app\/service containers defined in your compose file.<\/p>\n\n\n\n<p>Watchtower will monitor the other services and automatically update any images as new versions are released.<\/p>\n\n\n\n<p>The&nbsp;<code>volumes<\/code>&nbsp;mount the Docker socket so Watchtower can communicate with the Docker daemon.<\/p>\n\n\n\n<p>The&nbsp;<code>command<\/code>&nbsp;sets the check interval to 30 seconds. You can customize this interval as needed.<\/p>\n\n\n\n<p>Now when you run&nbsp;<code>docker-compose up<\/code>, Watchtower will keep your images updated out of the box!<\/p>\n\n\n\n<p>Using Docker Compose allows you to easily add Watchtower monitoring to new and existing stacks. Just add the watchtower service and volume mount to begin auto-updating any new or existing images.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>In this guide we covered how to install and configure Watchtower to automatically update your Docker containers.<\/p>\n\n\n\n<p>Key takeaways include:<\/p>\n\n\n\n<ul>\n<li>Watchtower runs as a Docker container to monitor other containers<\/li>\n\n\n\n<li>Notifications can alert you when Watchtower updates containers<\/li>\n\n\n\n<li>Exclude containers from auto-updates by name or label<\/li>\n\n\n\n<li>Change the frequency Watchtower checks for new images<\/li>\n\n\n\n<li>Create a systemd unit file to launch Watchtower on boot<\/li>\n<\/ul>\n\n\n\n<p>With Watchtower running, you no longer have to manually check for Docker image updates or restart containers. Watchtower will keep your containers running the latest versions automatically in the background.<\/p>\n\n\n\n<p>This makes managing container updates much easier as your stack grows in size. Give Watchtower a try to simplify keeping your containers current!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using Docker provides many benefits like allowing you to package applications into standardized units for software development. This makes it easier to deploy and scale your applications. However, managing updates of the Docker images on a server can become tedious. You have to manually pull new versions of an image and restart each container every ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[69,182],"tags":[],"yoast_head":"\n<title>Update automatically Docker containers with Watchtower on Ubuntu - WebHi Tutorials &amp; Documentations<\/title>\n<meta name=\"description\" content=\"A guide to installing Watchtower on Ubuntu to automatically update Docker containers in the background. Covers configuring notifications, excluding containers, changing polling frequency, and automating startup.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Update automatically Docker containers with Watchtower on Ubuntu - WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"og:description\" content=\"A guide to installing Watchtower on Ubuntu to automatically update Docker containers in the background. Covers configuring notifications, excluding containers, changing polling frequency, and automating startup.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/\" \/>\n<meta property=\"og:site_name\" content=\"WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webhi.technology\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-24T17:13:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-07T16:02:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/08\/watchtower_docker_en.jpg\" \/>\n<meta name=\"author\" content=\"webhi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:site\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webhi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/\"},\"author\":{\"name\":\"webhi\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\"},\"headline\":\"Update automatically Docker containers with Watchtower on Ubuntu\",\"datePublished\":\"2023-08-24T17:13:46+00:00\",\"dateModified\":\"2023-12-07T16:02:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/\"},\"wordCount\":1289,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"articleSection\":[\"Linux system administration\",\"Virtualization &amp; Cloud computing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/\",\"name\":\"Update automatically Docker containers with Watchtower on Ubuntu - WebHi Tutorials &amp; Documentations\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\"},\"datePublished\":\"2023-08-24T17:13:46+00:00\",\"dateModified\":\"2023-12-07T16:02:29+00:00\",\"description\":\"A guide to installing Watchtower on Ubuntu to automatically update Docker containers in the background. Covers configuring notifications, excluding containers, changing polling frequency, and automating startup.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webhi.com\/how-to\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Update automatically Docker containers with Watchtower on Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"name\":\"WebHi Tutorials &amp; Documentations\",\"description\":\"System administration and knowledge base\",\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\",\"name\":\"WebHi Technology\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"width\":288,\"height\":95,\"caption\":\"WebHi Technology\"},\"image\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webhi.technology\",\"https:\/\/twitter.com\/WebHiTechnology\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\",\"name\":\"webhi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781214743\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781214743\",\"caption\":\"webhi\"},\"sameAs\":[\"https:\/\/www.webhi.com\/how-to\"],\"url\":\"https:\/\/www.webhi.com\/how-to\/author\/webhi\/\"}]}<\/script>\n","yoast_head_json":{"title":"Update automatically Docker containers with Watchtower on Ubuntu - WebHi Tutorials &amp; Documentations","description":"A guide to installing Watchtower on Ubuntu to automatically update Docker containers in the background. Covers configuring notifications, excluding containers, changing polling frequency, and automating startup.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/","og_locale":"en_US","og_type":"article","og_title":"Update automatically Docker containers with Watchtower on Ubuntu - WebHi Tutorials &amp; Documentations","og_description":"A guide to installing Watchtower on Ubuntu to automatically update Docker containers in the background. Covers configuring notifications, excluding containers, changing polling frequency, and automating startup.","og_url":"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/","og_site_name":"WebHi Tutorials &amp; Documentations","article_publisher":"https:\/\/www.facebook.com\/webhi.technology","article_published_time":"2023-08-24T17:13:46+00:00","article_modified_time":"2023-12-07T16:02:29+00:00","og_image":[{"url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/08\/watchtower_docker_en.jpg"}],"author":"webhi","twitter_card":"summary_large_image","twitter_creator":"@WebHiTechnology","twitter_site":"@WebHiTechnology","twitter_misc":{"Written by":"webhi","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/#article","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/"},"author":{"name":"webhi","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54"},"headline":"Update automatically Docker containers with Watchtower on Ubuntu","datePublished":"2023-08-24T17:13:46+00:00","dateModified":"2023-12-07T16:02:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/"},"wordCount":1289,"commentCount":0,"publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"articleSection":["Linux system administration","Virtualization &amp; Cloud computing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/","url":"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/","name":"Update automatically Docker containers with Watchtower on Ubuntu - WebHi Tutorials &amp; Documentations","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/#website"},"datePublished":"2023-08-24T17:13:46+00:00","dateModified":"2023-12-07T16:02:29+00:00","description":"A guide to installing Watchtower on Ubuntu to automatically update Docker containers in the background. Covers configuring notifications, excluding containers, changing polling frequency, and automating startup.","breadcrumb":{"@id":"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhi.com\/how-to\/update-automatically-docker-containers-with-watchtower-on-ubuntu-18-04-20-04-22-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhi.com\/how-to\/"},{"@type":"ListItem","position":2,"name":"Update automatically Docker containers with Watchtower on Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/www.webhi.com\/how-to\/#website","url":"https:\/\/www.webhi.com\/how-to\/","name":"WebHi Tutorials &amp; Documentations","description":"System administration and knowledge base","publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webhi.com\/how-to\/#organization","name":"WebHi Technology","url":"https:\/\/www.webhi.com\/how-to\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","contentUrl":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","width":288,"height":95,"caption":"WebHi Technology"},"image":{"@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webhi.technology","https:\/\/twitter.com\/WebHiTechnology"]},{"@type":"Person","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54","name":"webhi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/","url":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781214743","contentUrl":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781214743","caption":"webhi"},"sameAs":["https:\/\/www.webhi.com\/how-to"],"url":"https:\/\/www.webhi.com\/how-to\/author\/webhi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/6391"}],"collection":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/comments?post=6391"}],"version-history":[{"count":8,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/6391\/revisions"}],"predecessor-version":[{"id":7345,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/6391\/revisions\/7345"}],"wp:attachment":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/media?parent=6391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/categories?post=6391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/tags?post=6391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}