Running a second home-assistant instance


I was trying to set up a second home-assistant instance along my production one.
What I did, was to change the http.server_port to an unused port.
However, I cannot start the second instance due to a port already being used.

2020-02-20 19:22:44 INFO (MainThread) [homeassistant.setup] Setting up logger
hadev                 | Exception in thread Thread-3:
hadev                 | Traceback (most recent call last):
hadev                 |   File "/usr/local/lib/python3.7/", line 926, in _bootstrap_inner
hadev                 |
hadev                 |   File "/usr/local/lib/python3.7/site-packages/pysonos/", line 307, in run
hadev                 |     listener = EventServer(self.address, EventNotifyHandler)
hadev                 |   File "/usr/local/lib/python3.7/", line 452, in __init__
hadev                 |     self.server_bind()
hadev                 |   File "/usr/local/lib/python3.7/", line 466, in server_bind
hadev                 |     self.socket.bind(self.server_address)
hadev                 | OSError: [Errno 98] Address in use

To me, it seems that the sonos integration tries to create a port bind itself, which might already be used by the main instance?

Or am I missing something else? Is this a bad idea at all?
I am just trying to create an instance to experiment with my new lovelace configuration.

Thanks in advance,

As far as I know, the port 8123 is hardcoded in HA. I have a second instance on a separate RbPi.

This is definitely because of the Sonos integration. I have been running two instances side-by-side on the same computer for a few years now. Both instances are using the same venv, but a different port and configuration directories.

You would need to disable sonos on the second instance, and possibly other integrations that also need to bind to a hard-coded port.

1 Like

you did this in home assistant config file? just checking
what is your install method?

try disabling sonos integration.
turn off discovery since this is 2nd instance and likely discovery not wanted/needed

Thanks, I will try disabling the integration and discovery.

I copied my complete ha directory. Is there a way to remove the integration via the files under the .storage directory?

Deleting . storage will remove it but also will remove user/pass etc.

Maybe you may also stop other HA and run this one.

1 Like