Home·Terminal commands

brew install

Packages and runtimes

Usage

brew install [--cask] <formula>

Installs a prebuilt bottle on macOS and Linux; GUI applications need --cask, and moving to a newer version is the job of brew update and brew upgrade, not of install.

Common flags

FlagMeaning
--caskinstall a GUI application instead of a formula
--formulaforce the formula when a cask has the same name
--HEADbuild from the latest source instead of a release
--build-from-sourcecompile locally instead of using the bottle

Examples

brew install ripgrep

installs a prebuilt bottle in seconds

brew install --cask visual-studio-code

installs an app into /Applications

brew install node@22

a versioned formula, keg-only until you brew link it

The question is always what goes where: inside this project, or on the whole machine.

How to read this

  • Square brackets [ ] mark a part you may leave out.
  • An ellipsis … means you can list more than one.
  • Flags are case-sensitive — in some commands -r and -R do different things.

Questions

Q. What does brew install do?

Installs a prebuilt bottle on macOS and Linux; GUI applications need --cask, and moving to a newer version is the job of brew update and brew upgrade, not of install.

Q. How do I type it?

brew install [--cask] <formula> — square brackets mark the parts you can leave out.

Q. How many flags are worth knowing?

4 are listed here; the full set is in man brew. This command sits under Packages and runtimes.

Related commands

man page: man brew-install