Skip to content

Instantly share code, notes, and snippets.

@Impact123
Last active April 28, 2025 23:44
Show Gist options
  • Save Impact123/e9a4a07b184eb393d2ff762e3b1b0a05 to your computer and use it in GitHub Desktop.
Save Impact123/e9a4a07b184eb393d2ff762e3b1b0a05 to your computer and use it in GitHub Desktop.

HAOS Tips

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 :)

Table of contents

Run commands in a container/addon

This is useful to test shell_command/command_line or similar things.
Addons are docker containers so I might refer to them either way.

Prerequisites

You need the Advanced SSH Addon with disabled protection mode image
Make sure to restart the addon for it to take effect. THis gives you access to the docker command.

Listing containers/addons

Use docker ps to list containers/addons

docker ps --format '{{.Names}}'

Or just docker ps which is more verbose

docker ps

To also show stopped containers/addons

docker ps -a

The 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_observer

Entering containers

To now enter a runing container you can use something like this

docker exec -ti homeassistant sh

Use CTRL+D or exit to get out again.

Running simple commands

To just run a simple command you can do something like this

docker exec homeassistant cat /OFFICIAL_IMAGE

Checking container/addon mounts

Depends on information above.

This can be useful to check where an addon stores its configuration.

docker inspect homeassistant | jq .[].Mounts

Checking addon port bindings

Depends on information above.

docker inspect addon_core_mosquitto | jq .[].HostConfig."PortBindings"

Checking used space

I have a separate article about how to check this here.

Disable DNS fallback

ha dns options --servers dns://DNSSERVERIPHERE --fallback=false

# Might not be needed
ha dns restart

Install packages

HAOS itself has no package manager but most addons are based on Alpine and it has many packages.

For example

apk add gdu
gdu /

Get a OS level shell

I trust you have good reasons for needing this. Proceed at your own risk.

Through Advanced SSH addon

You can gain access to the OS' CLI through the the Advanced SSH addon like this

docker run --rm --privileged --pid=host -it alpine:latest nsenter -t 1 -m -u -n -i sh

You need the Advanced SSH addon with disabled protection mode (restart it after disabling it) to get access to the docker command.
image

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.

Developer SSH

This requires logging in via developer SSH access on port 22222.

Keyboard & monitor / Virtual Machine

Use a keyboard and monitor or the display/serial/terminal your hypervisor provides to access the OS.
I have instructions on how to set up a serial terminal with Proxmox VE here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment