How to Install Homebrew on a Mac

Get this popular package manager for Macs today

If you've ever used Terminal on a Mac, you have probably heard about Homebrew. Installing Homebrew on a Mac is quite simple, and it extends the Mac operating system while also giving Terminal wings to fly. 

What is Homebrew?

Homebrew is the most popular Mac package manager. Packages are bundles of source code created by developers. Some of the files may be programs, support code, and other bits and pieces needed for the software to run. Homebrew installs open-source, command-line tools, and applications like Google Chrome and VLC effortlessly with a single command. You don’t have to worry about unzipping files or installing pieces of software in any order; Homebrew does it all for you. 

Most Mac users are familiar with dragging a DMG file to the Applications folder to install the software. Sometimes, these installs fail because you needed to take additional steps beforehand, but with Homebrew, all the prerequisites are handled automatically in the correct order. 

How to Install Homebrew

To extend the power of your Mac operating system, you'll need to install Homebrew. Homebrew relies on some support from Apple’s Xcode. Therefore, you need to install that, too. Follow the steps below to get started:

  1. Open Terminal from the Applications folder or Launchpad.

  2. Copy and paste the following command into Terminal, then press Return.

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. As part of the install, Homebrew will also install Apple’s Xcode developer software. A pop-up will prompt you to approve this.

  4. Press the Return key to continue.

    Install Homebew on a Mac.
  5. Enter your administrator password, then press Return again.

  6. The Homebrew installation will begin. It may take a few seconds to install completely.

  7. At the end of the text on the Terminal window, you will see the words “Installation successful!”

    Homebrew install successful.

    You will also see information about Homebrew analytics and a link if you want to learn more. You can opt-out of analytics gathering if you want for privacy purposes.

  8. Close the Terminal window.

How to Use Homebrew

Using Homebrew is incredibly easy, with very simple commands. After installing Homebrew, you can run a few quick commands through it to test things.

To use Homebrew, open Terminal, enter the command using lower-case letters, then press Return to execute it. Be aware of spaces and hyphens.

Try running brew doctor to check to see that everything is installed okay, and there aren’t any updates you need to apply. Run brew help to see a list of common commands. 

Helpful Homebrew Apps

Below are some other useful Homebrew commands to try out. In the Terminal window enter the bolded text below, then press the Return key.

  • brew install wget: A tool for downloading from the web and FTP through the command line.
  • brew install htop: A beefed-up Activity Monitor for Terminal that monitors process activity, CPU activity, memory usage, load average, and process management.
  • brew install map: A network security scanner great for security administrators and researchers. Using it, you can find hosts and services on local networks, detect operating systems, software versions, clients, servers, and other network assets. 
  • brew install links: A command-line web browser that will show you all the text on a particular website. 
  • brew install geoip: A tool used to find the geolocation of an IP address. 
  • brew install irssi: A favorite IRC chat client. 
  • brew install watch: A watchdog app that monitors a specific process (IO, disk usage, and other items). Watch is another great tool for network administrators. 

To discover all that you can do with it and review the full documentation, you can visit the official website at brew.sh.