Installation on Docker rootless

Hi All,

I just installed HA in Ubuntu 20.04 with Docker rootless. It is my own computer.

I followed the instructions here without problems.

But when I try to access to the IP address:
http://192.168.1.137:8123/
it says connection refused.

What can I do or check? Maybe is some problem with Docker being rootless?
Thanks in advance.

a bit more data please, do you see the login screen or where does it throw the error
can you access the log file of HA in /config …(i.e. has it properly started)?
docker --net=host?
Firewall enabled> port open? ssl? internal/external url?
paste your configuration.yaml as well

Hi,

I do not see the login screen. The browser says ERR_CONNECTION_REFUSED.

I am just new to docker or HA. I am not sure where to look for the logs.

I just executed these commands:

jordi@asgard:~$ docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e7565604664d ghcr.io/home-assistant/home-assistant:stable "/init" 39 minutes ago Up 11 minutes homeassistant'

jordi@asgard:~$ docker container logs homeassistant [s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] done. [services.d] starting services [services.d] done. [cont-finish.d] executing container finish scripts... [cont-finish.d] done. [s6-finish] waiting for services. Unable to find configuration. Creating default one in /config [finish] process exit code 0 s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening [s6-finish] sending all processes the TERM signal. [s6-finish] sending all processes the KILL signal and exiting. [s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] done. [services.d] starting services [services.d] done.

configuration.yaml:

`# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

Text to speech

tts:

  • platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml`

Thanks for helping.

OK, a few step back a bit …

  • what command did you use to install the container?
  • firewall setup? (sudo ufw status)
  • in the config there is a file “home-assistant.log” does that show to have properly started?
    and please paste your data between ``` (back-quotes) so it does not disfigure

and maybe we can do this offline in discord, to not overload this chain with all sorts of stuff little people are interested with? I am there with the same id ‘vingerha’

as an example, I am not (!) using docker supervised…just the regular one and I use this to install a deamonized container

docker run -d --name="homeassistant" --restart unless-stopped -v [foldertoconfig]:/config  -e TZ=Europe/Paris --net=host ghcr.io/home-assistant/home-assistant:2022.3

this sets up a ‘host’ docker not needing ports and makin it easier to connect to the rest of the net, the zigbee stick etc. The [ foldertoconfig] points to a folder tree where the hole HA config will be built, meaning that one can easier access this and it is persistent when you upgrade the container
Added to that I do have firewall setup

sudo ufw enable
sudo ufw allow 8123

but you can start without firewall too (to not continuously need to add ports)

Hi,

Sorry, I don’t know what is discord.

I used this command to install HA:

docker run -d \
  --name homeassistant \
  --privileged \
  --restart=unless-stopped \
  -e TZ=Europe/Madrid \
  -v /home/jordi/homeassistant:/config \
  --network=host \
  ghcr.io/home-assistant/home-assistant:stable
jordi@asgard:~$ sudo ufw status
Status: inactive

There are 3 log files, all of them empty.

jordi@asgard:~$ ls -l homeassistant/
total 1452
-rw-r--r-- 1 jordi jordi       2 abr  5 12:46 automations.yaml
drwxr-xr-x 4 jordi jordi    4096 abr  5 12:46 blueprints
-rw-r--r-- 1 jordi jordi     235 abr  5 12:46 configuration.yaml
drwxr-xr-x 2 jordi jordi    4096 abr  5 12:46 deps
-rw-r--r-- 1 jordi jordi       0 abr  5 13:14 home-assistant.log
-rw-r--r-- 1 jordi jordi       0 abr  5 12:46 home-assistant.log.1
-rw-r--r-- 1 jordi jordi       0 abr  5 13:14 home-assistant.log.fault
-rw-r--r-- 1 jordi jordi  172032 abr  5 13:14 home-assistant_v2.db
-rw-r--r-- 1 jordi jordi   32768 abr  5 14:25 home-assistant_v2.db-shm
-rw-r--r-- 1 jordi jordi 1252512 abr  5 14:25 home-assistant_v2.db-wal
-rw-r--r-- 1 jordi jordi       0 abr  5 12:46 scenes.yaml
-rw-r--r-- 1 jordi jordi       0 abr  5 12:46 scripts.yaml
-rw-r--r-- 1 jordi jordi     161 abr  5 12:46 secrets.yaml
drwxr-xr-x 2 jordi jordi    4096 abr  5 12:46 tts

discord is a chat-tool where (aside also a lot of gamers) you will find lots of other HA enthusiasts. You can always have a look in time. e.g. there is one Home Assistant Addicts for dwains-dasboard (for HA)
Back to the topic…
remove the privileged
it is: --net=host
tried it just now with me and that works

 docker run -d   --name homeassistant   --restart=unless-stopped   -e TZ=Europe/Madrid   -v /home/jordi/homeassistant:/config   --net=host   ghcr.io/home-assistant/home-assistant:stable

I can also recommend to not use ‘stable’ but a fixed version. If for some reason you reload it, it may go to another new stable version and you might end up in issues (all versions break something).
So mine states:
ghcr.io/home-assistant/home-assistant:2022.3” and if you read the logs following sub-version had quite some issues

Nope.

I stopped tha container, removed it and tried without the privileged. I cannot still connect to 8123 port.

I think the problem is related to docker rootless. A few weeks ago I did a quick try with standard docker, and with the same commands, HA was running in one minute.

and you did change the --net=host (not: --network=host) too?
I run docker with my normal account (not root and not sudo) so I am not convinced :slight_smile:
Are you sure the container is running (docker ps)
Also you could get some help installing portainer as well

docker run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 \
    --name=portainer --restart=always \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v portainer_data:/data \
    portainer/portainer-ce:2.11.1

IN other words, if you donot run it on host, then the port is not available on the net (only within docker container) and normally you would need to add a mapping similar as with the volumes However, I stronly recommend to run on ‘host’ as it then can also see otehr host-elements as usb ports etc. without much tweaking
Run : docker network inspect host
then see which containers are running on ‘host’ and at least one must be your homeassistant

Yes, I run it with --net=host.

docker run -d   --name homeassistant   --restart=unless-stopped   -e TZ=Europe/Madrid   -v /home/jordi/homeassistant:/config   --net=host   ghcr.io/home-assistant/home-assistant:stable

Homeassistant seems to be running on host:

jordi@asgard:~$ docker network inspect host
[
    {
        "Name": "host",
        "Id": "4a9bd79311413e3dc2b6f83931029f3e8c8987d1513cd80fa0dc6a11d4084fe1",
        "Created": "2022-04-05T12:39:39.479157889+02:00",
        "Scope": "local",
        "Driver": "host",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": []
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "78da0caa322292ad67de095f3cf486942b1a3d0f76ce6e99ece7302bf1125c24": {
                "Name": "homeassistant",
                "EndpointID": "558161b7f8ce04d5b325c14c4eca2ce2f1639b0c10fb2fa2ea95848ab2c65acb",
                "MacAddress": "",
                "IPv4Address": "",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

Additionally, I see this error in homeassistant logs:

jordi@asgard:~$ docker container logs homeassistant
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[finish] process exit code 0
s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.

Odd… I again tried this out and the error on “/var/run/s6/services:” I myself do not see. I also do not use the supervisor (no need for that) and am not sure wht this pops-up in this install.
There are a few topics out there dating already years back… you can search for this string. The below one has some tips (a.o. not use IPv6) but since I do not have this error, I cannot help.

[Docker Image] s6-svscanctl: fatal: unable to control /var/run/s6/services: supervisor not listening - Configuration - Home Assistant Community (home-assistant.io)

And maybe ?? this… I run my NUC on Ubuntu 21.10

Thanks for your help.

I will try a bit more and if it doesn’t work I will not insist and use docker with root.

OK, again… for me this install ran without any obstructions. I installed 21.10 on a Intel NUC and then docker-ce followed by HA and all others (deepstack/nodered/mqtt,etc.) which went fine. The fact that I can use your docker cli command to install this working-order as confirmation.
I am puzzled about the ‘supervisor’ error which is a functionality that is not offered in docker-version so not sure why this is requires starting.

Reviving this old thread… Anyone found a solution for rootless docker?

I know this is an old thread but, in case it helps anyone else, I found my rootless docker container for Home Assistant would run but I couldn’t connect through a browser. After trying lots of different things, I found I had to replace “-net=host” with “-p 8123:8123” and that allowed me to connect via a browser to the login screen.