What Homebrew does and why you need it

Homebrew is a package manager that installs software and development tools on your Mac from the command line. Instead of hunting for a download link, waiting for an installer to run, and clicking through setup screens, you type one command and Homebrew fetches, installs, and sets up the tool for you. It also handles updates and removes old versions when you're done with them.

If you work with code, databases, or command-line tools, Homebrew saves hours of manual installation work. It's free and runs on Intel and Apple Silicon Macs running macOS 10.13 or newer.

Key Takeaways

  • Homebrew requires Xcode Command Line Tools, which you install first by running a single command in Terminal.
  • The Homebrew installation command is a single line you paste into Terminal, and it downloads and runs an installer script automatically.
  • After installation, you verify Homebrew works by typing brew --version in Terminal.
  • Once installed, you use Homebrew to install other tools by typing brew install followed by the tool name.
  • Homebrew stores everything in a folder on your Mac, and you can remove it completely by running the uninstall command if you no longer need it.

Install Xcode Command Line Tools first

Homebrew needs Xcode Command Line Tools — a set of programming utilities that come from Apple — to work. You don't need the full Xcode application, just the command-line version. Installing it takes a few minutes.

Open Terminal (search for it in Spotlight by pressing Command + Space, type "Terminal", and press Enter). Then paste this command and press Enter:

xcode-select --install

A window will appear asking you to install the tools. Click Install, agree to the license, and wait. This usually takes 5 to 15 minutes depending on your internet speed. When it finishes, you'll see a message saying the software was installed successfully. You can close Terminal and move to the next step.

Run the Homebrew installation command

Open Terminal again. Go to the official Homebrew website (brew.sh) and copy the installation command from the home page — it's a long line that starts with /bin/bash. Paste it into Terminal and press Enter.

Homebrew will download and run an installer script. It will ask for your Mac password partway through — this is normal, because Homebrew needs permission to create folders on your computer. Type your password (you won't see the letters appear, which is also normal) and press Enter. The installation continues automatically.

This step usually takes 2 to 5 minutes. When it finishes, Terminal will show a message saying Homebrew was installed successfully. You may also see a note about adding Homebrew to your PATH — if you do, follow the instructions shown on your screen. These instructions are specific to your Mac and ensure Homebrew works from any Terminal window.

Verify the installation worked

Close Terminal completely and open it again. This ensures Terminal loads the updated settings. Then type this command and press Enter:

brew --version

Terminal will show the Homebrew version number — something like "Homebrew 4.0.1". If you see a version number, Homebrew is installed and working. If you see "command not found", the PATH instructions from the previous step didn't apply correctly to your setup. Go back and follow those instructions exactly as shown.

Test Homebrew by installing a tool

To confirm everything works end-to-end, install a small, harmless tool. Type this command and press Enter:

brew install wget

Homebrew will download and install wget, a tool for downloading files from the internet. You'll see progress messages as it works. When it finishes, type this to confirm it's there:

which wget

Terminal will show the path to wget, which means the installation succeeded. You now have a working Homebrew setup. You can uninstall wget later if you don't need it by typing brew uninstall wget.

Common problems and how to fix them

If Terminal says "Permission denied" when you try to install something, you may have run a command with sudo at the beginning. Homebrew should never need sudo — remove it and run the command again. If you get "command not found" after installation, Terminal didn't load the PATH settings. Close Terminal completely, open it again, and try brew --version once more.

If Homebrew says it needs Xcode Command Line Tools but you already installed them, the tools may have become corrupted. Run xcode-select --install again to reinstall them. If you're on an Apple Silicon Mac (M1, M2, M3, or newer) and installation seems stuck, make sure you're using the native Terminal app, not a version designed for Intel Macs.

What to do next with Homebrew

Now that Homebrew is running, you can install development tools, databases, and command-line utilities without hunting for downloads. Common first installs include Git (version control), Node.js (JavaScript runtime), and Python (programming language). To see what's available, visit the Homebrew package directory at formulae.brew.sh, search for a tool name, and copy the install command shown.

Keep Homebrew updated by running brew update periodically. To see what tools you've installed, type brew list. To remove a tool you no longer need, type brew uninstall followed by the tool name. If you ever want to remove Homebrew completely, the uninstall command is on the Homebrew website.

Frequently Asked Questions

Do I need to pay for Homebrew?

No. Homebrew is free and open-source. The tools it installs may be free or paid depending on the tool, but Homebrew itself costs nothing.

Can I use Homebrew on Windows or Linux?

Homebrew was built for Mac, but a Linux version called Linuxbrew exists for some Linux systems. Windows users should look into Windows Package Manager or WSL (Windows Subsystem for Linux) instead.

What happens if I close Terminal while Homebrew is installing?

The installation stops and may leave things partially set up. Open Terminal again and run the command that was interrupted. Homebrew is designed to handle partial installs and will pick up where it left off or start fresh.

How much disk space does Homebrew use?

Homebrew itself takes very little space, but the tools you install with it vary widely. A single large tool like a database can take hundreds of megabytes. You can check how much space Homebrew is using by typing du -sh /usr/local/Cellar in Terminal.

Can multiple people on the same Mac use Homebrew?

Yes. Homebrew installs to a shared location, so all user accounts on the Mac can use the same installed tools. Each person types the same commands to access them.