← Back to Blog

Homebrew Services: How to Use, How It Works, and Alternatives

Published November 24, 2023 · Updated September 17, 2025
12 min read
macOS
Homebrew
Services
Docker
Development

Why Homebrew on macOS?

Homebrew (or simply brew) is the missing package manager for macOS. Instead of hunting DMGs, dragging apps to Applications, and fixing paths by hand, you install libraries, CLIs, and full apps with one command.

Key benefits

  • One command to install, upgrade, and remove software.
  • Huge ecosystem: from system libs to databases and browsers.
  • Versioning and dependency resolution built in.

For developers, that stability and speed translate into a cleaner, more predictable environment — no more “it works on my machine.”

Brew Structure & Essential Commands

Brew revolves around a single command — brew. Under the hood it’s a well-thought-out system that handles installs, upgrades, and dependencies with minimal fuss.

Essentials

  • brew install — install a package
  • brew uninstall — remove a package
  • brew update — update brew itself
  • brew upgrade — upgrade installed packages
  • brew search — find packages

Package insight

  • brew list — see what’s installed
  • brew info — package details
  • brew deps — dependencies
  • brew doctor — detect issues
  • brew cleanup — remove old versions

Pro tip: brew doctor

brew doctor scans for conflicts and misconfigurations and tells you exactly how to fix them.

Formulae vs. Casks: What’s the Difference?

In Homebrew, formulae install CLI tools and libraries. Casks install macOS apps distributed as DMG/PKG (Chrome, Figma, Spotify).

Formulae (CLI & libraries)

Perfect for dev tools (Git, Node.js, Python) and system libs. Brew resolves dependencies and can install binaries or build from source.

Casks (GUI apps)

Automate DMG/PKG downloads and installs — App Store convenience, command-line flexibility.

Updates differ

Formulae upgrade via brew upgrade. Many casks re-install on update — still far easier than manual downloads.

What “Services” Mean in Homebrew

brew services manages background daemons like PostgreSQL, Redis, or Nginx via macOS launchd. One command, same interface across tools — start, stop, restart, auto-start on login.

Under the hood

Brew writes a .plist and registers it with launchd, so your service can start at boot and be supervised by the OS.

Popular Services You Can Run

Databases

  • PostgreSQL
  • MySQL / MariaDB
  • MongoDB
  • SQLite

Web servers

  • Nginx
  • Apache
  • Caddy
  • Traefik

Other

  • Redis / Memcached
  • RabbitMQ
  • Elasticsearch
  • Kafka

Managing Services with brew services

start, stop, restart, list

These four commands cover 95% of your workflow:

1# Start a service
2brew services start postgresql
3
4# Stop a service
5brew services stop postgresql
6
7# Restart a service
8brew services restart postgresql
9
10# List all services and their status
11brew services list

Checking Service Status

Use brew services list for a quick overview. For deeper dives, check launchctl, logs, and whether the service itself responds to connections.

1$ brew services list
2Name       Status  User    Plist
3mysql      started username /Users/username/Library/LaunchAgents/homebrew.mxcl.mysql.plist
4postgresql stopped
5redis      started username /Users/username/Library/LaunchAgents/homebrew.mxcl.redis.plist

Troubleshooting tip

If a service won’t start, inspect logs and try the service itself (e.g., connect to PostgreSQL and run a simple query).

Under the Hood: launchd & plist

macOS manages daemons with launchd and per-service .plist configs. Homebrew generates and registers those files so your services can start at boot and be supervised by the system.

1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5  <key>Label</key>
6  <string>homebrew.mxcl.postgresql</string>
7  <key>ProgramArguments</key>
8  <array>
9    <string>/usr/local/opt/postgresql/bin/postgres</string>
10    <string>-D</string>
11    <string>/usr/local/var/postgres</string>
12  </array>
13  <key>RunAtLoad</key>
14  <true/>
15  <key>KeepAlive</key>
16  <true/>
17  <key>WorkingDirectory</key>
18  <string>/usr/local/var</string>
19  <key>StandardErrorPath</key>
20  <string>/usr/local/var/log/postgres.log</string>
21  <key>StandardOutPath</key>
22  <string>/usr/local/var/log/postgres.log</string>
23</dict>
24</plist>

Docker vs. Homebrew: Which One to Use?

Choose Homebrew for native performance, low overhead, and a macOS-first experience. Choose Docker for isolated, reproducible stacks, multiple versions, and parity with production.

Homebrew advantages

  • Native integration with macOS
  • Simpler setup and config
  • Lower resource overhead
  • Great for single-service local dev

Docker advantages

  • Strong isolation and portability
  • Consistent environments across OSes
  • Run multiple versions side-by-side
  • Closer to production setups

Reality check

Many teams use both: Homebrew for quick local databases and Docker for multi-service integration tests.

Handy Tools for Monitoring

Start simple with Activity Monitor and logs. For the terminal, combine brew’s status with system tools.

1# Quick audit
2brew services list
3
4# Check system processes
5ps aux | grep postgres
6
7# Tail logs
8tail -f /usr/local/var/log/postgres.log
9
10# launchd status
11launchctl list | grep postgres

Need more? htop and glances are great on a laptop. For critical local setups, you can even wire up Prometheus/Grafana or Zabbix — overkill for most, but powerful.

Need help with Homebrew services or Docker?
I help teams set up fast macOS dev environments, streamline Homebrew services, and pick the right moments to use Docker.