Skip to content

Homebridge on LibreELEC

oznu edited this page May 13, 2022 · 11 revisions

This guide will show you how to run the oznu/homebridge docker image on a LibreELEC device.

1. Enable SSH Access

From the Kodi Confluence main menu, navigate to SYSTEM -> LibreELEC -> Services -> Enable SSH

2. Install Docker Add-on

From the Kodi Confluence main menu navigate to Add-ons -> Download -> Services -> Docker

3. Connect Over SSH

We should now be able to log in to LibreELEC via an SSH session on another machine on the local network. From this remote machine, enter the following:

ssh root@<IP address of the LibreELEC device> 

Provide the default password of libreelec or openelec.

4. Disable LibreELEC's Avahi Service

LibreELEC's avahi-daemon service conflicts with the Homebridge process, so you need to disable it first:

systemctl stop avahi-daemon
systemctl disable avahi-daemon

5. Create Homebridge Storage Directory

This is where your Homebridge config.json and other important files will be stored.

mkdir /storage/homebridge

6. Determine Which Image Tag To Use

You will need to pick the image variant/tag that matches the device you're running LibreELEC on. Type the following command to check your system architecture:

uname -m
  • x86_64 = Use the latest tag
  • armv7l or armv6l = Use the raspberry-pi tag
  • aarch64 = Use the aarch64 tag

7. Start Homebridge

Run this command to start Homebridge. Replace raspberry-pi on the last line with the tag determined in Step 6:

docker run -d --restart=always --net=host \
  --name=homebridge \
  -v /storage/homebridge:/homebridge \
  -e HOMEBRIDGE_CONFIG_UI=1 \
  -e HOMEBRIDGE_CONFIG_UI_PORT=8581 \
  oznu/homebridge:raspberry-pi

8. Ensure Homebridge Starts On Boot

Some users have reported Homebridge is not starting on boot despite the container being start with --restart=always. Use this workaround if you're experiencing this problem:

Open /storage/.config/autostart.sh for editing in nano:

nano /storage/.config/autostart.sh

Add this line to the bottom of the file:

docker restart homebridge

9. Managing Homebridge

To manage Homebridge go to http://<IP address of the LibreELEC device>:8581 in your browser. For example, http://192.168.1.20:8581. From here you can install, remove and update plugins, modify the Homebridge config.json and restart Homebridge.

Homebridge UI

Useful Docker Commands

Viewing Logs

docker logs -f homebridge

Restarting Homebridge

docker restart homebridge

Removing Homebridge Container

docker rm -f homebridge

Download Latest Image

# Replace `raspberry-pi` on the last line with the tag determined in Step 6
docker pull oznu/homebridge:raspberry-pi

After downloading a new version of the image, remove the existing container and recreate it using the command shown in Step 7. You won't loose any config or settings since this is stored in /storage/homebridge.