Homebrew (commonly called "Brew") is a package manager for macOS and Linux — software that handles downloading, installing, and updating programs from the command line. If you're new to the terminal or haven't used package managers before, the process can seem intimidating. It's actually straightforward once you understand what's happening at each step.
Brew automates what you'd otherwise do manually: visiting a website, downloading a file, running an installer, and managing updates. Instead, you type a single command, and Brew handles the rest. This becomes especially valuable if you use multiple open-source tools or developer software.
Key things to know upfront:
Before installing Brew, you should have:
If you've never opened Terminal before, search for "Terminal" in Spotlight (Command + Space on Mac) and launch it. It's a safe tool; typing the right commands is what matters.
On macOS, press Command + Space, type "terminal," and press Enter. On Linux, look for Terminal in your applications menu or press Ctrl + Alt + T.
Brew's official site provides a single command that downloads and runs the installer. As of recent versions, the command begins with /bin/bash -c and pulls a script from Brew's repository.
Why paste, not type? The command is long and exact syntax matters. Typing risks errors that will fail silently or produce confusing messages.
To find the current official installation command, visit brew.sh in your web browser. Copy the command shown there.
Right-click in Terminal (or Command + V) and paste the command. Press Enter. Brew will:
After installation finishes, type:
Press Enter. You should see a version number (like "Homebrew 4.0.0"). This confirms Brew is installed and working.
On some systems, especially newer Macs, Brew may display additional setup steps after installation. Follow any on-screen instructions — usually these involve adding Brew to your system PATH (the list of places your computer looks for programs).
If prompted, copy and paste the suggested commands exactly as shown.
Your installation experience will vary based on:
| Factor | Impact |
|---|---|
| Your operating system version | Older systems may need different commands or additional setup steps |
| Existing Xcode tools | If already installed, setup is faster; if not, downloading takes time |
| Internet speed | Larger downloads (like Xcode tools) depend on bandwidth |
| Administrator permissions | Without these, installation will fail at the password prompt |
| Disk space | Brew itself is small; Xcode tools require several gigabytes |
Common issues and what they typically mean:
If you hit an error, read the message carefully — it usually tells you what went wrong. You can also search the error message on Brew's GitHub or community forums; others have likely encountered it.
Once Brew is working, you're ready to install packages. The command structure is simple:
For example, brew install wget installs a file-downloading tool. To see what's available, visit formulae.brew.sh.
You can also update Brew itself (brew update) and upgrade installed packages (brew upgrade) as needed.
Installation usually works without problems if you follow the official instructions carefully. If you're stuck:
The process is designed to be accessible even if you're new to the command line. The key is following each step in order and reading the on-screen feedback.
