How to install Homebrew on a Mac, and fix the errors that follow
Researched, not yet tested: written from Homebrew's installation docs and install script as of November 2026; we haven't run it on a Mac yet. Check the commands against your setup.
Open Terminal, paste the install command from brew.sh, press Return and follow the prompts. When it finishes, run the two lines it prints under “Next steps” to add brew to your PATH, then check with brew --version.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
The script explains what it will do and pauses before it makes changes. It asks for your Mac password once, because it creates folders that need admin rights.
Add brew to your PATH
This is the step most people miss, and skipping it causes zsh: command not found: brew. Where Homebrew lives depends on your Mac’s chip:
Chip (uname -m) |
Homebrew prefix | Line to add to ~/.zprofile |
|---|---|---|
arm64 (Apple Silicon) |
/opt/homebrew |
eval "$(/opt/homebrew/bin/brew shellenv)" |
x86_64 (Intel) |
/usr/local |
Usually not needed: /usr/local/bin is already on the PATH |
On Apple Silicon run:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
The first line makes it permanent for new Terminal windows. The second applies it to the window you have open.
Check the install
brew --version
brew doctor
brew doctor should end with “Your system is ready to brew.” If it prints warnings, read each one: most name the exact command that fixes them.
Before you install: what you need
- An Apple Silicon Mac on macOS 15 Sequoia or later is the supported setup (Homebrew installation docs). Intel Macs and older macOS versions may work with less support.
- An admin account on the Mac.
Choosing a terminal app
Homebrew runs in any terminal, including the Terminal app that ships with macOS. If you’re picking a different one, our comparison of the best terminal apps for Mac covers Ghostty, iTerm2, Warp and four others.
Every Homebrew and macOS error we cover
Install and PATH errors
- Zsh: Command Not Found: Brew (Mac Fix for Apple Silicon)Homebrew is installed but your shell can't find it. Add brew shellenv to ~/.zprofile for /opt/homebrew on Apple Silicon, or install Homebrew if it's missing.
Homebrew health
- Homebrew-Core Is a Shallow Clone: How to Fix ItOlder Homebrew installs cloned homebrew-core shallowly and brew update refuses it. Untap it on Homebrew 4 or later, or run the unshallow command it prints.
More Homebrew and macOS fixes
- 7 Best Terminal Apps for Mac (2026), ComparedGhostty is the best free terminal for most Mac users. Warp suits AI-first work and iTerm2 suits people who want every option. Seven apps compared on price.
FAQ
Does Homebrew work on Apple Silicon?
Yes. Apple Silicon is Homebrew's main supported platform and installs to /opt/homebrew. Intel Macs still run Homebrew but are a Tier 3 configuration, so problems there get less support. See Homebrew's installation page.
Do I need Xcode to install Homebrew?
You need the Xcode Command Line Tools, not the full Xcode app. The installer checks for them and offers to install them if they're missing. You can also install them first with xcode-select --install.
Which macOS versions does Homebrew support?
As of November 2026 Homebrew supports macOS 15 Sequoia and later on Apple Silicon. Older versions back to macOS 11 may work but are unsupported, and macOS 10.15 Catalina or older won't run Homebrew at all.
Should I use sudo with brew?
No. Homebrew is designed to run as your normal user. Using sudo brew can leave files owned by root that break later installs.
