Keeping Dokku Apps Fresh: The Easy Way to Update Deployed Images

Vivek KaushikVivek Kaushik
2 min read

Ever found yourself in the endless cycle of "delete Docker image, redeploy, repeat" to keep your Dokku apps updated? You’re not alone. If your Dokku-deployed application relies directly on a Docker image (perhaps from Docker Hub or your private registry), you might've noticed a frustrating behavior: once Dokku pulls the image even when you use the latest tag it won’t fetch updates unless you manually delete the old image.
This got me scratching my head until I stumbled onto an elegant fix that streamlines the workflow and fits perfectly into the minimalist, automation-loving philosophy I share here.

The Problem

By default, Dokku holds onto the Docker image it fetched during the initial deploy. No matter how many times you rebuild or redeploy with the same tag, Dokku won’t pull a fresher image from the registry unless you interfere by deleting it manually.

The Solution: Automate Image Updates with Build Options

Dokku’s flexibility shines if you know where to look. The trick is to tell Dokku to pull the latest image from your registry every time you rebuild—completely bypassing the need to manually delete old images.

Step 1: Add Docker Build Options to Your App

You'll use Dokku's docker-options to modify how the build and deploy steps work for your app.

dokku docker-options:add <app-name> build --pull --no-cache
  • Replace <app-name> with the name of your Dokku app.

  • --pull makes sure Docker pulls the latest version of the image from your registry.

  • --no-cache ensures Docker doesn’t use a cached image locally.

Step 2: Rebuild Your App

Now, whenever you want to update to the latest image (say, after pushing to your Docker registry), run:

dokku ps:rebuild <app-name>

That's it! Dokku will pull down the freshest image, rebuild, and restart your app—no more manual deletions required.

That’s a Wrap

This approach works wonders for keeping your Dokku deployments lean and up-to-date.

0
Subscribe to my newsletter

Read articles from Vivek Kaushik directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Vivek Kaushik
Vivek Kaushik

Hi, I am Vivek, a 26 years old developer from India. I love making apps. You can check my github for some of my open source projects.