brew-services
Manage background services for Homebrew packages
TLDR
List all services
$ brew services list
Start a service$ brew services start [postgresql]
Stop a service$ brew services stop [postgresql]
Restart a service$ brew services restart [postgresql]
Run service in foreground$ brew services run [postgresql]
Stop all services$ brew services stop --all
Clean up unused services$ brew services cleanup
SYNOPSIS
brew services [subcommand] [formula] [options]
DESCRIPTION
brew services manages background services for installed Homebrew formulae. On macOS, it uses launchd with LaunchAgent plist files. On Linux, it uses systemd user units.
Services configured with this command start automatically on user login.
PARAMETERS
--all
Apply to all services--json
Output in JSON format--file path
Use custom service file
SUBCOMMANDS
list
List all managed services and their statusstart formula
Start service and configure for login startupstop formula
Stop service and disable login startuprestart formula
Restart servicerun formula
Run service in foreground (no login startup)cleanup
Remove unused service filesinfo formula
Show service information
SERVICE FILES
macOS
~/Library/LaunchAgents/homebrew.mxcl.<formula>.plistLinux
~/.config/systemd/user/homebrew-<formula>.service
CAVEATS
On Linux, requires a running user systemd instance. Common use cases include databases (postgresql, mysql), caches (redis), and web servers. Use run for development to avoid startup configuration.
HISTORY
Introduced in Homebrew 0.9.9 (February 2014) for macOS launchd support. Linux/systemd support was added via Linuxbrew and merged into core Homebrew by 2020.
