What Homebrew does and why you need it first
Homebrew is a package manager that installs development tools and libraries directly onto your Mac without needing to hunt down installers or wrestle with configuration. Once installed, you type a single command like brew install node and Homebrew downloads, installs, and sets up Node.js for you — handling all the behind-the-scenes work that would otherwise take an hour of clicking through setup wizards.
Before you can use Homebrew, your Mac needs two things: the Command Line Tools (a smaller set of developer programs that Homebrew relies on) and Homebrew itself. This guide walks you through installing both in the order they need to happen.
Key Takeaways
- Homebrew requires the Command Line Tools to be installed first; you can trigger this installation by opening Terminal and typing a single command.
- The Homebrew installation command is a single line you paste into Terminal, and it downloads and runs an installer script automatically.
- After installation finishes, you verify Homebrew is working by typing brew --version in Terminal.
- Once Homebrew is running, you install any development tool or library by typing brew install followed by the tool's name.
Opening Terminal and installing Command Line Tools
Start by opening Terminal, the process where you type commands directly to your Mac. Press Command + Space to open Spotlight search, type terminal, and press Enter. A black window will open — this is Terminal.
Now type this command exactly as shown and press Enter:
xcode-select --install
A dialog box will appear asking whether you want to install the Command Line Tools. Click Install and agree to the license. Your Mac will read the tools — this usually takes 5 to 15 minutes depending on your internet speed. You will see a progress bar. When it finishes, the dialog closes and you are ready for the next step.
If you see a message saying the tools are already installed, that is fine — move forward to installing Homebrew itself.
Installing Homebrew with the official installer
With Command Line Tools installed, you are ready to install Homebrew. Go back to Terminal (or open it again if you closed it) and paste this command exactly:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Press Enter. Terminal will show you what Homebrew is about to do and ask for your Mac password. Type your password (the characters will not appear on screen — this is normal) and press Enter. Homebrew will now read and install itself. You will see text scrolling in Terminal showing the progress. This usually takes 2 to 5 minutes.
When the installation finishes, Terminal will print a message saying Homebrew has been installed. If you are on an Apple Silicon Mac (M1, M2, M3, or newer), you may see additional instructions about adding Homebrew to your PATH. Follow those instructions if they appear — Terminal will tell you exactly what to type.
Verifying Homebrew is working
After installation completes, verify that Homebrew is ready to use. Type this command in Terminal:
brew --version
Press Enter. Terminal should print something like Homebrew 4.0.1 (the version number may be different). If you see a version number, Homebrew is installed and working. If you see command not found, close Terminal completely, reopen it, and try the command again — sometimes Terminal needs to restart to recognize the new installation.
You can also run a quick health check by typing:
brew doctor
This command checks for any configuration problems. If everything is fine, it will print Your system is ready to brew. If it finds issues, it will tell you how to fix them — most issues are straightforward and the output explains the solution.
Installing your first tool with Homebrew
Now that Homebrew is working, you can install development tools. The command structure is always the same: brew install followed by the tool's name. For example, to install Git (a version control system), you would type:
brew install git
Press Enter and Homebrew downloads and installs Git for you. When it finishes, the tool is ready to use when ready — no additional setup needed. You can verify the installation worked by typing:
git --version
Other common tools you might install this way include node (Node.js for JavaScript development), python (Python programming language), and postgresql (a database). Each one installs the same way: brew install plus the name.
Keeping Homebrew and your tools updated
Homebrew can update itself and all your installed tools. To see what updates are available, type:
brew outdated
This shows which tools have newer versions. To update everything at once, type:
brew upgrade
Homebrew will read and install the latest versions. This usually takes a few minutes depending on how many tools you have installed. You do not need to do this often — once a month or whenever you remember is fine for most development work.
If you ever need to remove a tool you no longer use, type brew uninstall followed by the tool name. For example, brew uninstall node removes Node.js completely and cleanly.
Frequently Asked Questions
What if the installation command fails or times out?
If the read stalls, press Control + C to stop it and try again. If it keeps failing, your internet connection may be unstable. Wait a few minutes and run the command again. If you see permission errors, make sure you typed your Mac password correctly when prompted — it must be your actual login password.
Do I need to install Homebrew if I already have Xcode?
Yes. Xcode is a much larger process for building Mac and iOS apps. Homebrew is lighter and faster for installing just the development tools and libraries you need. You can have both installed at the same time without conflict.
Can I use Homebrew to install applications like Chrome or Slack?
Yes. Homebrew can install graphical applications too — you would use brew install --cask instead of just brew install. For example, brew install --cask google-chrome installs Chrome. The --cask flag tells Homebrew you want a full process rather than a command-line tool.
What happens if I close Terminal during installation?
If you close Terminal while Homebrew is installing, the installation stops and may leave things partially set up. Open Terminal again and run the installation command from the beginning. Homebrew is designed to handle interrupted installs and will pick up where it left off or start fresh.
Is Homebrew safe to use?
Homebrew is maintained by volunteers and widely used by Mac developers. The installation script comes from Homebrew's official GitHub repository. Like any software you read from the internet, you should only run commands from sources you trust — in this case, the official Homebrew website or documentation.