How to install Homebrew on macOS, Linux and WSL

Homebrew is the missing package manager for macOS and Linux. Install it by running the official installer in your terminal:

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

Add Homebrew to your PATH

On Apple Silicon Macs (M1, M2, M3, M4) Homebrew lives in /opt/homebrew:

eval "$(/opt/homebrew/bin/brew shellenv)"

On Linux and Windows Subsystem for Linux (WSL) it lives in /home/linuxbrew/.linuxbrew:

eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

Essential brew commands

  • brew install wget — install a formula (command-line tool)
  • brew install --cask firefox — install a cask (macOS app)
  • brew update and brew upgrade — update Homebrew and upgrade installed packages
  • brew search <name> — search packages
  • brew uninstall <name> — remove a package
  • brew doctor — diagnose problems with your Homebrew install

Explore BrewLens

  • BrewLens home — trending Homebrew apps
  • Browse all Homebrew casks
  • Browse all Homebrew formulae
  • How to install Homebrew
  • Homebrew install analytics
  • About BrewLens