Home Assistant is a great tool if you want to automate your home.
However, there are slight issues with it. Based on official installation instructions, we see that we should run the Docker container or our Raspberry Pi as follows:
docker run -d \
--name homeassistant \
--privileged \
--restart=unless-stopped \
-e TZ=MY_TIME_ZONE \
-v /PATH_TO_YOUR_CONFIG:/config \
--network=host \
ghcr.io/home-assistant/home-assistant:stable
# In my case:
docker run -d \
--name homeassistant \
--privileged \
--restart=unless-stopped \
-e TZ=Europe/Vilnius \
-v /home/ernestas/homeassistant:/config \
--network=host \
ghcr.io/home-assistant/home-assistant:stable
Note the –network=host part. In theory, it should force Docker container to use ports from the host – i.e. my Raspberry Pi – machine. However, when I start my Docker container with this configuration, I can not reach installed Home Assistant via http://<my_ip>:8123/
After some googling, I found that there are similar complaints on the Internet:
- https://community.home-assistant.io/t/cannot-access-localhost-8123-when-running-in-docker-with-network-host/462358/10
- https://community.home-assistant.io/t/how-to-run-homeassistant-on-docker-on-its-own-network-instead-of-the-host-network/189315
Long story short, –network=host does not work. What to do? Expose ports directly, like this:
# 8123 is a UI port
# 5353 is a mDNS (service self - discovery port)
docker run -d \
--name homeassistant \
--privileged \
--restart=unless-stopped \
-e TZ=Europe/Vilnius \
-v /home/ernestas/homeassistant:/config \
-p 8123:8123 \
-p 5353:5353 \
-p 1900:1900 \
-p 5683:5683 \
-p 51827:51827 \
-p 3000:3000 \
-p 3001:3001 \
ghcr.io/home-assistant/home-assistant:stable
After these changes, I can run my Home Assistant.
Be First to Comment