How to install Homebrew on a Mac (and fix brew: command not found)
By Pull This RepoPosted 4 min read
Short answer
To install Homebrew, open Terminal and paste the one command from brew.sh. The script explains what it will do, pauses for your OK, installs the Xcode Command Line Tools if needed, and puts Homebrew in /opt/homebrew on Apple Silicon. Then run the three PATH lines it prints under Next steps, or brew will say command not found.
To install Homebrew on a Mac, you paste one command into Terminal and follow two prompts. Homebrew is the free package manager most Mac READMEs assume you have, so it is usually the first thing to install brew on a new machine. This guide covers the install, the PATH step that fixes brew: command not found, and the handful of commands you need after that. Every command here was checked against brew.sh, the Homebrew docs and the Homebrew/install repo on 22 November 2026.
What is the command to install Homebrew?
It is this one line, copied from brew.sh:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Step by step:
- Open Terminal (Applications, Utilities, or search for it with Spotlight).
- Paste the command and press Return.
- Type your Mac login password when asked. Nothing shows as you type; that is normal.
- Read the summary. brew.sh says the script "explains what it will do and then pauses before it does it." Press Return to go on.
- If Apple's Command Line Tools are missing, the script installs them and warns you to expect a popup.
- When it finishes, run the commands it prints under Next steps. The next section explains them.
Keep the /bin/bash at the start. Homebrew's install docs say the one-liner uses Bash, and that zsh, fish, tcsh and csh will not work for it.
Which Macs can run Homebrew?
Homebrew wants an Apple Silicon Mac on macOS Sequoia 15 or newer. From its installation docs on 22 November 2026:
| Your Mac | What Homebrew says |
|---|---|
| Apple Silicon, macOS 15 to 27 | best and supported |
| Apple Silicon, macOS 11 to 14 | unsupported, but may work |
| Any Intel Mac | Tier 3 (best effort) |
| macOS 10.15 Catalina or older | will not run Homebrew at all |
The install script in the Homebrew/install repo goes further on Intel. Its current version stops with "Homebrew on macOS is only supported on Apple Silicon processors!" when it detects an Intel chip. If you already have Homebrew on an Intel Mac, it lives in /usr/local, and brew.sh still lists that prefix.
For managed Macs, Homebrew also ships a .pkg installer on the latest Homebrew/brew GitHub release, which installs to /opt/homebrew.
How do you fix brew: command not found?
Run the PATH commands from the end of the install. They tell your shell where brew lives. On an Apple Silicon Mac with the default zsh shell, the installer prints these three lines:
echo >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv zsh)"The first two save the setting for every new Terminal window. The third applies it to the window you have open. Copy the lines your own installer printed if they differ, since the script fills in your prefix and shell. If you use Bash on a Mac, it writes to ~/.bash_profile and uses shellenv bash instead.
The Homebrew manpage describes brew shellenv this way: when run in a shell, it adds this installation of Homebrew to your $PATH, $MANPATH and $INFOPATH.
Then check everything is healthy:
brew doctorThe manpage says brew doctor checks your system for potential problems and exits with an error code if it finds any.
What is the difference between brew install and brew install --cask?
A formula is usually a command line tool; a cask is usually a Mac app. The Homebrew manpage defines them:
- Formula: a package definition that builds from upstream sources.
- Cask: a package definition that installs pre-compiled binaries built and signed by upstream.
brew install handles both, and --cask or --formula tells it which one you mean when a name could be either:
# a command line tool (git-scm.com lists this for Mac)
brew install git
# a Mac app (from Rectangle's README)
brew install --cask rectangleMany apps on this site install this way. Our list of free Mac apps gives each one's exact brew line, including apps that live in their own tap. If Git is what sent you here, our guide on how to install Git covers every platform.
To find a name, use brew search, which the manpage says searches both cask tokens and formula names:
brew search rectangleHow do you update and upgrade Homebrew?
Use brew update first, then brew upgrade. They do different jobs:
brew update # fetch the newest Homebrew and package definitions
brew outdated # list what has a newer version
brew upgrade # upgrade everything that is outdated
brew upgrade git # upgrade just one packageThe FAQ adds that Homebrew removes old versions when it upgrades a formula, and runs extra cleanup every 30 days on its own. You can also run brew cleanup by hand to remove old versions and stale downloads.
How do you uninstall a package or Homebrew itself?
For one package, use brew uninstall, which works on formulae and casks:
brew uninstall git
brew uninstall --cask rectangleSome app READMEs ask for --zap too. Rectangle's says to use brew uninstall --zap rectangle so its settings files go as well.
To remove Homebrew completely, run the uninstall script from the Homebrew/install repo:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"Moved from an Intel Mac to Apple Silicon and want the old /usr/local copy gone? The README says to download the script and pass the prefix:
curl -fsSLO https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh
/bin/bash uninstall.sh --path /usr/localCan you install Homebrew on Linux or WSL?
Yes, with the same command. brew.sh says it works in a Linux shell or WSL, and installs to /home/linuxbrew/.linuxbrew. Install the build tools first. On Debian or Ubuntu the Homebrew on Linux docs list:
sudo apt-get install build-essential procps curl file gitThen add it to your PATH for Bash:
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"If zsh is your login shell, the docs say to use ~/.zshrc instead of ~/.bashrc.
What is the catch?
Homebrew runs a script from the internet with your password, so it is worth reading the summary it prints before you press Return. Its support has also narrowed: Intel Macs and anything older than macOS 15 sit outside full support, and the current install script refuses Intel outright. Formulae can take a while when they build from source, which is when the Command Line Tools matter. And casks from a project's own tap are maintained by that project, not by Homebrew, so read the app's README before you trust one.
Next, how to install Oh My Zsh and how to install GitHub CLI both have a Homebrew route.
Need Java for a tool or a Minecraft server? Homebrew can install the free Temurin build, covered in how to install Java.
Pull it. Stash it.
Questions people ask
Why does Terminal say brew: command not found after installing?
The install worked, but your shell does not know where brew lives yet. Run the lines the installer printed under Next steps. On an Apple Silicon Mac with zsh they add an eval line with /opt/homebrew/bin/brew shellenv to your .zprofile file. Then open a new Terminal window.
Does Homebrew work on an Intel Mac?
Homebrew's docs call every Intel Mac setup Tier 3, which means best effort, not full support. On 22 November 2026 the official install script also stopped on Intel Macs with a message that Homebrew on macOS is only supported on Apple Silicon processors.
Do I need Xcode to install Homebrew?
No, not the full Xcode app. The install script installs Apple's Command Line Tools for you and shows a popup while it does. Homebrew's docs say the tools are needed to build from source, and that on Apple Silicon casks and bottles install without them.
Is Homebrew free?
Yes. Homebrew is free and open source under the BSD 2-Clause licence. Its main repo, Homebrew/brew, had 50,398 stars on GitHub on 22 November 2026, and its latest release was 7.0.15, published on 19 November 2026.
How do I uninstall Homebrew?
Run the official uninstall script from the Homebrew/install repo, with the same /bin/bash and curl pattern as the installer but ending in uninstall.sh. To remove an old Intel copy in /usr/local after moving to Apple Silicon, download the script and run it with --path /usr/local.
Sources
- 1Homebrew home page, brew.sh (read 2026-11-22)
- 2Homebrew Docs: Installation (read 2026-11-22)
- 3Homebrew Docs: FAQ (read 2026-11-22)
- 4Homebrew Docs: Manpage (read 2026-11-22)
- 5Homebrew Docs: Homebrew on Linux (read 2026-11-22)
- 6Homebrew/install README and install.sh (read 2026-11-22)
- 7Homebrew/brew
- 8git-scm.com: Install Git on macOS (read 2026-11-22)
- 9Rectangle README (read 2026-11-22)
More repos like this
Get tomorrow's repo in your feed
One free, open source repo a day as a short video, shown working, with the catch named. Pull it. Stash it.
