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: