Next-Gen App & Browser Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

How to Install Homebrew on Mac

Updated November 30, 2026 · Written and reviewed under our editorial policy

To install Homebrew, open Terminal and paste the install command from brew.sh: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". The script explains what it will do and pauses before making changes. On Apple Silicon Macs, run the "Next steps" commands it prints to add brew to your PATH, then run brew doctor.

To install Homebrew on a Mac:

  • Open Terminal.
  • Paste the install command and press Enter; enter your Mac password when asked.
  • If the Command Line Tools are missing, the script installs them.
  • Run the "Next steps" commands the installer prints (Apple Silicon).
  • Close and reopen Terminal, then run brew --version and brew doctor.

Source: brew.sh and the Homebrew documentation, "Installation", checked 2026-11-28.

Once brew works, most developer setup on a Mac is one command away: you can install Git, install Python on Mac or update Node.js from the same Terminal window.

Before you start

Before you install Homebrew, check three things:

  • macOS version: brew.sh lists macOS Sequoia (15) or newer as supported. Check yours under the Apple menu > About This Mac.
  • An administrator account: the script uses sudo, so you need your Mac's admin password.
  • Command Line Tools: Homebrew needs Apple's Command Line Tools for Xcode, not the full Xcode app. The install script installs them if they're missing.

You run everything in Terminal, which is in Applications > Utilities. Any of the best terminal apps for Mac works too.

Install Homebrew step by step

Installing Homebrew takes one command and a few prompts. After you paste the command from brew.sh and press Enter:

  • Type your Mac password when the script asks for it. Terminal doesn't show the characters as you type.
  • Read the list of folders the script will create and change, then press RETURN/ENTER to continue, or any other key to cancel.
  • Wait while it installs the Command Line Tools, if they're missing, and downloads Homebrew. This can take several minutes.
  • Look for Installation successful! and a Next steps section at the end of the output.

The official installer supports Apple Silicon Macs only and installs Homebrew to /opt/homebrew. Intel Macs are no longer supported: the script stops on them with "Homebrew on macOS is only supported on Apple Silicon processors!"

Setting up a dev Mac? Add Kane CLI next to run browser tests from the terminal. It installs with Homebrew too (brew install LambdaTest/kane/kane-cli); see how to install Kane CLI and run your first test.

Add brew to your PATH on Apple Silicon

On Apple Silicon Macs, Homebrew installs into /opt/homebrew. Homebrew's installation docs say it uses this prefix "so that you don't need sudo after Homebrew's initial installation when you install formulae". The installer adds /opt/homebrew/bin to the system PATH for new Terminal windows, but the window you installed from doesn't pick it up. That's why the installer prints Next steps. For the default zsh shell, they look like this:

echo >> /Users/<you>/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> /Users/<you>/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv zsh)"

Copy the exact lines your installer prints, since they name your own home folder and shell. The first two lines add Homebrew's settings to ~/.zprofile for every new Terminal window; the last one loads them in the current one.

Check the install

To check that Homebrew works, close and reopen Terminal, then run:

brew --version
brew doctor

brew --version prints the Homebrew version. brew doctor checks your setup and prints Your system is ready to brew. when nothing needs fixing. Any warnings it lists are advice; deal with the ones about your PATH or the Command Line Tools first. which brew should print /opt/homebrew/bin/brew.

Install your first package

Installing your first package with Homebrew takes one command. Git is a good first one:

brew install git

brew install git gives you a current Git; other options are in how to install Git. Command-line tools like Git are formulae (brew install name); Mac apps are casks (brew install --cask name). brew list shows what you've installed.

Common next installs for a developer Mac:

Fix "zsh: command not found: brew"

"zsh: command not found: brew" means your shell can't find Homebrew. The installer adds /opt/homebrew/bin to the system PATH for new Terminal windows, and the Next steps lines fix the window you installed from. To fix it:

  • Check that Homebrew is there: run ls /opt/homebrew/bin/brew. If the file exists, the install worked.
  • Run the Next steps lines from the section above.
  • Close and reopen Terminal, then run brew --version.

If /opt/homebrew/bin/brew doesn't exist, or brew is still missing in a new Terminal window, the install most likely didn't finish: run the install command again and read its last lines for the error. If you use bash rather than zsh, add the eval line to ~/.bash_profile.

Install Homebrew on Linux or WSL

Homebrew also runs on Linux and on Windows through WSL (Windows Subsystem for Linux), with the same install command. It installs to /home/linuxbrew/.linuxbrew. First install the build tools it needs; on Debian or Ubuntu, including Ubuntu on WSL:

sudo apt-get install build-essential procps curl file git

Then run the install command from brew.sh and add brew to your PATH:

echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

Use ~/.zshrc instead of ~/.bashrc if zsh is your login shell. For other distributions, Homebrew's Linux documentation lists the packages to install first.

Uninstall Homebrew

To uninstall Homebrew, run the official uninstall script from the Homebrew/install repository on GitHub:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

The script asks for confirmation, then removes Homebrew and every package you installed with it. It may list some folders it couldn't remove; delete those yourself if you don't need them. Finally, remove the brew shellenv line from ~/.zprofile.

Frequently Asked Questions

Is Homebrew safe?

Homebrew is open source, and its install script is public on GitHub, so you can read it before you run it. The script explains what it will change and pauses for your confirmation before it makes any changes.

Why is brew not found after installing?

The installer adds /opt/homebrew/bin to the system PATH for new Terminal windows, but not for the window you installed from: run the "Next steps" lines the installer printed to fix that one. If brew is still missing in a new Terminal window, the install most likely didn't finish, so run the install command again.

Does Homebrew work on Apple Silicon?

Yes. The official installer supports Apple Silicon Macs only and installs Homebrew to /opt/homebrew. Intel Macs are no longer supported, and the install script stops on them.

Do I need Xcode for Homebrew?

No. Homebrew needs only Apple's Command Line Tools for Xcode, a much smaller download than the Xcode app, and the install script installs them for you if they are missing.

How do I update Homebrew?

Run brew update to update Homebrew itself and its list of packages. Then run brew upgrade to update the packages you've installed.

Related Questions

Test Your Website on 3000+ Browsers

Get 100 minutes of automation test minutes FREE!!

Test Now...

KaneAI - Testing Assistant

World’s first AI-Native E2E testing agent.

...

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests