Install Homebridge on OSX - Anthony-Chan/homebridge GitHub Wiki

Work in Progress

Install Xcode

  • go to the Mac App Store and install Xcode

Install Node.js

Install Homebridge and any plugins

  • Install homebridge globally

    • sudo npm -g install homebridge
  • Install plugins globally

    • sudo npm -g install [name of plugin]
  • Create and edit the Homebridge configuration file ~/.homebridge/config.json

    • Please refer to the Homebridge Readme and individual plugin instructions on creating the config.json file
  • Run Homebridge from terminal to make sure everything is set up correctly

    • homebridge

How to automatically start Homebridge with launchd

  • Create a launchd plist file for Homebridge in ~/Library/LaunchAgents

    • Example name com.homebridge.server.plist
  • Homebridge will now start automatically at boot and will restart if it crashes.

  • Run the following in a terminal to manually start homebridge background process:

    • launchctl load ~/Library/LaunchAgents/com.homebridge.server.plist
  • Run the following in a terminal to manually stop homebridge background process:

    • launchctl unload ~/Library/LaunchAgents/com.homebridge.server.plist

Contents of com.homebridge.server.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>com.homebridge.server</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/homebridge</string>
        <string>-I</string>
    </array>
    <key>EnvironmentVariables</key>
    <dict>
            <key>PATH</key>
            <string>/usr/local/bin/:$PATH</string>
    </dict>
</dict>
</plist>

Updating plugins

Periodically, plugins or homebridge may be updated. To see if there are any updates you can run the following command to see what is available:

npm -g outdated

To update a particular plugin or homebridge itself, run:

sudo npm -g update [homebridge | name-of-plugin]

To force an update, you can re-install it to force the latest version:

sudo npm -g install [homebridge | name-of-plugin]

⚠️ **GitHub.com Fallback** ⚠️