# Homekit and Docker

**URL:** <https://community.openhab.org/t/homekit-and-docker/94673>\
**Category:** Installation\
**Tags:** openhab2, homekit\
**Created:** [March 16, 2020, 8:59am UTC](https://community.openhab.org/t/homekit-and-docker/94673 "2020-03-16T08:59:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![oeiber](https://community.openhab.org/letter_avatar_proxy/v4/letter/o/5f9b8f/32.png) [@oeiber](https://community.openhab.org/u/oeiber)\
**Post date:** [March 16, 2020, 8:59am UTC](https://community.openhab.org/t/homekit-and-docker/94673/1 "2020-03-16T08:59:57Z")

</div>

Hi everybody,  
since a few day my oh2 instance runs inside docker enviroment. Everything works perfectly exept homekit integration:  
My oh container is located in a docker bridge network and is not configured with “network\_mode=host”.  
On my docker host runs a avahi-daemon, which reflects mdns to the host’s network.  
On my client I can see, homekit is advertising with the internal docker ip. When I set the configuration option ‘network interface’ to the hosts’s ip, nothing will be advertised.  
I think after configuring the network interface, homekit’s socket cannot be bound to the specified ip, because it does not exist inside the container.  
Is the an additional configuration option where fqnd and/or ip for mdns advertisements can be set?

Thank you vor your help!

Regards,

Oliver

---

<div class="post-metadata">

**Author:** ![BrutalBirdie](https://community.openhab.org/user_avatar/community.openhab.org/brutalbirdie/32/47907_2.png) [@BrutalBirdie](https://community.openhab.org/u/BrutalBirdie)\
**Post date:** [March 16, 2020, 9:20am UTC](https://community.openhab.org/t/homekit-and-docker/94673/2 "2020-03-16T09:20:48Z")

</div>

> [@Openhab Docker homekit - HomeKit doesn't discover the openHAB bridge even after typing in the manual code](https://community.openhab.org/t/openhab-docker-homekit-homekit-doesnt-discover-the-openhab-bridge-even-after-typing-in-the-manual-code/90901/7):
>
> Brief update: when I run docker on a RPI4, the HomeKit binding works well when I use --net=host given the identical subnetwork. The documentation for openhab docker ([https://hub.docker.com/r/openhab/openha](https://hub.docker.com/r/openhab/openha)) is straightforward.

You need network mode host.

---

<div class="post-metadata">

**Author:** ![oeiber](https://community.openhab.org/letter_avatar_proxy/v4/letter/o/5f9b8f/32.png) [@oeiber](https://community.openhab.org/u/oeiber)\
**Post date:** [March 16, 2020, 9:33am UTC](https://community.openhab.org/t/homekit-and-docker/94673/3 "2020-03-16T09:33:01Z")

</div>

> [@BrutalBirdie](#):
>
> You need network mode host.

That’s bad ☹  
I think network mod host i a little bit against the logic of docker containers…

---

<div class="post-metadata">

**Author:** ![BrutalBirdie](https://community.openhab.org/user_avatar/community.openhab.org/brutalbirdie/32/47907_2.png) [@BrutalBirdie](https://community.openhab.org/u/BrutalBirdie)\
**Post date:** [March 16, 2020, 9:53am UTC](https://community.openhab.org/t/homekit-and-docker/94673/4 "2020-03-16T09:53:14Z")

</div>

I can understand your feeling, but it is needed for some openHAB bindings.

Another example would be the phillips hue gateway or the network binding.  
They can not communicate with openHAB if not present in the local net.

---

<div class="post-metadata">

**Author:** ![oeiber](https://community.openhab.org/letter_avatar_proxy/v4/letter/o/5f9b8f/32.png) [@oeiber](https://community.openhab.org/u/oeiber)\
**Post date:** [March 16, 2020, 11:48am UTC](https://community.openhab.org/t/homekit-and-docker/94673/5 "2020-03-16T11:48:37Z")

</div>

ok. i understand. is there a way to restrict access to port 8080 and 8443 to my nginx instance only? i generally want that all web traffic to openhab goes to my reverse proxy.

thank you!

---

<div class="post-metadata">

**Author:** ![oeiber](https://community.openhab.org/letter_avatar_proxy/v4/letter/o/5f9b8f/32.png) [@oeiber](https://community.openhab.org/u/oeiber)\
**Post date:** [March 23, 2020, 9:55pm UTC](https://community.openhab.org/t/homekit-and-docker/94673/6 "2020-03-23T21:55:56Z")

</div>

Finally I switched to network\_mode host either for my openhab and nginx container. I also added "OPENHAB\_HTTP\_ADDRESS: “127.0.0.1” to my docker-compose.yml to prevent oh being accessed directly.
