How to Install Homebrew on Mac: A Complete Setup Guide
Homebrew is the most widely used package manager for macOS — a command-line tool that lets you install, update, and manage software libraries, utilities, and developer tools that don't come bundled with macOS. If you're doing any kind of web development, scripting, or command-line work on a Mac, understanding how to install and use Homebrew is a foundational skill.
What Homebrew Actually Does
Before diving into the installation steps, it helps to understand what you're actually installing. Homebrew acts as an intermediary between you and thousands of open-source software packages — called formulae (for command-line tools) and casks (for GUI applications). Instead of hunting down installers, managing paths manually, or dealing with version conflicts, Homebrew handles all of that through a single, consistent interface.
It installs packages into its own directory (/usr/local on Intel Macs, /opt/homebrew on Apple Silicon Macs) and then symlinks files into the appropriate system paths — keeping your macOS environment clean and organized.
System Requirements to Know Before You Start
Not every Mac is in the same position when it comes to Homebrew installation. A few key variables determine how smoothly the process goes:
- macOS version: Homebrew officially supports macOS Ventura, Monterey, and Big Sur. Older versions (Catalina, Mojave, High Sierra) may work but receive limited support. Running a very old OS version can cause dependency issues.
- Processor architecture: Apple Silicon Macs (M1, M2, M3 chips) and Intel Macs handle Homebrew differently. The install script detects your architecture automatically, but the default install path differs between the two — something to be aware of if you're configuring shell profiles manually.
- Xcode Command Line Tools: Homebrew requires Apple's Xcode Command Line Tools, which include compilers and developer utilities. If you don't have them, the Homebrew installer will prompt you to install them automatically — but this step adds time and requires an internet connection.
- Disk space: Homebrew itself is lightweight, but individual packages can be large. Having at least a few gigabytes free is a reasonable baseline.
Step-by-Step: Installing Homebrew on macOS 🍺
Step 1: Open Terminal
Open the Terminal app on your Mac. You can find it in Applications > Utilities > Terminal, or search for it with Spotlight (Cmd + Space, then type "Terminal").
Step 2: Run the Official Install Script
Paste the following command into Terminal and press Return:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" This is the official install command from brew.sh — the Homebrew project's own website. The script downloads and installs Homebrew, and if Xcode Command Line Tools aren't already present, it will trigger that installation first.
Step 3: Enter Your Password When Prompted
The installer will ask for your macOS user password. This is required because Homebrew needs to create directories and set permissions. Your password won't appear as you type — that's normal behavior in Terminal.
Step 4: Follow Any Post-Install Instructions (Apple Silicon Macs)
If you're on an Apple Silicon Mac, the installer will display additional instructions at the end — typically two commands you need to run to add Homebrew to your shell's PATH. These usually look like:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" This step is critical. Skipping it means your shell won't recognize the brew command. Intel Mac users generally don't need this step because Homebrew's default path is already recognized.
Step 5: Verify the Installation
Run this command to confirm everything installed correctly:
brew doctor A healthy install returns: Your system is ready to brew. If it surfaces warnings, they're usually minor and include suggested fixes inline.
Installing Your First Package
Once Homebrew is running, installing tools is straightforward. For example:
brew install node brew install git brew install wget For GUI applications using casks:
brew install --cask visual-studio-code brew install --cask firefox Variables That Affect Your Experience
Even with a clean install, several factors shape how Homebrew behaves in practice:
| Variable | How It Matters |
|---|---|
| macOS version | Older OS versions may lack supported dependencies |
| Chip architecture | Determines install path; affects shell config steps |
| Existing developer tools | Pre-installed Xcode speeds up setup significantly |
| Shell type | Zsh (default on modern macOS) vs Bash affects profile file locations |
| Network speed | Large packages or Xcode tools can take significant time to download |
Common Issues and What Causes Them
"brew: command not found" — Almost always a PATH issue, particularly on Apple Silicon. The post-install shell configuration commands were either not run or saved to the wrong profile file (.zshrc vs .zprofile).
Xcode license agreement errors — If you have Xcode installed but haven't accepted the license, some tools won't build. Running sudo xcodebuild -license accept in Terminal resolves this.
Permission errors on shared Macs — Homebrew works best when installed under a single user account. Multi-user setups on shared machines can create ownership conflicts in Homebrew's directories.
Slow or failed downloads — Network conditions, firewall settings, or corporate proxies can interrupt the install script or package downloads mid-process.
The Setup Picture Depends on Your Environment 🖥️
Homebrew's installation process is relatively standardized, but the specifics — which shell profile to edit, whether you need post-install steps, which packages create dependency conflicts — vary meaningfully based on your Mac's architecture, your current macOS version, what developer tools are already present, and how your shell environment is configured. A clean, freshly set up M2 MacBook Pro running the latest macOS is a very different starting point than a five-year-old Intel Mac that's gone through several OS upgrades. Knowing which situation you're in is what determines which steps actually apply to you.