Just some tips I gathered over time. All in one easily reachable place so I can share it wherever I want.
Some of it is just for me to copy and paste from :)
- HAOS Tips
In rare cases the supervisor or CLI container/image can get corrupted. This can help restore that.
Needs to be run in a OS level shell and only if you know what you're doing and have backups.
systemctl stop hassos-supervisor.service && docker stop hassio_supervisor hassio_cli
docker system prune -af
systemctl start hassos-supervisor.serviceThis is useful to test shell_command/command_line or similar things which run in the homeassistant container.
Addons are docker containers so I might refer to them either way.
Please also read the background here.
You need the Advanced SSH Addon with disabled protection mode

Make sure to restart the addon for it to take effect. This gives you access to the docker command.
Use docker ps to list containers/addons
docker ps --format '{{.Names}}'Or just docker ps which is more verbose
docker psTo also show stopped containers/addons
docker ps -aThe output can look similar to this
# docker ps --format '{{.Names}}'
hassio_supervisor
addon_a0d7b954_sqlite-web
addon_a0d7b954_nodered
addon_core_configurator
addon_core_samba
addon_core_ssh
addon_a0d7b954_vscode
addon_a0d7b954_glances
addon_a0d7b954_ssh
addon_core_mosquitto
hassio_multicast
hassio_audio
hassio_dns
hassio_cli
homeassistant
hassio_observerTo now enter a running container you can use something like this
# Use sh if bash doesn't work
docker exec -ti homeassistant bashUse CTRL+D or exit to get out again.
To just run a simple command you can do something like this
docker exec homeassistant cat /OFFICIAL_IMAGEDepends on information above.
This can be useful to check where an addon stores its configuration.
docker inspect homeassistant | jq .[].MountsDepends on information above.
docker inspect addon_core_mosquitto | jq .[].HostConfig."PortBindings"I have a separate article about how to check this here.
ha dns options --fallback=false
# To also set the server(s)
ha dns options --servers dns://DNSSERVERIPHERE --fallback=false
# Might not be needed
ha dns restartThe HA CLI provides
ha core restart --safe-modebut this might not always work. In such cases you can do this.
Via addon
touch /homeassistant/safe-modeVia OS shell.
touch /mnt/data/supervisor/homeassistant/safe-modeWhen core starts and finds this file it will trigger safe-mode and remove it.
HAOS stores the credentials in /mnt/data/supervisor/.mounts_credentials/SHARENAME. You can extract them like this.
Via Advanced SSH addon with disabled protection mode
docker run --rm -ti -v /:/host:ro alpine sh -c "grep -sR . /host/mnt/data/supervisor/.mounts_credentials/"Via OS shell
grep -sR . /mnt/data/supervisor/.mounts_credentials/HAOS itself has no package manager but most addons are based on Alpine and it has many packages.
For example
apk add gdu
gdu /I trust you have good reasons for needing this. Proceed at your own risk.
Please also read the background here.
You can gain access to the OS' CLI through the Advanced SSH addon like this
docker run --rm --privileged --pid=host -it alpine:latest nsenter -t 1 -m -u -n -i shUse CTRL+D or exit to get out again.
You need the Advanced SSH addon with disabled protection mode (restart it after disabling it) to get access to the docker command.

I recommend this way because it's very simple to enable/disable, you can use a proper SSH client and you can just copy & paste commands.
Typing all the commands in via keyboard & monitor is quite cumbersome, especially because you cannot change the keyboard layout.
This requires logging in via developer SSH access on port 22222.
Use a keyboard and monitor or the display/serial/terminal your hypervisor provides to access the OS.
You might have to enter login when inside the HA CLI. Use root as username if you're asked.
I have instructions on how to set up a serial terminal with Proxmox VE here.
In case your need to grab your backup key from a old system, etc.
Via addon
grep "password" /homeassistant/.storage/backupVia OS shell.
grep "password" /mnt/data/supervisor/homeassistant/.storage/backup