-
Notifications
You must be signed in to change notification settings - Fork 384
How To Swap From Standalone Mode to Service Mode
This article describes how to swap from the depreciated Standalone Mode to "service" using the provided hb-service
command.
Users running under hb-service
retain the same advantages of the depreciated Standalone Mode:
✔️ The UI remains online even if Homebridge is crashing due to a config error
✔️ Automatic start on boot
✔️ Automatic restart if Homebridge crashes
In addition, running in service mode (hb-service
) provides many advantages to running in Standalone Mode:
✔️ Automatic creation of the systemd unit file
✔️ A single service file for both Homebridge and the Homebridge UI
✔️ Homebridge UI settings are pre-configured (you don't have to configure the log view etc.)
✔️ Persistent logs with automatic log rotation
✔️ The ability to download and truncate the log file from the Homebridge UI
✔️ Automated creation of default config.json
and storage folders
✔️ Syntax validation and repair of the Homebridge config.json
on start
✔️ The ability to clear the Homebridge accessory cache from the UI
✔️ The ability to remove selected accessories from Homebridge accessory cache from the UI
✔️ The ability to set the Homebridge -D
debug, -K
keep orphans, and -I
insecure mode flags from the Homebridge UI
✔️ The ability to set the DEBUG
and NODE_OPTIONS
environment variables from the UI
Remove the homebridge-config-ui-x
service:
sudo systemctl stop homebridge-config-ui-x
sudo systemctl disable homebridge-config-ui-x
sudo rm -rf /etc/systemd/system/homebridge-config-ui-x.service
Remove the homebridge
service:
sudo systemctl stop homebridge
sudo systemctl disable homebridge
sudo rm -rf /etc/systemd/system/homebridge.service
Use hb-service
to create the new service file:
sudo hb-service install --user homebridge --port 8080 -U /var/lib/homebridge
-
--user
: the user account homebridge should run as, if it does not exist it will be created. -
--port
: the port the UI should run on. -
-U
: the Homebridge storage directory, if it does not exist it will be created with the defaultconfig.json
pre-configured.
That's it. You should be back up and running in "Service Mode". The hb-service
utility provides many useful commands for managing Homebridge from the command line, see the Homebridge Service Command wiki page for futher details.
hb-service
makes it easy to run multiple instances. See the Multiple Instances section of the Service Command wiki page.
sudo hb-service install --user homebridge --port 8081 --service-name homebridge-two -U /var/lib/homebridge-two
If you are running in Docker, you can migrate to "Service Mode" by pulling down the latest version of the oznu/homebridge Docker image.
- Raspberry Pi
- Debian, Ubuntu
- CentOS, Fedora, Red Hat
- Arch, Manjaro
- macOS
- Windows 10 / 11 (Hyper-V)
- Docker
- Synology DSM 7
- Other Platforms
- Basic Troubleshooting
- Backup and Restore
- Child Bridges
- Config File
- Connect To HomeKit
- FFmpeg for Homebridge
- HomeKit Glossary of Terms
- iOS Homemanager App
- mDNS Options
- Remote Access
- Useful Links
- Basic Troubleshooting
- Config Options
- Enabling Accessory Control
- Enabling UI with Docker
- Homebridge Service Command
- Manual Configuration
- Reverse Proxy: Apache
- Reverse Proxy: Nginx and SSL
- Standalone Mode
- Swap From Standalone To Service Mode
- Developer Docs
- API Reference
- Plugin Templates
- Other Links (Internal)
- Other Links (External)