# Homebrew Guide: Install and Use Homebrew on Mac

> Learn how to install Homebrew on Mac, Linux and Windows, use brew commands, install apps with casks, and save your whole setup in a Brewfile.

By Jonathan Ben Haim. Updated 2026-11-29. Source: https://jonathanai.io/blog/homebrew-guide-for-beginners

[Almost every AI tool](/blog/personal-ai-agent-guide-five-tools) I show in my videos starts with the same line: `brew install` and something. Most people who write to me saying it does not work are stuck right there, before the tool even starts. This guide closes that gap, from the basics to tricks that many experienced developers do not know.

**In short:** Homebrew is a free, [open source](/blog/open-source-ai-coach-guide) package manager for Mac and Linux that installs software from the Terminal. On a Mac, you install it with one command from [brew.sh](https://brew.sh), then use `brew install` for [command-line tools](/blog/free-app-stack-build-full-app) and `brew install --cask` for apps like Zoom or Chrome. On Apple Silicon Macs, you add `/opt/homebrew/bin` to your PATH, and on Windows you can use WSL2, winget, or Scoop.

## Key takeaways

- Homebrew is free, open source, and needs no account. It runs on macOS and Linux.
- The Homebrew catalog includes 7,000+ command-line tools and 7,000+ regular apps.
- `brew install ffmpeg` installs a tool, and `brew upgrade` updates everything you installed with brew.
- On a Mac with Apple Silicon (M1 and later), Homebrew lives in `/opt/homebrew`, and you must add it to your PATH.
- `brew install --cask` installs regular apps with windows, such as Chrome, VS Code, [Docker Desktop](/blog/docker-sandboxes-run-claude-code-safely), and Claude.
- A Brewfile lets you restore a full setup on a new machine with one command.

## Why does Homebrew matter for AI tools?

Most AI tools are easier to set up once Homebrew is working, because the install step is the same for each one. This guide covers the setup, the everyday commands, and the advanced features I use.

After you finish this guide, you will be able to:

- Install any tool in the Homebrew catalog with two words
- Understand why developers do not download software from websites
- Find new tools before everyone starts talking about them
- Restore your whole computer on a new machine with one command
- See what millions of developers actually install (the data is public, and I will show you where)

## What is Homebrew?

Homebrew is a package manager. A package is software bundled up for install, and the manager is the tool that installs, updates, and removes it for you.

Think of it like the App Store, with a few differences:

- It works in the Terminal, not on your iPhone.
- It is free, open source, and needs no account.
- It has 7,000+ command-line tools and 7,000+ regular apps, such as Chrome, VS Code, Docker, and Slack.
- It updates everything together with one command.

Homebrew, or just "brew" for short, was created in 2009 by Max Howell, a developer who was tired of how software was installed on the Mac. Today it is a large open source project maintained by hundreds of volunteers. It runs on macOS and Linux, and it handles hundreds of millions of installs per year. Homebrew is not owned by Apple or any other company, and that is a big reason developers trust it.

### What problem does Homebrew solve?

The old way to install a tool looks like this:

1. Search Google.
2. Find the right website (and not a fake one).
3. Download a file.
4. Open it, drag it, approve it, click next, next, next.
5. Find out a month later that there is a new version, and repeat everything.

With brew, you run this:

```
brew install ffmpeg
```

That is it. When there is a new version, you run this:

```
brew upgrade
```

This updates everything you installed, not just one tool.

### What do the Homebrew terms mean?

| Term | What it means in practice |
|---|---|
| Formula | A command-line tool, such as ffmpeg, node, python, or git |
| Cask | A regular app with a window, such as Chrome, VS Code, Docker Desktop, or Claude |
| Tap | An extra package repository, usually from a specific developer or company |
| Bottle | A precompiled version, so installs take seconds instead of minutes |
| Cellar | The folder where brew stores everything (`/opt/homebrew/Cellar`). Do not touch it by hand. |

The only difference that really matters day to day is this: you install a formula with `brew install name` and a cask with `brew install --cask name`. Newer versions of brew usually detect the type on their own, but `--cask` prevents confusion when two things share a name.

## How do you install Homebrew on a Mac?

On a Mac, open Terminal, paste the install command from the Homebrew site, then follow the Next steps that appear at the end. Apple Silicon Macs also need two extra lines added to your shell profile.

### Step 0: Make sure you have Terminal

Terminal comes with every Mac. Open it with Spotlight (press Cmd + Space and type Terminal). This is the black-and-white window where you type everything.

Tip: if you plan to work with AI seriously, consider installing a better terminal, such as Ghostty or iTerm2. For the first install, the regular Terminal is enough.

### Step 1: Run the install command

Paste this line into Terminal and press Enter:

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

Here is what happens:

- It asks for your user password. You will not see the characters as you type. This is normal.
- It installs Xcode Command Line Tools if you do not have them. These are Apple's [build tools](/blog/mobile-app-development-tools-stack), and the install takes a few minutes.
- At the end, it shows a list called "Next steps."

Read the Next steps. Most people skip this part, and then say brew "does not work."

### Step 2: Add brew to your PATH (the step everyone misses)

On a Mac with Apple Silicon (M1 and later, which means every Mac from 2020 onward), brew installs to `/opt/homebrew`. Terminal does not look there until you tell it to.

The install prints the exact two lines you need. They usually look like this:

```
echo >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```

Paste them, press Enter, then close Terminal and open it again.

On an older Mac with Intel, the path is `/usr/local`, and you usually do not need this step.

### Step 3: Check that everything works

```
brew --version
```

If you see a version number, you are done. Then run:

```
brew doctor
```

This is a checkup tool that looks for anything that is not set up properly. You want to see the message `Your system is ready to brew.` Warnings are usually not critical. Errors are worth reading.

### Step 4: Your first install

```
brew install cowsay
cowsay "it works"
```

A cow that talks. If it appears, you are in.

## Why does "brew command not found" appear, and how do you fix it?

This message almost always means one thing: brew is installed, but Terminal does not know where it is. The fix takes three steps.

1. Run the eval lines that the install printed. They write brew into the file `~/.zprofile`. On an Apple Silicon Mac, they usually look like this:

```
echo >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
```

2. Close Terminal and open a new window. Terminal reads `~/.zprofile` only when it opens.

3. Run `brew doctor`. If you see `Your system is ready to brew.`, the problem is solved.

Where brew should be: on an Apple Silicon Mac (M1 and later) in `/opt/homebrew`, and on an Intel Mac in `/usr/local`. If the install itself got stuck or failed because of Apple's build tools, install those first with `xcode-select --install`, then run the install command again.

## How do you install Homebrew on Linux?

You install Homebrew on Linux with the same command you use on a Mac. Homebrew runs on Linux in the same way, and the install is the same.

Homebrew was once called Linuxbrew. Today it is the same project.

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

On Linux, the path is different: `/home/linuxbrew/.linuxbrew`. The Next steps at the end of the install tell you what to add to `~/.bashrc` or `~/.zshrc`.

Why use brew on Linux when you have apt? Because brew versions are up to date (apt can sometimes lag by years), because it does not require sudo, and because [new AI tools](/blog/ai-agents-you-can-build-today) reach brew long before they reach apt.

## How do you install Homebrew on Windows?

Homebrew does not run directly on Windows. The best option is WSL2, which gives you a real Linux environment inside Windows. You can also use winget or Scoop for Windows-native installs.

### Option 1: WSL2 (recommended if you work with AI)

WSL means Windows Subsystem for Linux. It is real Linux running inside Windows, and most AI tools assume you are using it.

1. Open PowerShell as administrator and run:

```
wsl --install
```

2. Restart your computer, then open Ubuntu from the Start menu.
3. Inside Ubuntu, run the Homebrew install command from the Linux section above.

From that point on, everything in this guide works for you exactly as written.

### Option 2: winget (built into Windows)

For regular apps, Windows has its own package manager:

```
winget install Google.Chrome
winget install Microsoft.VisualStudioCode
winget install OpenJS.NodeJS
winget install Python.Python.3.13
winget upgrade --all
```

To search, run `winget search name`.

### Option 3: Scoop (the closest in spirit to brew)

Scoop installs command-line tools without administrator rights, just like brew:

```
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
scoop install git nodejs python
```

### Translation table

| What you want | Mac / Linux (brew) | Windows (winget) | Windows (scoop) |
|---|---|---|---|
| Install | `brew install X` | `winget install X` | `scoop install X` |
| Search | `brew search X` | `winget search X` | `scoop search X` |
| Update everything | `brew upgrade` | `winget upgrade --all` | `scoop update *` |
| Remove | `brew uninstall X` | `winget uninstall X` | `scoop uninstall X` |
| List what is installed | `brew list` | `winget list` | `scoop list` |

## Which Homebrew commands do you use every day?
