Fix Startup Crashes & Read Logs

Resolve Homebridge startup crashes: inspect live logs in Homemanager or terminal, stop boot loops, and fix port conflicts or syntax errors.

Fix startup crashes and inspect logs

When Homebridge fails to launch after an update or configuration change, it usually enters a restart loop (boot loop): the service crashes during initialization, and the operating system restarts it immediately.

The last lines of the log show why the process stopped.


View the log

Open the log using your preferred access method:

  1. Open Homemanager on your iPhone or iPad.
  2. Go to the System tab and tap Log.
  3. Error entries are highlighted in red.
  4. Use the share icon in the top right corner to copy log entries or export them for troubleshooting help.
Live log in Homemanager showing error output
Live log with red error highlights in Homemanager
  1. Open the Homebridge web UI in your browser (if the UI service is still reachable).
  2. Open the Status section or click the console icon in the top navigation bar.
  3. The log window streams new lines as they appear.

Connect to your host system via SSH and read the service logs directly:

sudo hb-service logs

On Linux systems running systemd, you can also query the journal:

sudo journalctl -u homebridge -n 50 --no-pager

Debug mode for detailed logs: If standard log output does not reveal the cause, enable Debug Mode (-D) in the Homebridge settings of the web interface to record every network packet and internal event.


Common startup errors

1. Port conflicts (EADDRINUSE or Matter ports)

Log message:

Error: listen EADDRINUSE: address already in use :::51826

or:

Error: Failed to allocate Matter port for child bridge.
Please specify a port manually in the _bridge.matter configuration...
  • Cause: Another service occupies the HomeKit port (default: 51826), the web port (8581), or the Matter port assigned to a child bridge.
  • Fix:
    • Reboot the host system (sudo reboot) to terminate orphaned Node processes.
    • If you run multiple bridges or Matter accessories: assign an unused, fixed port in the bridge settings for that plugin. For more details on Matter configuration, see Matter and Homebridge.

2. Syntax errors in config.json (SyntaxError)

Log message:

SyntaxError: Unexpected token , in JSON at position 1240
  • Cause: A JSON syntax issue, typically a trailing comma or an unclosed bracket introduced during manual editing.
  • Fix:
    • Correct the typo: Open the configuration file in a terminal editor (such as sudo nano /var/lib/homebridge/config.json) and fix the error at the reported line.
    • Restore a backup on a clean setup: If the file is badly damaged or the service refuses to start, reinstall Homebridge and restore your latest backup archive during the initial setup wizard. All plugins, settings, and Apple Home pairings remain intact.
    • Prevent errors with Homemanager: When editing settings through structured forms in Homemanager, the app validates inputs before saving, preventing JSON syntax errors from happening.

3. Plugin crash during initialization

Log message:

[homebridge-plugin] Child bridge will no longer restart after failing 5 times
  • Cause: A plugin throws an unhandled error during startup, often caused by expired account credentials, changed device APIs, or network timeouts.
  • Fix:
    • With Child Bridges: If the plugin runs as a child bridge, Homebridge stops restarting it after five failed attempts. The main server stays online. You can edit the plugin settings, disable it, or delete its configuration directly in Homemanager or the web interface. Once corrected, restart the child bridge.
    • On the main bridge: If the plugin runs on the main bridge, the crash pulls down the entire Homebridge service into a restart loop.
      • In Homemanager or the web interface: If the UI responds briefly between restart attempts, disable the offending plugin or delete its configuration block.
      • Via terminal (if the UI cannot load): Open /var/lib/homebridge/config.json in an editor (such as sudo nano /var/lib/homebridge/config.json) and remove the plugin entry from the platforms or accessories array.

4. Native module mismatch after Node.js updates (NODE_MODULE_VERSION)

Log message:

Error: The module '...' was compiled against a different Node.js version
  • Cause: Node.js was upgraded while some plugins still rely on native binary modules compiled for an earlier Node release. For recommended upgrade routines, see Updating System Software.
  • Fix: Rebuild native dependencies using the service manager:
    sudo hb-service rebuild

5. Forgotten web UI credentials

Log message:

[Homebridge UI] Failed login attempt.
If you have forgotten your password, you can reset to the default of admin/admin...
  • Fix: Reset the administrator account through the command line:
    sudo hb-service reset-admin
    Alternatively, remove the authentication file and restart the service:
    sudo rm /var/lib/homebridge/auth.json && sudo hb-service restart
    This resets your login credentials back to admin / admin.

Restart the server or child bridges

After saving your changes, restart the service:

  • In Homemanager:
    • Restart the entire server directly from the Dashboard.
    • Restart an individual child bridge either by swiping on its entry or via System in the bridge detail view.
  • In the web interface: Click the power icon in the top right corner and choose Restart.
  • Via terminal: Run sudo hb-service restart.