TopMac
Guides

How to Install Homebrew on Mac and Start Using It

To install Homebrew on a Mac, paste the one-line command from brew.sh into Terminal and follow the prompts. Here is the command and what to do next.

By the TopMac team · November 30, 2026 · 6 min read

To install Homebrew on a Mac, open Terminal, paste the one-line install command from brew.sh, press Return and follow the prompts. The script tells you what it is going to do and waits for you to confirm before it changes anything. When it finishes, run the short "Next steps" commands it prints so the brew command works in new Terminal windows.

What Homebrew is

Homebrew is a free package manager. It installs software from the command line, keeps track of what it installed, and updates or removes it later with a single command. It is run by volunteers.

People use it for two kinds of software:

  • Command-line tools that macOS does not include, such as ffmpeg or wget.
  • Regular Mac apps, so you can install a browser or a utility without visiting a website and dragging an icon to the Applications folder.

Homebrew keeps everything inside its own folder, which it calls the prefix. On a Mac with Apple silicon that is /opt/homebrew. On an Intel Mac it is /usr/local.

Before you install

Homebrew's documentation lists these requirements for macOS:

  • macOS Sequoia or newer.
  • A Mac with Apple silicon. Intel Macs still work but get a lower level of support.
  • Apple's Command Line Tools for Xcode. You do not need to install these first, because the script installs them if they are missing.

You will also be asked for your Mac password during the install, because the script needs administrator rights to create its folder. Homebrew's files should live on the internal disk, not on an external or network drive.

Install Homebrew

  1. Open Terminal. It is in the Utilities folder inside Applications, or you can find it with Spotlight. Another terminal app such as WezTerm works the same way.

  2. Paste this command, copied today from brew.sh, and press Return:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  3. Enter your Mac password if the script asks for it. Nothing appears on screen as you type, which is normal.

  4. Read what the script says it will do. It explains its plan and then pauses. Press Return to continue, or any other key to stop.

  5. Wait while it downloads. If the Command Line Tools need installing, this step takes longer.

  6. When you see "Installation successful", look for the "Next steps" section at the bottom of the output.

It is a good habit to compare any install command you find in an article with the one shown on brew.sh before running it.

Finish with the Next steps commands

The brew command only works once Homebrew is on your shell's PATH. If anything is left to do, the installer prints the exact commands for your Mac and your shell. For the zsh shell on Apple silicon they look like this:

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

Copy the lines from your own Terminal output instead of from here, since they depend on your setup. Then check that everything works:

brew doctor

It looks for common problems with your setup and reports anything it finds.

The package installer

If you would prefer not to paste a script, Homebrew also publishes a .pkg installer on its GitHub releases page. It supports Apple silicon Macs only and installs to the same /opt/homebrew location.

Analytics

Homebrew collects anonymous, aggregate usage analytics and shows a notice about it during installation. To opt out, run:

brew analytics off

Formulae and casks

Homebrew packages come in two types, and the difference explains most of what you will see in its output.

FormulaCask
What it installsCommand-line tools, libraries and servicesPre-built software such as Mac apps, fonts and plugins
Where it comes fromBuilt from the upstream source codeThe developer's own download
Exampleffmpegfirefox
Where it ends upInside Homebrew's prefixApps go in the Applications folder
Updatesbrew upgradebrew upgrade, though some apps update themselves

Formulae in Homebrew's main repository must be open-source software, and both types are reviewed by a person before they are accepted or changed.

You install both with the same command. For example, this installs a command-line tool and a browser together:

brew install ffmpeg firefox

The first is a formula and the second is a cask that puts Firefox in your Applications folder. If you want to be explicit, add --cask:

brew install --cask firefox

Many apps publish their own Homebrew instructions. The clipboard manager Maccy, for instance, can be installed with brew install maccy.

One thing to know about casks: many Mac apps update themselves. Homebrew skips those during a normal upgrade when it cannot tell reliably whether the installed copy is older. If you want Homebrew to update them as well, use brew upgrade --greedy.

The basic commands

These cover almost everything you will do day to day.

CommandWhat it does
brew search textFinds formulae and casks whose names contain the text
brew info nameShows details about a package
brew install nameInstalls a formula or cask
brew listLists everything you have installed
brew updateRefreshes Homebrew itself and its list of available packages
brew outdatedShows which installed packages have a newer version
brew upgradeUpgrades everything that is outdated
brew upgrade nameUpgrades one package
brew uninstall nameRemoves a formula or cask
brew autoremoveClears out leftover dependencies that nothing uses anymore
brew cleanupDeletes old downloads and old versions
brew doctorChecks for problems

A typical routine is brew update, then brew outdated to see what changed, then brew upgrade. Homebrew removes the old version of a formula automatically when it upgrades it.

Do not put sudo in front of brew commands. Homebrew is set up so that you do not need it after the initial installation, and its documentation warns against running brew that way.

If you set up Macs often, look at Homebrew Bundle. You list your formulae and casks in a text file called a Brewfile, and brew bundle installs whatever is missing.

How to uninstall Homebrew

Homebrew provides an official uninstall script. Before you run it, note that it removes Homebrew and the packages inside its prefix, so list what you have with brew list if you might want to reinstall some of it later.

Run this in Terminal:

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

It asks whether you are sure, and warns that your installed packages will be removed, before it deletes anything.

If you moved from an Intel Mac to an Apple silicon one and have an old installation left over in /usr/local, Homebrew's instructions are to download the script and point it at that folder:

curl -fsSLO https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh
/bin/bash uninstall.sh --path /usr/local

Afterward, open ~/.zprofile in a text editor and delete the brew shellenv line you added during setup, so Terminal does not look for a program that is no longer there.

Frequently asked questions

Is Homebrew safe to install on a Mac?

The install script is public, shows what it will do and waits for you to confirm. Copy the command from brew.sh itself so you know you are running the official script.

Why does Terminal say "command not found: brew" after installing?

Homebrew has not been added to your PATH. Run the commands shown under "Next steps" at the end of the installer's output, then open a new Terminal window.

Do I need Xcode to use Homebrew?

No. The smaller Command Line Tools for Xcode are enough, and the install script installs them for you if they are missing.

Does Homebrew work on Intel Macs?

Yes, though Homebrew's documentation treats Intel as a lower support tier than Apple silicon. On Intel it installs to /usr/local.

Apps in this guide

WezTerm

GPU-accelerated terminal emulator and multiplexer configured with Lua

Developer ToolsFree · Open source4.6k

Firefox

Independent web browser with tracker blocking on by default

BrowsersFree · Open source49.5k

Maccy

Lightweight, keyboard-driven clipboard manager that keeps your copy history

ProductivityFree · Menu bar · Open source20.5k