Homebrew (brew) is the most popular package manager for macOS. It simplifies the installation, update, and management of software directly from the terminal. Instead of manually downloading .pkg or .dmg files, developers can install tools using a single command.

Some key benefits of using Homebrew include:

  • Install software directly from terminal
  • Manage dependencies automatically
  • Keep development tools up to date
  • Easily uninstall software without leftovers

Frequently Used Commands

  • brew update Fetch latest formulae updates
  • brew upgrade Upgrade all installed packages
  • brew install <package> Install a package
  • brew uninstall <package> Remove a package
  • brew list List installed packages
  • brew search <package> Search for a package
  • brew info <package> Show package details
  • brew doctor Check system for potential issues
  • brew cleanup Remove outdated versions

Installing Homebrew on macOS

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

After installation, verify:

brew –version

If brew is not recognized, add it to your shell configuration:

For Apple Silicon (M1/M2/M3):

echo ‘eval “$(/opt/homebrew/bin/brew shellenv)”’ >> ~/.zshrc
eval$(/opt/homebrew/bin/brew shellenv)

Installing Software Using brew

Example installations:

brew install python
brew install git
brew install wget
brew install node

Installing GUI Applications (Cask)

Homebrew also installs macOS applications using cask.

brew install –cask visual-studio-code
brew install –cask google-chrome
brew install –cask docker

Managing Services

Some software runs as background services.

Start a service:

brew services start 

Stop a service:

brew services stop 

List running services:

brew services list

Best Practices (Industry Standard)

  • Always run brew update before installing new software
  • Use brew upgrade regularly
  • Use brew doctor if facing issues
  • Prefer Homebrew over manual installations for development tools
  • Document installed packages for reproducible environments

Homebrew is essential for maintaining a clean, automated, and professional macOS development setup. It is widely used in industry and is a foundational tool for Python, Node.js, DevOps, and system-level development workflows.