Loading...
E.G.

Updating Home Assistant in Docker With a Pinned Image Tag

· updated
Part 3 of 7Series: Running it: updates, backup, recoveryAll parts
  1. 01Where Home Assistant Runs: One Small VM, Measured
  2. 02Splitting a 2,000-Line automations.yaml into 8 Files
  3. 03Updating Home Assistant in Docker With a Pinned Image Tag
  4. 04Home Assistant Backup: Archiving the Host Along With Config
  5. 05Restoring Home Assistant From Backup: What I Have Tested
  6. 0621 Releases Behind: I Rebuilt Instead of Upgrading
  7. 07One Day of Home Assistant Logs: 775 Errors, Seven Findings
Table of Contents

My first Home Assistant ran as a plain Docker container on version 2024.11.1, and I never updated it. That was not the result of a failed attempt. I decided against it, because the container had been started with docker run and had no compose file, the configuration had grown over years, and the only way back would have been a snapshot of the whole VM. By August 2026 it was 21 monthly releases behind, and I built a new instance instead, which I describe in my post on the rebuild.

In March 2026 I had written an update plan for the old instance, with a backup, an order for the custom integrations and a checklist. I never ran it. On the new instance I set things up so that an update is a short, planned job, and I have done two updates there.

Pin the image tag

The new instance runs from a compose file, and the image tag is a fixed version instead of latest or stable. With latest or stable, a pull can download a newer version, which then starts the next time the container is recreated, whether I planned an upgrade or not. With a pinned tag the version only changes when I change that line, and the previous tag stays in the git history.

services:
  homeassistant:
    container_name: homeassistant
    # pinned: with :latest every pull and recreate could be an unplanned upgrade
    image: ghcr.io/home-assistant/home-assistant:2026.11.1
    restart: unless-stopped
    network_mode: host
    volumes:
      - /path/to/config:/config

In September the Tapo camera integration wanted to update to 7.2 and refused with the message that this version requires Home Assistant 2026.9.0 or newer. So I updated Home Assistant first and then installed version 7.2 of the integration.

The routine I used twice

I start with the backward-incompatible changes in the release notes and compare them with the integrations I actually use. Then I create a fresh encrypted backup with Home Assistant's own backup action, backup.create_automatic; the built-in backup works in a Container installation as well, under Settings → System → Backups. I pull the new image while the old container is still running, so it is only gone for seconds when I switch. After that I change the tag in the compose file, in the repository and on the server, and recreate the container. Before I update any custom integration, which usually means a second restart, I check the KNX connection, a few key values and the log.

# new image first, while the old container is still running
docker pull ghcr.io/home-assistant/home-assistant:2026.11.1
# then change the tag in docker-compose.yml and recreate
docker compose up -d homeassistant
docker logs -f homeassistant

28 September: 2026.8.2 to 2026.9.4

The whole update took about a quarter of an hour. The one change that touched my setup was that KNX no longer sends exposed values at startup. The new instance did not expose any values yet, so I had nothing to change. The Modbus YAML stayed as it was. Home Assistant answered again 15 seconds after the container was recreated. After that I updated the camera integration, which needed the second restart.

10 November: 2026.9.4 to 2026.11.1

This time I skipped 2026.10 and waited for the first bugfix release on purpose, because 2026.11 replaced HACS with the built-in Marketplace. Because of the skipped version I read both sets of release notes, 22 entries for 2026.10 and 45 for 2026.11, and none of them named an integration I use. I also ran check_config with the old and the new image against a copy of my configuration, and both reported only the same known error, a media folder that does not exist in the test container. The backup right before the switch was 131 MB. After the switch the instance had 680 entities, as before. The Marketplace part is in my post on the 2026.11 upgrade.

The way back, which I have not needed

The old image stays on the server until the new version has run for a while. For a rollback I would stop the container, restore the configuration and the database from the backup taken before the update, and only then start the old image again. The backup matters because the update migrates the recorder database and the KNX telegram history, and I would not run a migrated database on the older version.

I have not done this rollback. In October I tested whether my backups can be read and decrypted, and the database in the backup passed SQLite's integrity check, but I did not restore a backup into a new instance and start it. I still need to test whether Home Assistant starts with a restored configuration and database.

What I changed compared with the old plan

My March plan would have updated the custom integrations first and tested them against the old core. On the new instance I did it the other way round in September, because the camera integration needed the new core. I do not use Watchtower or other automatic updates, because I want to start every update myself.

Frequently asked questions

Why not use the latest or stable tag?

With a floating tag every pull can bring a new version, and afterwards you have to look up which version you were on before. A pinned tag makes the update a one-line change.

Does Home Assistant's own backup work in Docker?

Yes. A Container installation has Settings → System → Backups and the backup.create_automatic action, and I create one before every update.

Can I go back to an older Home Assistant version?

Stop the container, restore the backup from before the update, then start the old image. I have prepared this but not done it.

Related articles

Questions or additions?

Comments run on GitHub Discussions, so you need a GitHub account to write one.