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 Catalina or M1 Mac.
- Requirements to install Homebrew on Mac
- How to install Homebrew on macOS Catalina or M1 Mac
- Verify Homebrew installation in macOS
- How to use Homebrew to install a package on Mac
- How to update or remove Homebrew from Mac
Requirements to install Homebrew on Mac
- A 64-bit Intel or Apple Silicon M1 CPU
- macOS Mojave (10.14) or later
- Command Line Tools (CLT) for Xcode (steps 1 and 2 below)
Note: Some formulae require full Xcode installation.
- A Bourne-compatible shell for installation (e.g., bash or zsh)
- Administrator access on Mac
- Internet connectivity
For some finer requirement details, please see the official page.
Once you satisfy the above requirements, see how to install Homebrew on macOS.
How to install Homebrew on macOS Catalina or M1 Mac
- Open Terminal and enter this command
- Click Install from the popup. Go through the T&C and click Agree if you do. Let the download complete.
- To install Homebrew, enter the following command in the Terminal.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- You will have to enter your Mac’s password once. After that, the downloading and installation will begin. The total download size is around 400MB. It will take some time.
Verify Homebrew installation in macOS
- Open Terminal and type
- You will see the version of Homebrew installed on your Mac.
brew doctor lets you know about Homebrew status, issues, and updates, if available or required.
Now that you have installed Homebrew, let’s see how to use it.
How to use Homebrew to install a package on Mac
- To see the full list of packages:
- To search a software package:
brew search packagename
- Get information about a package:
brew info packagename
- To download and install:
brew install packagename
For example, if I have to install speedtest-cli, here is how the command looks:
brew install speedtest-cli
After installation, enter speedtest-cli in the Terminal to run this command.
- Pro Tip: You can install not only command-line apps but also GUI (Graphical User Interface) apps via Homebrew. For this, use
brew install --cask app-name. For example,
brew install --cask firefoxor
brew install --cask google-chromeYou can see the full list here.
- To see all the apps installed by Homebrew on your Mac:
Tip: Packages are usually installed in this folder:
In case you do not find this folder, enter
brew --prefixin the Terminal to see the folder location.
- To update the package:
brew update packagename
- For removing an installed package:
brew remove packagename
- To know what else you can do:
How to update or remove Homebrew from your Mac
At times, Homebrew is updated automatically when you run commands. But you can also update it manually by entering
brew update in the Terminal.
In case you no longer need Homebrew, run the following command to uninstall Homebrew and all the installed packages.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Loving the ease and simplicity of Homebrew!
I hope the above guide helped you download, install, and use Homebrew. Once you start using it, there is no going back. Finally, I would like to tell you about four handy command-line programs I love.
Youtube-dl: This lets me download videos from YouTube and other places. More info.
speedtest-cli: I can see my download and upload speed via this. More info.
imagemagick: Lets me convert an image to another format and make simple edits. More info.
wifi-password: This brilliant yet straightforward command shows me the Wi-Fi password of the currently connected network. Super handy!
You will also love to read:
- How to create a free Apple Developer account
- How to open an app from an unidentified developer on Mac
- Why developers prefer Mac?
- How to set an alarm on Mac: 5 Methods explained