Setup Homebridge on Synology NAS without Docker

Last weekend I got the IKEA TRÅDFRI kit for my new lamps. It worked OK initially but the app could not connect to gateway after done setup. Since Homekit has always being on my TODO list and controlling lights thru app isn’t quite convenient anyway, I figure it is time to give Homebridge a try.

There are couple docker images. If you have a powerful NAS (prob x86), then Docker is definitely the way to go. But if your are like me, whose NAS doesn’t support Docker and don’t want to setup another 24/7 Raspberry Pi, here is how to setup one without Docker.

Setup Debian Chroot

Why? The native DSM environment doesn’t have required dependency and services. They are not available thru Package Center nor OPKG (aka Entware-ng). With Debian Chroot, you get full apt-get experience.

  1. Add SynoCommunity as Package Center source by following
  2. Install Debian Chroot from Package Center
  3. SSH to your NAS
  4. sudo -i
  5. /var/packages/debian-chroot/scripts/start-stop-status chroot
  6. apt-get upgrade
  7. apt-get update

Now you are ready to roll.

Install node

Thru apt-get

  1. curl -sL | build -
  2. apt-get install -y nodejs

This should install node v10.x.

(Alternative) Build yourself

If apt-get install -y nodejs can gets you a working version of node, then you can skip this part.

  1. Find a working dir. cd ~ will work fine.
  2. apt-get install build-essential
  3. wget a node tarball from Recommend 10.x.
  4. tar -zxvf <node-tar-filename>
  5. Enter the unpacked node dir.
  6. ./configure
  7. make You can add -j2 to the command if you have dual cores. Even -j4 if you have four cores.
  8. It will take a while to complete.

Install and start dependencies

  1. apt-get install libavahi-compat-libdnssd-dev git
  2. /etc/init.d/dbus start
  3. /etc/init.d/avahi-daemon start

If the last two command failed, try mount -t proc proc proc/ first.

Setup Homebridge

  1. npm install -g --unsafe-perm homebridge
  2. Then install an plugins you need npm install -g --unsafe-perm homebridge-<plugin_name>
  3. homebridge it should starts now!

You can follow the instruction in to finish your setup.

Now you can simply run homebridge in a screen session to keep it running in the back.

Setup Homebridge as service

Or you can setup it as a service that can auto start after reboots.

  1. Add a user for the service useradd -s /bin/false -b /var/run homebridge
  2. Copy your .homebridge dir to the new home cp -R ~/.homebridge /var/run/homebridge
  3. Download the content of into /etc/init.d/homebridge
  4. chmod a+x /etc/init.d/homebridge
  5. service homebridge start Done!

Finally, you can set it to start automatically after reboot in the Debian Chroot DSM UI. On DSM 6, you may need to fix it first by following

Add services into Debian Chroot UI as the screenshot bellow, then your homebridge should be all automated now. Cheers.

Debian Chroot services configuration



Talk is cheap, show me the code.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store