How to Install Homebrew on macOS: A Complete Setup Guide

Homebrew is the most widely used package manager for macOS, giving developers and power users a straightforward way to install command-line tools, programming languages, databases, and utilities that don't ship with macOS by default. If you're setting up a development environment on a Mac, Homebrew is typically one of the first things installed — and for good reason.

What Is Homebrew and Why Do Developers Use It?

macOS doesn't come with a built-in package manager the way Linux distributions do (like apt on Ubuntu or dnf on Fedora). Homebrew fills that gap. With a single command, you can install tools like Node.js, Python, Git, wget, PostgreSQL, ffmpeg, and hundreds of others — without manually downloading installers or managing file paths.

Homebrew installs packages into its own directory and symlinks them into /usr/local (on Intel Macs) or /opt/homebrew (on Apple Silicon Macs). This keeps your system clean and makes it easy to update or remove packages later.

What You Need Before Installing Homebrew

Before running the installer, make sure your Mac meets the basic requirements:

  • macOS version: Homebrew officially supports macOS Ventura, Monterey, Big Sur, and recent versions going back a few years. Running a very old version of macOS may limit which packages are available.
  • Command Line Tools for Xcode: Homebrew depends on Apple's command-line build tools. The installer can trigger this automatically, but having Xcode or the standalone Command Line Tools already installed speeds things up.
  • A stable internet connection: Homebrew downloads packages and dependencies from the internet during installation.
  • Terminal access: You'll need to be comfortable entering a command into Terminal (or a Terminal alternative like iTerm2).

To check your macOS version, click the Apple menu → About This Mac.

Step-by-Step: Installing Homebrew on macOS 🍺

Step 1 — Open Terminal

Launch Terminal from Applications → Utilities → Terminal, or use Spotlight Search (⌘ + Space) and type "Terminal."

Step 2 — Run the Official Install Command

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 script hosted by Homebrew. It will:

  • Check your system for compatibility
  • Prompt you to install Command Line Tools for Xcode if they're missing
  • Download and install Homebrew in the correct directory for your Mac's architecture

You may be asked to enter your macOS administrator password. This is expected — Homebrew needs permission to create directories during setup.

Step 3 — Follow the On-Screen Prompts

The script walks you through each step. It will display what it's doing and pause where your input is needed. Installation typically takes a few minutes depending on your connection speed.

Step 4 — Add Homebrew to Your PATH (Apple Silicon Macs)

On Macs with Apple Silicon (M1, M2, M3, and later chips), Homebrew installs to /opt/homebrew instead of /usr/local. After installation, the script will display a message telling you to run two commands to add Homebrew to your shell's PATH. They look like this:

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

Copy and run the exact commands shown in your Terminal output — they'll include your actual username. This step is required on Apple Silicon; skipping it means the brew command won't be recognized in new Terminal sessions.

On Intel Macs, Homebrew typically configures your PATH automatically.

Step 5 — Verify the Installation

Run this command to confirm Homebrew is installed and working:

brew doctor 

A healthy installation returns: Your system is ready to brew. Any warnings shown are usually minor and include suggested fixes.

Installing Your First Package

Once Homebrew is running, installing software is straightforward:

brew install git brew install node brew install wget 

Use brew search [term] to find available packages, and brew update && brew upgrade to keep everything current.

Key Differences: Intel Mac vs Apple Silicon Mac

FactorIntel MacApple Silicon Mac
Install directory/usr/local/opt/homebrew
PATH setupUsually automaticManual step required post-install
CompatibilityBroad, long-standing supportExcellent native support on modern Homebrew
Architecturex86_64arm64

Understanding which chip your Mac uses matters — not just for Homebrew, but for any development tooling you install afterward. Some older packages may still run under Rosetta 2 on Apple Silicon, though native arm64 builds are now common.

Common Installation Issues

"Permission denied" errors: Usually resolved by confirming you have administrator access on the Mac account you're using.

Xcode Command Line Tools stuck or slow: This download comes from Apple's servers and can be slow. If it stalls, you can install them manually first with xcode-select --install, then re-run the Homebrew installer.

brew command not found after installation: Almost always a PATH issue, particularly on Apple Silicon. Double-check that you ran the PATH commands shown at the end of the install script.

Outdated macOS: If your macOS version is no longer supported, Homebrew may install in a legacy mode with limited functionality. Upgrading macOS first is generally the cleaner path.

The Variables That Shape Your Experience 🔧

Homebrew installs the same way for most users, but how it fits into your workflow depends on factors that vary by setup: whether you're on Intel or Apple Silicon, which shell you use (zsh is macOS default, but bash and fish have different config files), your macOS version, and what development stack you're building around it. A developer setting up a Ruby on Rails environment will interact with Homebrew very differently than someone who just needs a few command-line utilities. The installation process is consistent — but what you do with Homebrew once it's running is entirely shaped by your own project requirements and environment.