Homebrew (brew)
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 updateFetch latest formulae updatesbrew upgradeUpgrade all installed packagesbrew install <package>Install a packagebrew uninstall <package>Remove a packagebrew listList installed packagesbrew search <package>Search for a packagebrew info <package>Show package detailsbrew doctorCheck system for potential issuesbrew cleanupRemove 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 updatebefore installing new software - Use
brew upgraderegularly - Use
brew doctorif 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.