Installing HA in docker on Ubuntu as non-root user

It looks like a solution to my issue described above is to use sticky bits on the home assistant folder managed by the host, using chmod g+s dir

Create a test file from within the container before setting the sticky bit:

$ docker exec -it homeassistant /bin/bash
root@hass:/usr/src/app# cd /config/
root@hass:/config# touch test
root@hass:/config# ls -al
...
-rw-rw-r--+  1 root root        0 Oct 29 20:06 test

This defaults to root:root. Exit the container and set the sticky bit on your home assistant folder:

$ chmod g+s ~/docker/homeassistant

Return to the container and create another test file

$ docker exec -it homeassistant /bin/bash
root@hass:/usr/src/app# cd /config/
root@hass:/config# touch test2
root@hass:/config# ls -al
...
-rw-rw-r--+  1 root root        0 Oct 29 20:06 test
-rw-rw-r--+  1 root  999        0 Oct 29 20:08 test2

Success! Works on directories created within the container too. :slight_smile: