1 Install Homebrew
Homebrew is macOS's missing package manager. It simplifies installing and managing development tools, libraries, and applications from the command line. Install this first — many other tools depend on it.
Prerequisites
Ensure you have Xcode Command Line Tools installed. Run this command and follow any prompts:
$ xcode-select --install
Install Homebrew
Run this official installation script:
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Follow the on-screen instructions. You may need to enter your password and press Enter to continue.
Add Homebrew to your PATH
After installation completes, you'll see instructions to add Homebrew to your PATH. The commands will look like this (run them exactly as shown in your terminal output):
$ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
$ eval "$(/opt/homebrew/bin/brew shellenv)"
Note: On Intel Macs, the path may be /usr/local/bin/brew instead of /opt/homebrew/bin/brew. Use the exact commands shown in your terminal output.
Verify installation
Confirm Homebrew is working:
$ brew --version
You should see output like Homebrew 4.x.x.