macOS

Homebrew Explained: The macOS Package Manager for Developers

What Homebrew actually does, the difference between formulae and casks, and the commands you'll use most for managing packages on macOS.

Daniel OseiJune 24, 20263 min read
Share:

Nearly every macOS setup guide starts with "install Homebrew" — here's what it's actually doing and how to use it well beyond the initial install command.

What it solves

macOS doesn't ship with a package manager for developer tools the way Linux distros do. Homebrew fills that gap: it installs, updates, and removes command-line tools and libraries in a consistent way, tracking what's installed so you're not manually downloading and configuring binaries.

Formulae vs. casks

This distinction confuses people early on:

bash
brew install wget          # a formula — a command-line tool or library
brew install --cask slack   # a cask — a GUI application

Formulae are command-line tools, libraries, and their dependencies — things like git, node, ffmpeg. Casks are macOS GUI applications — things like Slack, Docker Desktop, Visual Studio Code. Both are managed through the same brew command, just with the --cask flag for the latter.

The commands you'll actually use

bash
brew install <package>       # install
brew uninstall <package>     # remove
brew list                    # see everything installed
brew search <term>           # search available packages
brew info <package>          # see details, including dependencies

Keeping things updated

bash
brew update                  # update Homebrew's own package index
brew outdated                # see what has newer versions available
brew upgrade                 # upgrade everything outdated
brew upgrade <package>        # upgrade just one package

brew update updates Homebrew's knowledge of what versions exist; brew upgrade actually installs newer versions of what you have. Running update without upgrade won't change anything installed — a common point of confusion.

Cleaning up

Homebrew keeps old versions and cached downloads around by default, which adds up over time:

bash
brew cleanup             # remove old versions and cached downloads
brew cleanup --dry-run    # see what would be removed, without removing it

Managing your setup declaratively with a Brewfile

For reproducing a setup across machines (or after a fresh install):

bash
brew bundle dump             # generate a Brewfile from what's currently installed
brew bundle install           # install everything listed in a Brewfile

A Brewfile looks like:

ruby
brew "git"
brew "node"
cask "visual-studio-code"
cask "docker"

Checking this file into a dotfiles repo means a new machine can be brought up to your exact toolset with one command, instead of remembering (or re-Googling) what you had installed.

Troubleshooting: brew doctor

bash
brew doctor

Runs a diagnostic check and reports common configuration problems — permission issues, conflicting files, outdated Xcode Command Line Tools. Worth running whenever something Homebrew-related starts behaving strangely, before troubleshooting further by hand.

Advertisement
Daniel Osei
Daniel Osei

Security Engineer

Daniel focuses on application security, secure infrastructure, and practical cybersecurity guidance for developers.

Related Articles