How to install Homebrew on Mac M1, M2, M3 (2024 Updated)

Written By Ankur Reviewed By How-to Mac 14 Min Read

Key Takeaways

  • Homebrew is a package manager for Mac that aims to simplify the process of updating, installing, and uninstalling software.
  • Homebrew works on all Macs running macOS Big Sur and later.
  • Installation of Homebrew on Mac involves 5 stages – installing Xcode, adding command line tools for Xcode, obtaining Homebrew from Github, configuring a system path for Homebrew, and finally, verifying the installation.

Homebrew is an open-source package manager for macOS that offers an easy way to install software and tolls through the command line. If you are a coder, developer, Terminal lover, or more tech-savvy than an average Mac user, you can use Homebrew to simplify software installation on your Mac.

Homebrew lets you use commands to download and install Python, Ruby, MongoDB, PHP, Git, Node.js, cask, colordiff, Nmap, and other Unix command-line utilities. In this guide, I’ll show you how to install Homebrew in macOS.

What is Homebrew on Mac?

Homebrew is an open-source package manager for Mac. You can use Homebrew to quickly find, install, and manage numerous command-line utilities and apps on your Mac. However, as per its developers, “Homebrew is a software that installs the stuff you need, but Apple didn’t.”

Homebrew offers a vast collection of software packages that are easy to install, update, and uninstall using simple Terminal commands. This makes it ideal for those who need to frequently install software without any hassle. 

With Homebrew’s command-line interface, you can quickly install several developer tools like Python or open-source apps like Chromium-based web browsers that you use daily. It’s designed to be flexible, allowing you to completely customize the installation process to suit your specific needs.

Benefits of using Homebrew

  • You can save a lot of time by using Homebrew. It automates downloading, compiling, and installing apps. It eliminates the requirement to hunt down software installers and manually run installation procedures.
  • Homebrew is easy to install and set up. You’re only required to execute a few simple commands in Terminal.
  • Homebrew is an open-source tool that offers a centralized repository of software packages, making it easy to find the software you need.
  • With Homebrew, you can easily choose which version of a particular software package you want to install and customize the installation.
  • The program is designed to be secure and doesn’t require root access to install the software. This helps to eliminate security vulnerabilities.

Requirements to use Homebrew on Mac

Before we deep dive into the details of installing Homebrew on Mac, let’s make sure your Mac matches the basic prerequisites for running the tool:

  • CPU/Chipset: M1/M2/M3 series Apple Silicon or 64-bit Intel
  • Operating System: macOS Big Sur 11 or later
  • Command Line Tools (CLT): Xcode, Terminal
  • Shell: Any Bourne-compatible shell like Bash, zsh, fish, etc.

How to install Homebrew on macOS

Homebrew relies on several dependencies to work, so you must download each one of them. After that, you’ll have to fetch Homebrew from its GitHub repository.

Here’s the detailed five-stage process for installing Homebrew on Mac running,

1. Install Xcode from App Store

Xcode is a native Integrated Development Environment (IDE) in macOS that provides a set of tools that developers can use to create software and build complex development systems, like compilers and debuggers.

Because Homebrew relies on Xcode, you must download it from the App Store.

Note: It’s not mandatory to download Xcode to install Homebrew on a Mac. However, I still recommend doing so to ensure a smoother user experience.

  1. Launch the App Store → Search for Xcode → Click Get.

    download xcode
  2. Once the download finishes, open Xcode → Click Install.
  3. Then, click Continue to complete the installation.

You might be asked to pick the platform you’d like to develop for. You must choose macOS.

2. Install command line tools for Xcode

Once you install Xcode on your Mac, you also need to install command line tools for Xcode. These tools allow your Mac to accommodate some of the Homebrew package components.

  1. Open Terminal on your Mac using Launchpad or Spotlight search.
    You can also open Terminal from Finder → Applications → Utilities.
  2. Type xcode-select --install in the Terminal  Hit return.

    install xcode command line tools
  3. When a prompt appears, click Install.

    click on install
  4. Go through the License Agreement, then click Agree.

    click on agree
  5. If the Mac is not connected to power, you’ll be prompted to do so. You may click Continue on Battery Power If your Mac’s battery is at 50%.

    click continue on battery power
  6. Once the Xcode command line tools are downloaded and installed, click Done.

    click done

3. Get Homebrew from its GitHub repository

Once you have Xcode and command line tools for Xcode ready, you can use the Terminal on your Mac to fetch Homebrew from its official GitHub repository.

While there are various Homebrew forks available out there, I’d highly recommend installing the original one to ensure maximum compatibility.

  1. Open Terminal on your Mac.
  2. Paste the below command into the Terminal window → Press return.
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. Now, enter your Mac’s password → Then, hit return to continue.
    Note: You can’t see the password as it’s typed, but it gets recorded in the background.

    install homebrew
  4. Hit return key again to continue.
  5. After running a few commands, your screen will display an Installation successful message.

    homebrew installation completion

4. Add Homebrew path

It’s necessary to add Homebrew to your Mac’s system path once you finish installing it. Adding Homebrew to the system path makes finding, installing, using, and managing software packages easier.

If you wish to skip this, you can still use Homebrew without doing this, you’ll need to specify Homebrew’s installation directory every time you access it via the Terminal. But why would you engage in the hassle, adding a system path makes lives easier.

  1. Open Terminal on your Mac.
  2. Paste the given commands one by one and hit return after each one.
    • cd /opt/homebrew/bin/
    • ls
    • PATH=$PATH:/opt/homebrew/bin
    • cd
    • touch .zshrc
    • echo export PATH=$PATH:/opt/homebrew/bin -> .zshrc
    • brew doctor

      set homebrew path
  3. After entering these commands, you’ll see a message that says “Your system is ready to brew.”

That’s it! You can verify if Homebrew has been installed correctly and get moving!

5. Verify if Homebrew is installed correctly

After you finish installing Homebrew on your Mac, it’s recommended that you verify if Homebrew is installed correctly. Here’s how you can do this:

  1. Open Terminal on your Mac.
  2. Type brew -v into the Terminal window → Press Return.
    If Homebrew is installed correctly, you’ll see a version number for it.

    check brew version
  3. In case the last command didn’t work, type brew doctor → Hit Return.
    This command will scan the Homebrew installation for potential errors.

    fix homebrew errors

If you see brew -v and the Homebrew version, it means Homebrew has been installed properly. If you see the second error message, just follow the instructions and repeat the process.

How to install packages with Homebrew

This is where all the hard work comes to fruition. Once Homebrew is successfully installed on your Mac, you may follow the steps provided below to quickly find and install the apps of your choice.

  1. Open Terminal on your Mac.
  2. Type brew search (SearchTerm) into the Terminal window.
    You must replace (SearchTerm) with the package you’re looking for. Here, I have gone with Firefox.

    homebrew search package
  3. Type brew info (PackageName) to retrieve details about a package.
    You must replace (PackageName) with the name of the package.

    find homebrew package informantion
  4. Type brew install (PackageName) into the Terminal window.
    You must replace (PackageName) with the name of the package. In my case, I’m installing the Firefox browser, so I’ve typed firefox.

    installing packages with homebrew

After you install a software using Homebrew, it will automatically show up in the Launchpad. But If you want to access the downloaded packages (known as casks), you can find them under /opt/homebrew/caskroom in Finder.

How to uninstall packages with Homebrew

If you want to uninstall or delete specific packages or apps on your Mac, you can effortlessly do so by executing the following Homebrew command.

  1. Open Terminal on your Mac.
  2. Type brew list into the Terminal windows → Then press return.
    This command will list down all the apps you installed via Homebrew.

    homebrew list apps
  3. Type brew uninstall (PackageName) into the Terminal window.
    You must replace (PackageName) with the name of the package. In our case, we’re removing the Firefox browser, so we’ve typed Firefox.

    uninstalling packages with homebrew

How to turn off Homebrew analytics

Homebrew, while open-source, collects and shares analytical data with the developers to help them improve the tool. As a result, if you don’t want to contribute and share your data, you may turn off Homebrew analytics.

Remember that this step is optional, but I recommend you follow the steps given below and turn off analytics to keep your data safe and secure.

  1. Open Terminal on your Mac.
  2. Type brew analytics off into the Terminal window Press Return.

    disable homebrew analytics

How to update apps with Homebrew

Besides installing an uninstalling software package, Homebrew also offers a convenient way to keep your apps updated. Here’s how you can do this:

  1. Open Terminal on your Mac.
  2. Type brew outdated into the Terminal window → Then, press return.
    This command will list down all the apps that need to be updated.
  3. Type brew upgrade (PackageName) into the Terminal → Press return.
    You must replace (PackageName) with the name of the package.

    update apps with homebrew

The steps above can help you update individual apps. However, if you want to update all apps at once, you may type brew upgrade → Then hit return.

How to update Homebrew on Mac

Like any other app on your Mac, Homebrew also receives periodic updates with new features and refinements. Here’s how you can update Homebrew:

  1. Open Terminal on your Mac.
  2. Type brew update into the Terminal window Press Return.

    update homebrew

How to uninstall Homebrew on Mac

If you didn’t find Homebrew useful and want to remove it from your Mac, you may do so easily by following the quick instructions outlined below.

  1. Open Terminal on your Mac.
  2. Paste the given command into the terminal window → Press Return.
    /bin/bash -c "$(curl fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

    uninstalling homebrew
  3. Type in the Terminal window → Then, press Return.

    type y and press return to uninstall homebrew
  4. Then, enter your Mac’s password.

After that, Homebrew will be uninstalled from your Mac.

Is it necessary to install Homebrew on my Mac?

It’s not essential to install Homebrew on your Mac. However, Homebrew can be a valuable tool if you want to quickly download applications and developer tools on your device without fiddling around in a web browser.

Can I use Homebrew to install apps with a GUI?

Yes, of course. Apart from installing developer tools like git, Homebrew can also be used to install apps with a graphical user interface. But it’s recommended that you install the Homebrew cask to manage GUI applications efficiently.

Where is Homebrew installed on Mac?

Unless specified otherwise during the installation, Homebrew is typically installed at /opt/homebrew (on Apple Silicon Macs) or /usr/local/bin (on Intel Macs).

Is Homebrew available for M2 Mac?

Yes. Homebrew can be installed on all M1/M2/M3 Apple Silicon and Intel Macs that support at least macOS Big Sur or later versions of macOS, such as Ventura and Sonoma.

Wrapping up…

Homebrew offers a seamless way to manage apps on Mac, regardless of whether you’re a developer, sysadmin, or regular user. If you want to install Homebrew on your Mac, the steps outlined in this guide can help. However, if you’re facing any difficulties, please let us know in the comments section.

Also, let us know what you think about Homebrew. Do you see yourself using it regularly, or you wouldn’t go through the hassle?

🗣️ Our site is supported by our readers like you. When you purchase through our links, we earn a small commission. Read Disclaimer.

By Ankur Staff Writer
Follow:
I have been an Apple user for over seven years now. At iGeeksBlog, I love creating how-tos and troubleshooting guides that help people do more with their iPhone, iPad, Mac, AirPods, and Apple Watch. In my free time, I like to watch stand up comedy videos, tech documentaries, news debates, and political speeches.
Leave a comment