How to Install Brew on Mac: A Step-by-Step Guide

Learn how to install brew on macOS with a safe, step-by-step process. This guide covers prerequisites, Intel and Apple Silicon differences, and troubleshooting tips for Homebrew.

Install Manual
Install Manual Team
·5 min read
Quick AnswerSteps

On macOS, you can install Homebrew by running the official install script in Terminal. Ensure you have a working internet connection and Command Line Tools installed. Whether you use Intel or Apple Silicon, the setup steps are straightforward and include verification and post-install updates. This quick start helps you get brew up quickly and reliably.

Why brew on mac

According to Install Manual, Homebrew simplifies installing open-source software on

What is Homebrew

Homebrew is a free, community-driven package manager for

Prerequisites and system readiness

Before you install Brew, confirm your Mac meets the basic prerequisites. You should have an active internet connection, administrative access to the device, and enough disk space to accommodate the Homebrew cache and installed packages.

Install Command Line Tools (CLT) for

Install Brew on Intel Macs

The process for Intel Macs is straightforward. Start Terminal and prepare the install environment. The official Brew installer will set up the Homebrew directory, typically under /usr/local, and will prompt you to add its bin directory to your PATH if it’s not already present. You’ll be guided through a license agreement and a series of prompts during the download and installation. After the script completes, restart your Terminal or source your shell profile so the new PATH is recognized. Finally, run brew --version to confirm the installation and test a simple package like wget to validate the setup. This path is the most common starting point for older Macs still serving development needs.

Install Brew on Apple Silicon Macs (M1/M2)

Apple Silicon Macs place Homebrew in a different default location, /opt/homebrew, to optimize performance and security. The installer detects the architecture and guides you through the process. After installation, you’ll want to ensure /opt/homebrew/bin is on your PATH for all shells. If you used zsh, add a line to your ~/.zshrc; if you use bash, add it to ~/.bash_profile or ~/.bashrc. The verification steps are the same: run brew --version, brew doctor, then try installing a test package. With Apple Silicon, this separation helps maintain compatibility with older x86_64 bottles while enabling native ARM64 binaries for current software.

Verifying the install and basic usage

Verification starts with confirming Brew’s version, health, and basic environment. Run brew --version to verify the binary is accessible, and brew doctor to let Brew check for common misconfigurations. Update Brew with brew update, and consider upgrading an installed package with brew upgrade. For a practical test, install a widely used utility such as wget or htop to confirm the toolchain and dependencies resolve correctly. This section also covers common post-install tweaks, like configuring mirrors, adjusting the download cache, and ensuring your PATH remains intact after terminal sessions or shell changes. As you gain experience, you’ll rely on Brew to catalyze reproducible setups across devices, which Install Manual highlights as a best practice for home projects and professional tasks.

Maintenance, updates, and common issues

Keeping Brew healthy requires periodic maintenance. Run brew update to fetch the latest package definitions, brew upgrade to apply updates to installed formulae, and brew cleanup to reclaim disk space by removing old versions. Be mindful of conflicts with system-provided utilities or pre-installed apps; Brew aims to coexist by isolating its own directory and using symlinks. If a formula fails to install, check dependencies, verify your CLT installation, and consider running brew doctor for diagnostics. In most cases, issues resolve quickly after a clean update and a retry. Maintaining a tidy Brew environment also includes removing unused formulae with brew uninstall and auditing taps to ensure you’re pulling from trusted sources.

Tools & Materials

  • Mac computer with macOS(macOS Monterey (12) or later recommended; ensure administrative access.)
  • Internet connection(Stable broadband preferred for downloads.)
  • Terminal app(Built-in on macOS; find in /Applications/Utilities.)
  • Xcode Command Line Tools(Install if prompted; can be installed via xcode-select --install.)
  • Text editor (optional)(Helpful for editing PATH in shell profiles.)

Steps

Estimated time: 20-30 minutes

  1. 1

    Open Terminal and verify prerequisites

    Launch Terminal from Applications > Utilities. Check your macOS version and available disk space, then confirm you have admin rights. This step sets the stage for a smooth install and helps you anticipate potential prompts.

    Tip: Use Command+Space to open Spotlight and type Terminal quickly.
  2. 2

    Install Xcode Command Line Tools (if needed)

    If CLT aren’t installed, run a quick command or follow the on-screen prompt from the installer. Verify the toolchain by running which clang and clang --version to ensure a working build environment.

    Tip: If already installed, the system will tell you; you can skip this step safely.
  3. 3

    Run the official Homebrew installer

    Execute the official installer by following the prompts in Terminal. The installer creates the Homebrew directory, configures environment settings, and links binaries so you can run brew commands from any shell.

    Tip: Always install from the official source and review the prompts before proceeding.
  4. 4

    Add Homebrew to your PATH if required

    Depending on your architecture, you may need to add the Brew bin path to your shell profile. Intel typically uses /usr/local/bin, while Apple Silicon uses /opt/homebrew/bin.

    Tip: Edit ~/.zshrc or ~/.bash_profile to persist PATH updates across sessions.
  5. 5

    Restart shell or source profile

    To apply PATH changes, restart the Terminal or run source ~/.zshrc (or source ~/.bash_profile). This ensures brew commands are available immediately.

    Tip: A quick test is to run brew --version after reloading the shell.
  6. 6

    Verify the installation

    Run brew doctor to check for issues, then brew --version to confirm the installation. If needed, run brew update to fetch latest definitions.

    Tip: Address any warnings before installing new formulae for a cleaner setup.
  7. 7

    Install a test package

    Try a common utility such as wget to validate your setup. If installation succeeds, you now have a working Brew environment and can begin adding more formulae.

    Tip: Choose a lightweight package for a quick validation.
Pro Tip: Connect to a secure network when running the installer to avoid tampering.
Warning: Do not copy install scripts from untrusted sources; always use the official Brew install path.
Note: Back up your shell profile before editing PATH for easy rollback.
Pro Tip: Keep Brew up to date with brew update and brew upgrade to maintain security and access to latest features.

Got Questions?

What is Homebrew and why should I use it on mac?

Homebrew is a macOS package manager that automates the installation of software and its dependencies. It helps you manage tools outside the Mac App Store and keeps your environment reproducible.

Homebrew is a package manager for Mac that makes installing command-line tools and utilities easy and repeatable.

Do I need Xcode Command Line Tools to install Brew?

Yes, Brew relies on the Xcode Command Line Tools for compilers and build utilities. If you don’t have them, the installer will prompt you to install them.

Yes, you’ll usually need the Xcode Command Line Tools for Brew to work.

Is Brew safe to run on a Mac?

Yes, when you install from the official script and use formulae from trusted taps, Brew is widely used and considered safe for macOS.

Yes, Brew is trusted when installed from the official source and used with reputable packages.

What should I do if the install script fails?

Check your internet connection, ensure CLT is installed, review any error messages from the installer, and retry after addressing reported issues. Running brew doctor after a failure can help diagnose root causes.

If it fails, read the error, fix prerequisites, and try the install again; run brew doctor for diagnostics.

How do I update Brew after installation?

Use brew update to fetch new package definitions, then brew upgrade to install newer versions. Finally, run brew cleanup to reclaim disk space.

Update Brew with brew update, upgrade installed packages with brew upgrade, and clean up old versions with brew cleanup.

Can I install Brew on both Intel and Apple Silicon with the same steps?

The installer works on both architectures, but the default installation path differs. Intel installs to /usr/local, while Apple Silicon uses /opt/homebrew.

Yes, but the default path differs between Intel and Apple Silicon.

Watch Video

Main Points

  • Install brew on mac to simplify software management.
  • Intel and Apple Silicon require different PATH considerations.
  • Verify installation with brew doctor and brew --version.
  • Update and clean up regularly to maintain performance.
  • Reproduce your setup with careful PATH and environment management.
Process diagram for installing Brew on Mac
Process: Install Brew on Mac

Related Articles