Homebrew is the de-facto package manager on macOS — Apple ships none of its own. This guide installs Homebrew, explains the Apple-Silicon vs Intel path differences, configures it for shell completion, and shows the daily commands.
Prerequisites
- macOS 12 Monterey or newer.
- An admin account.
- Xcode Command Line Tools (the Homebrew installer triggers this automatically if missing).
Step 1: Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
The installer prints a one-line shellenv snippet for your shell. Run the lines it prints, then add them to your shell profile so they persist:
For Apple Silicon (arm64) — Homebrew lives at /opt/homebrew:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
For Intel — Homebrew lives at /usr/local:
echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/usr/local/bin/brew shellenv)"
Step 2: Verify
brew --version
brew doctor
brew doctor lists any environment issues. Fix everything before installing real software.
Step 3: Daily commands
brew update # refresh formula list
brew upgrade # upgrade everything
brew upgrade git # upgrade one thing
brew install ripgrep fd jq fzf # the standard dev toolkit
brew search redis # search names
brew info redis
brew uninstall package-name
brew list # what's installed
brew leaves # top-level installs (not deps)
brew cleanup # reclaim disk
Step 4: Casks for GUI apps
brew install --cask iterm2 visual-studio-code rectangle docker
brew list --cask
brew upgrade --cask
Casks install into /Applications — same place a .dmg drag-and-drop would put them.
Step 5: Services
Homebrew installs background services (PostgreSQL, Redis, Nginx, etc.) without needing launchd plists:
brew install postgresql@16
brew services start postgresql@16
brew services list
brew services stop postgresql@16
Step 6: Brewfile for reproducible setups
Pin your machine's whole package set:
brew bundle dump --file=~/Brewfile
cat ~/Brewfile
# On a new machine:
brew bundle install --file=~/Brewfile
Check that file into a private dotfiles repo and provisioning a new Mac is brew bundle install away.
Verify
brew config # full environment dump
brew analytics off # opt out of anonymous stats
brew doctor
Conclusion
Homebrew + a Brewfile is the closest thing macOS has to apt/dnf. Run brew update && brew upgrade weekly and you stay current with no Microsoft-Store-style friction.
Next steps
- Set up SSH on macOS for remote access.
- Manage long-running daemons via launchd / launchctl.
- For shell tooling see Bash scripting fundamentals.
Comments
0 total · 0 threads