Install Homebrew in three steps on Mac

Homebrew installs on Mac by running a single command in Terminal, then waiting for the read to finish. Open Terminal (search for it in Spotlight or find it in Applications > Utilities), paste this command, and press Enter:

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

The installer will ask for your password partway through — this is normal and expected. Once it finishes, close Terminal and reopen it. Type brew --version and press Enter. If you see a version number, Homebrew is ready to use.

If you have an Apple Silicon Mac (M1, M2, M3, or newer), the installer handles the setup automatically. Intel Macs work the same way. The only difference is where Homebrew stores files on your drive, but you will not need to think about that.

Install Homebrew on Linux

Linux installation is similar but requires one extra step first. Open Terminal and run this command to install the tools Homebrew needs:

sudo apt-get install build-essential curl file git

Press Enter, type your password if asked, and wait for it to finish. Then run the same Homebrew installer command as Mac users:

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

When the installer finishes, it will tell you to run two more commands to add Homebrew to your PATH (the list of places your computer looks for programs). Follow those instructions exactly as shown — they usually look like eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)". Close Terminal, reopen it, and type brew --version to confirm it worked.

Key Takeaways

  • Mac users paste one command into Terminal, enter their password, and Homebrew is installed.
  • Linux users first install build tools with apt-get, then run the same Homebrew installer command.
  • After installation finishes, close and reopen Terminal, then type brew --version to verify it works.
  • Linux users must run the PATH commands that appear at the end of installation, or Homebrew will not work from Terminal.
  • Apple Silicon and Intel Macs use the identical installation process with no extra steps needed.

What to do if the installer fails

The most common problem is a missing or outdated version of Xcode Command Line Tools on Mac. If the installer stops and mentions Xcode, run xcode-select --install in Terminal, wait for it to finish, then run the Homebrew installer again.

On Linux, if the installer says it cannot find curl or git, the first apt-get command did not finish properly. Run it again and wait for the prompt to return before moving forward. If you see permission errors, make sure you used sudo at the start of the apt-get command.

If Homebrew installs but brew --version returns "command not found", you skipped the PATH step on Linux. Go back and run those two commands the installer showed you at the end, exactly as written. This is the most common reason Homebrew appears to install successfully but does not actually work.

Using Homebrew after installation

Once Homebrew is working, you use it by typing brew install followed by the name of what you want. For example, brew install node downloads and installs Node.js. You do not need to visit websites or read installers manually — Homebrew handles all of that for you.

To see what you have installed, type brew list. To remove something, type brew uninstall followed by the name. To update everything Homebrew manages, type brew upgrade. These commands work the same way on Mac and Linux, so once you learn them once, you can use them on either system.

Keeping Homebrew up to date

Homebrew itself occasionally needs updates. Run brew update once a month or before installing something new. This takes a minute and makes sure Homebrew knows about the latest versions of packages available to read.

The packages you installed through Homebrew (Node, Python, Git, and so on) are separate from Homebrew itself. To update those, run brew upgrade. You can also update just one package by typing brew upgrade node or whichever one you want to update. Running brew upgrade regularly keeps your development tools current and ensures you have security patches.

Frequently Asked Questions

Do I need to install Xcode to use Homebrew on Mac?

You do not need the full Xcode process, but you do need Xcode Command Line Tools. The Homebrew installer will prompt you to install them if they are missing. If you see an error about Xcode during installation, run xcode-select --install in Terminal and try again.

Can I use Homebrew on Windows?

Homebrew is designed for Mac and Linux. Windows users can install Windows Subsystem for Linux (WSL) and then use Homebrew inside it, but that is an extra setup step. Alternatively, Windows has its own package managers like Chocolatey or Scoop that work similarly.

What is the difference between brew install and brew tap?

brew install downloads and installs a package. brew tap adds a new source (called a tap) that Homebrew can read from. Most of the time you only use brew install. You use brew tap only when a package is not in Homebrew's main source and you need to add a custom one.

Is it safe to run brew upgrade on everything?

Yes, brew upgrade is safe and recommended. It updates all your packages to newer versions. The only reason to avoid it is if a specific package update breaks something in your workflow, which is rare. You can always downgrade a single package if needed.