Skip to main content
HubMatch
Cómo hacerloFebruary 1, 2025

How to Set Up HomeBridge on a Raspberry Pi (Step-by-Step)

HomeBridge lets you add non-HomeKit devices to Apple Home using a Raspberry Pi. This complete guide walks you through installation, configuration, and adding your first plugin.

What You'll Need

To run HomeBridge on a Raspberry Pi, you need: a Raspberry Pi 3, 4, or 5 (the Pi 4 with 2 GB RAM is recommended for reliability), a microSD card (16 GB or larger, Class 10 or better), a power supply for your Pi, and a stable internet connection. You'll also need a computer to write the OS image and SSH into the Pi.

HomeBridge can run on almost any Linux machine, so a Pi Zero 2 W or an old laptop work too. The Raspberry Pi 4 is recommended because it runs silently, draws minimal power (around 3–5 W idle), and can handle dozens of accessories without performance issues.

Step 1: Install Raspberry Pi OS

Download the Raspberry Pi Imager from raspberrypi.com/software and install it on your computer. Insert your microSD card, open the Imager, and choose 'Raspberry Pi OS Lite (64-bit)' — the headless version without a desktop is recommended for a dedicated HomeBridge server. Before writing, click the gear icon to pre-configure your Wi-Fi credentials, enable SSH, and set a username and password. This saves you from needing a monitor and keyboard.

Write the image, insert the card into your Pi, and power it on. After about 60 seconds, you should be able to SSH in using: `ssh pi@raspberrypi.local` (or the IP address assigned by your router). If you're on Windows, use PuTTY or Windows Terminal.

Step 2: Install Node.js and HomeBridge

The easiest way to install HomeBridge on a Pi is using the official install script. Once SSH'd in, run: `curl -sSfL https://repo.homebridge.io/KEY.gpg | sudo gpg --dearmor | sudo tee /usr/share/keyrings/homebridge.gpg > /dev/null` followed by `echo "deb [signed-by=/usr/share/keyrings/homebridge.gpg] https://repo.homebridge.io stable main" | sudo tee /etc/apt/sources.list.d/homebridge.list > /dev/null`. Then run `sudo apt-get update && sudo apt-get install -y homebridge`.

This installs HomeBridge, Node.js, and the HomeBridge UI (a web interface) as a systemd service that starts automatically on boot. After installation, the UI is accessible at `http://raspberrypi.local:8581` from any browser on your network. Default credentials are admin/admin — change these immediately.

Step 3: Add HomeBridge to Apple HomeKit

Open the Home app on your iPhone or iPad, tap the '+' button, and choose 'Add Accessory'. Tap 'More options' if the device isn't auto-discovered. Enter the 8-digit HomeKit code shown in the HomeBridge UI dashboard. Your HomeBridge hub will appear as a bridge in your Home app. Devices added via plugins will appear as accessories within this bridge.

Step 4: Install Plugins for Your Devices

HomeBridge plugins are npm packages that add support for specific devices or platforms. In the HomeBridge UI, go to the 'Plugins' tab and search for your device. For example, search 'Wyze' to find homebridge-wyze-smart-home, or 'Govee' to find homebridge-govee. Click Install, then configure the plugin with your device credentials in the Config tab.

Popular plugins include: homebridge-wyze-smart-home (for all Wyze cameras, plugs, and bulbs), homebridge-govee (for Govee LED strips and bulbs), homebridge-kasa (for TP-Link Kasa plugs and switches), and homebridge-ring (for Ring doorbells and cameras). After installing and configuring a plugin, restart HomeBridge and your devices should appear in the Home app within a minute.

Keeping HomeBridge Running Reliably

HomeBridge runs as a systemd service, so it restarts automatically if it crashes. You can check its status with `sudo systemctl status homebridge`. To update HomeBridge and all plugins, use the HomeBridge UI's update interface or run `sudo npm install -g homebridge` via SSH.

For maximum reliability, assign your Raspberry Pi a static IP address in your router's DHCP settings. This prevents the Pi's address from changing after a router reboot, which would break HomeKit's ability to reach the bridge. Also consider backing up your HomeBridge config.json periodically — it lives at `/var/lib/homebridge/config.json`.

Dispositivos relacionados