How to install Homebrew

Page content

Installation

To install Homebrew, open Terminal, install the Command Line Tools for Xcode using the command

% sudo xcode-select --install

and then run the script

% /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

answering the questions that appear on the terminal. Once the installation is complete, it’s always a good idea to run

% brew doctor

to check that the installation process was successful.

Available formulas

The packages available in Homebrew (or rather, the formulas in the program’s terminology) are listed on this page, and can be installed from the Terminal using the command,

% brew install <formula name>

where <formula name> is the name of the formula to be installed. For example, brew install tree installs a (very useful!) program that displays the entire hierarchy of files and folders in a directory using a tree view.

Updates

Every now and then, it’s a good idea to update your installed packages (I do this about once a week) by running these three commands in Terminal,

% brew update
% brew outdated
% brew upgrade

which update the list of packages available in Homebrew (brew update), list the installed packages for which updates are available (brew outdated), and update the installed packages (brew upgrade).

When you run brew update, a list of new formulas available in Homebrew appears, which is useful for discovering interesting new programs. When you find one, just run

% brew home <formula name>

to access the program’s home page using your default browser.

Cask

Homebrew also lets you install and update many of the standard graphical applications available for macOS, such as 1Password, Chrome, or Zoom, from the Terminal. In Homebrew, these applications are referred to as ‘casks’. To do so, use the --cask option followed by the name of the program you wish to install. For example

% brew install --cask audacity

installs Audacity, one of the best audio editors currently available. The complete list of available casks can be found here.

If you prefer, you can use the graphical application Applite to search for, install, and uninstall casks, but in my opinion, that kind of misses the point of using Homebrew.