MainspringGuides › Install Homebrew
macOS Guide

How to Install Homebrew on Mac

Updated July 2026 · 3 min read

Homebrew is the missing package manager for macOS: one command installs, updates, or removes almost any developer tool or app, from wget to Firefox. The install takes a few minutes, and there is one step at the end — the PATH setup — that trips up nearly everyone on Apple silicon. Here is the whole process, done right.

Run the official installer

  1. Open Terminal.
  2. Paste the official install command:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. Enter your Mac account password when asked. You won't see characters as you type — that's normal.
  4. If prompted, agree to install the Xcode Command Line Tools. Homebrew builds and links software with them, so this download (a few GB the first time) is required. Wait for it to finish.
  5. Press Return to confirm the summary of what will be installed.

Only ever use this command from brew.sh or the Homebrew GitHub repository. Anything else offering a "faster" installer is a good way to run someone else's script as an administrator.

The PATH step people miss

On Apple silicon Macs, Homebrew installs to /opt/homebrew, which is not on your PATH by default — so the very next thing you type, brew, fails with command not found. The installer prints the fix in its "Next steps" section; it is these two lines:

# add Homebrew to your shell config (Apple silicon)
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile

# apply it to the current window
eval "$(/opt/homebrew/bin/brew shellenv)"

On Intel Macs, Homebrew lives in /usr/local, which is already on the PATH, so this step usually isn't needed. Verify the install either way with brew doctor — "Your system is ready to brew" means you're done.

The five commands you'll actually use

Two more worth knowing: brew search text finds packages by name, and brew info wget shows what a package is, its dependencies, and its size before you commit.

Removing Homebrew entirely

If you ever want it gone, Homebrew ships an official uninstaller that removes the packages and the directories it created:

# undo the whole installation
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/uninstall/HEAD/uninstall.sh)"

It lists any files it leaves behind so you can review them. The Xcode Command Line Tools stay installed — they're Apple's, and other tools may use them.

Where everything goes, and periodic upkeep

Homebrew never scatters files across the system: command-line packages live in the "Cellar" under its prefix (/opt/homebrew on Apple silicon, /usr/local on Intel) and are symlinked into place, while --cask apps land in /Applications like any other app — brew list --cask shows which apps it manages. That containment is why installs and uninstalls stay clean.

# preview what cleanup would delete, then reclaim the space
brew cleanup -n
brew cleanup

# remove dependencies nothing needs anymore
brew autoremove

brew cleanup deletes old versions and stale downloads — after a few months of updates this often recovers several gigabytes. If a tool must stay at its current version, brew pin wget exempts it from brew upgrade (undo with brew unpin wget). Casks update the same way — brew upgrade --cask — though apps that update themselves, like browsers, are fine to leave to their own devices.

One command for everything else

Homebrew handles your software; Mainspring handles your settings. It turns 90+ hidden macOS tweaks — Dock, Finder, screenshots, keyboard — into labelled, reversible toggles.

Try Mainspring free →

Signed & notarized by Apple · 1-day free trial · $29 once

One good first install

Try brew install tldr — community-written cheat sheets for Terminal commands, a perfect sidekick to the built-in manuals covered in our guide to man pages.