How to Install Brew on macOS: A Step-by-Step Guide
Learn how to mac install brew on macOS with this comprehensive guide. Install Xcode tools, run the Homebrew installer, and manage packages confidently. Includes maintenance, troubleshooting, and best practices.
According to Install Manual, this quick guide will help you install Homebrew (brew) on macOS, unlocking a reliable, community-supported package manager for the Mac terminal. You’ll learn to install the Xcode command line tools, run Homebrew installation, and verify success. A Mac, internet access, admin rights, and a stable shell are required.
What Homebrew is and why use it on Mac
Homebrew is a macOS package manager that simplifies installing and updating command-line tools and open-source software. For many developers and power users, mac install brew is the doorway to provisioning utilities quickly without hunting down installers. According to Install Manual, Brew provides a clean, auditable way to manage software, reducing system clutter and dependency headaches. With Brew, you can install tools like wget, node, python, or Git with simple commands, handle dependencies automatically, and keep everything updated from a single point. It also helps maintain a stable Mac environment by avoiding manual builds that spread files across system directories. Understanding the core concepts—formulae, taps, and the Homebrew prefix—reduces friction when you’re expanding your toolkit. If you’re a homeowner or DIY enthusiast tackling installation tasks at the command line, mac install brew is a foundational workflow that saves time and prevents conflicts. This guide walks you through the practical steps to get up and running smoothly.
Tools & Materials
- Mac computer running macOS(Any supported Mac model. Ensure you have admin access.)
- Active internet connection(Stable connection for downloading scripts and formulae.)
- Terminal application(Preinstalled on macOS; alternative terminals allowed.)
- Admin password(Needed to authorize installations.)
- Xcode command line tools(Will provide compilers and utilities (git, make, etc.). If not installed automatically, run xcode-select --install.)
- Optional: iTerm2 or another terminal(Optional for a customized terminal experience.)
Steps
Estimated time: 20-40 minutes
- 1
Install Xcode Command Line Tools
Open Terminal and run xcode-select --install. Follow the prompts to complete installation; this step provides essential build tools used by Brew and many formulae. If a prompt asks to install additional components, approve them to ensure full tool availability.
Tip: If the dialog doesn’t appear, try running xcode-select --install again or install via the Apple Developer site. - 2
Run the Homebrew installer
In Terminal, paste the official installer command: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". The script will explain what it plans to do and ask for your password to proceed. Allow it to run without interruption; this step installs Brew to the proper prefix for your architecture.
Tip: Watch for prompts about the install path; on Apple Silicon, Brew may install to /opt/homebrew by default. - 3
Follow on-screen prompts to complete setup
The installer will clone the Homebrew repository and set up directories. You may be asked to confirm your user account, provide your password, and adjust shell configuration. Wait for the process to finish before moving on to PATH adjustments.
Tip: If you see a PS1 prompt change, it indicates the shell environment is being updated. - 4
Add Homebrew to your shell PATH
On Apple Silicon, add Brew to PATH with the recommended shellenv command and update your profile (e.g., echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile). On Intel Macs, this is typically handled automatically but verify with brew --version after configuration.
Tip: Restart your Terminal or run source ~/.zprofile after updating profiles. - 5
Verify your installation with brew doctor
Run brew doctor to check for potential issues. Address any warnings or errors it flags to prevent later problems with package builds.
Tip: Fix warnings one by one; brew doctor will guide you toward clean state conditions. - 6
Update and upgrade regularly
Use brew update to refresh the list of formulae, then brew upgrade to install newer versions of packages. This keeps your tools current and reduces security or compatibility risks.
Tip: Consider running brew cleanup occasionally to reclaim disk space. - 7
Install a test package to validate
Try installing a common utility, such as wget, node, or git, to confirm the installation flow works end-to-end. If installation succeeds, your Brew setup is healthy and ready for routine use.
Tip: Choose a small, widely-used package for quick validation. - 8
Maintain your Brew setup
Periodically run brew update, brew upgrade, and brew cleanup. Review Brew’s output for deprecations or changes in formula requirements, and adjust your workflow accordingly.
Tip: Set a monthly reminder to review your Brew environment.
Got Questions?
What is Homebrew and why use it on Mac?
Homebrew is a macOS package manager that simplifies installing and updating open-source software via the terminal. It helps keep tools organized, reduces manual builds, and makes installing dependencies reliable and repeatable.
Homebrew is a package manager for Mac that makes it easy to install and manage software from the terminal.
Do I need Xcode to install Brew?
While you don’t need the full Xcode IDE, you do need the Xcode Command Line Tools. These tools supply compilers and utilities Brew relies on. Installing them first prevents later build failures.
Yes, install the Xcode Command Line Tools first for Brew to work properly.
How do I update Brew and its packages?
Run brew update to refresh the formulae list, then brew upgrade to install newer package versions. Periodic cleanup with brew cleanup frees disk space and tidies caches.
Use brew update and brew upgrade to keep everything current.
What if brew doctor flags issues?
Follow the guidance shown by brew doctor to fix configuration or environment problems. Address warnings and rerun brew doctor until you reach a clean bill of health.
If brew doctor flags issues, fix them one by one and recheck.
Can Brew be used on Apple Silicon vs Intel?
Yes. Brew adapts to both architectures; Apple Silicon uses /opt/homebrew by default, while Intel Macs use /usr/local. Commands generally remain the same, with path considerations as noted.
Brew supports both architectures; just watch the install path.
How do I uninstall Homebrew if needed?
To remove Brew, run the official uninstall script provided by Homebrew, which cleans up the installed files and directories. You may need to remove the brew-related lines from your shell profile.
If you ever need to remove Brew, use the official uninstall steps and clean up your profile.
Watch Video
Main Points
- Install Xcode command line tools first
- Run the official Homebrew installer script
- Add Brew to PATH and verify with brew doctor
- Regularly update, upgrade, and clean up formulae

