Updating Home Assistant inside Docker

No luck, it claims this is a directory, not to mislead so I’ll repeat this again - I was unable to run visudo on the host machine, could that be what’s causing this ?

I dont think so. once you do login and want to execute the command, that will be another problem.
right now you cant login from the container

try ssh -i /root/.ssh/id_rsa.pub -p xx [email protected]

Sorry, still asks for the password…

uff, not sure I can hep more. Perhaps try Discord.

I really appreciate it anyhow, once I resolve this - I’ll update here, thanks a lot @juan11perez

welcome. sorry i couldnt help resolve.

From what I remember, ssh is very particular about the permissions of the key files and its directory.

Make sure that the directory that contains the key files is readable only by the user using them, and the private key is the same. Otherwise ssh refuses to work.

I just wanted to clarify that you are never meant to update anything inside a docker container. Docker exists so that developers (and others) can create a container that works anywhere its run, and if you change anything inside the container, that defeats the whole purpose. Those who run HA using Docker, will never update the HA instance in the container, but the entire image. This prevents anything breaking.


Hi, how can I add that label I don’t understand I’m new in Docker I have watchtower installed with Docker compose, and hassio, thank you

In your case as you’re using Hassio, you cant add any label to Hassio as it’s managed by the systemd start up file. It’s not in your docker compose.

So the solution is to do the opposite, basically specify the dockers you want to update via Watchtower.

For that you need to do the following:
In watchtower add:

command: --debug --label-enable --cleanup --interval 300

  • “com.centurylinklabs.watchtower.enable=true”

the --label-enable command will tell watchtower to update only the dockers that have the following:

- "com.centurylinklabs.watchtower.enable=true"

so you add that section to every docker you want auto-update

hope it helps

1 Like

Thank you, well explain, do all the steps on all my containers, let’s see how it goes, now I have to figure out how to set the notifications with watchtower in docker compose

Im running 0.88.2 and 0.89 is out, how do I force hassio to see the update?

You wait patiently until the update is ready.

and how do I cope if after the upgrade I don’t see the bug fix I’m waiting? :smile::smile::smile:

With a stiff upper lip :wink:

Thanks for this. Exactly the solution to my problem!

Suggest using PORTAINER. Has a web GUI and you can update using that easily.

1 Like

I was thinking of trying this for the first time, but am concerned that I have a quick fallback solution, in case the new release breaks something and I need to revert to my current release quickly.
What would the procedure be to revert to a previous release following a failed upgrade attempt?

take note of the current version you are running now (ex 2021.11.5)

then if you need to go back then just add that info to the end of the image in your docker run command:

sudo docker run -d etc, etc, ........... homeassistant/home-assistant:2021.11.5

note you need to remove the existing HA container first.

I just created a little project which makes it easy to update DockerContainer (& Homeassistant Container) via Homeassistant Update entities:

MqDockerUp: A tool to monitor and update your docker containers from Home Assistant - Share your Projects! - Home Assistant Community (home-assistant.io)