Homebrew Services: Complete Tutorial
Need to run MySQL, PostgreSQL, Redis, or other services on your Mac? Homebrew Services makes it easy to start, stop, and manage background services without dealing with launchctl directly.
This guide covers everything you need to know about brew services — from basic commands to troubleshooting common issues.
What are Homebrew Services?
Many development tools need to run as background processes (daemons). Databases like MySQL, caching systems like Redis, and web servers like nginx all need to stay running in the background.
Homebrew Services is a wrapper around macOS's native launchctl that makes managing these services simple. Instead of writing complex plist files, you use straightforward commands.
Essential Commands
| Command | Description |
|---|---|
brew services list |
Show all services and their status |
brew services start <name> |
Start a service (and auto-start on boot) |
brew services stop <name> |
Stop a service (and disable auto-start) |
brew services restart <name> |
Restart a service |
brew services run <name> |
Start without auto-start on boot |
brew services info <name> |
Show details about a service |
brew services cleanup |
Remove unused service files |
Listing All Services
To see all services and their status:
brew services list
Example output:
Name Status User File
mysql started johndoe ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
postgresql stopped
redis started johndoe ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
nginx none
Status meanings:
- started: Running and will auto-start on boot
- stopped: Not running
- none: Installed but never configured as a service
- error: Failed to start (check logs)
Visual Service Management
Taphouse provides a visual interface for Homebrew services. See running services at a glance and toggle them on/off with a click — no Terminal required.
Starting and Stopping Services
Start a Service
# Start MySQL and enable auto-start on boot
brew services start mysql
# Start without auto-start (runs until you stop it or reboot)
brew services run mysql
Stop a Service
# Stop MySQL and disable auto-start
brew services stop mysql
Restart a Service
# Restart MySQL (useful after config changes)
brew services restart mysql
Common Services Setup
🐬 MySQL
Popular relational database
# Install and start MySQL
brew install mysql
brew services start mysql
# Secure the installation
mysql_secure_installation
🐘 PostgreSQL
Advanced open-source database
# Install and start PostgreSQL
brew install postgresql@16
brew services start postgresql@16
# Create a database
createdb myapp_development
🔴 Redis
In-memory data store and cache
# Install and start Redis
brew install redis
brew services start redis
# Test connection
redis-cli ping
🌐 nginx
High-performance web server
# Install and start nginx
brew install nginx
brew services start nginx
# Test: open http://localhost:8080
📨 Mailhog
Email testing tool
# Install and start Mailhog
brew install mailhog
brew services start mailhog
# Web UI: http://localhost:8025
Service Logs and Troubleshooting
Check Service Info
brew services info mysql
This shows the plist file location, log file paths, and current status.
View Service Logs
Most services log to ~/Library/Logs/Homebrew/ or their own log directories:
# MySQL logs
tail -f /opt/homebrew/var/mysql/*.err
# PostgreSQL logs
tail -f /opt/homebrew/var/log/postgresql@16.log
# nginx logs
tail -f /opt/homebrew/var/log/nginx/error.log
Common Issues
Service shows "error" status
# Check what went wrong
brew services info service-name
# Try restarting
brew services restart service-name
# Check logs for details
cat ~/Library/Logs/Homebrew/service-name.log
Port already in use
# Find what's using the port (e.g., 3306 for MySQL)
lsof -i :3306
# Kill the process if needed
kill -9 PID
Service won't stop
# Force stop by removing the plist
launchctl remove homebrew.mxcl.service-name
# Clean up
brew services cleanup
Running Services as Root
By default, services run as your user. To run as root (needed for ports below 1024):
sudo brew services start nginx
Root services use /Library/LaunchDaemons/ instead of ~/Library/LaunchAgents/.
Managing Multiple Services
Start All Services
brew services start --all
Stop All Services
brew services stop --all
Restart All Services
brew services restart --all
Service Files Location
Homebrew stores service plist files in:
- User services:
~/Library/LaunchAgents/homebrew.mxcl.*.plist - Root services:
/Library/LaunchDaemons/homebrew.mxcl.*.plist
You can edit these files for advanced configuration, but changes may be overwritten on package updates.
Manage Services Visually
Tired of typing Terminal commands? Taphouse shows all your Homebrew services with toggle switches to start and stop them instantly.
Download Taphouse FreeQuick Reference
# List all services
brew services list
# Start a service (with auto-start)
brew services start mysql
# Start without auto-start
brew services run mysql
# Stop a service
brew services stop mysql
# Restart a service
brew services restart mysql
# Get service info
brew services info mysql
# Clean up old service files
brew services cleanup
Summary
Homebrew Services makes managing background processes on macOS straightforward. Whether you're running a development database, cache server, or web server, a few simple commands handle everything.
For an even easier experience, Taphouse lets you manage services with a visual toggle — no Terminal required.