Complete Homebrew Guide for Mac Users
Master Homebrew package management on macOS. Learn casks vs formulas, essential commands, and best practices.
Homebrew is the missing package manager for macOS that simplifies software installation on Mac systems. Think of it as an app store for developers and power users, accessible entirely through the command line.
Why use Homebrew?
Homebrew automates installing, updating, and managing packages unavailable in the Mac App Store. It handles dependencies and keeps development tools current.
Benefits
- Easy installation and updates
- Automatic dependency management
- Access to 6,000+ packages
- Command-line simplicity
Perfect for
- Developers and programmers
- System administrators
- Power users
- Anyone needing CLI tools
Get Homebrew up and running on your Mac in just a few steps
System requirements
macOS 10.14 or higher
Xcode Command Line Tools
64-bit Intel or Apple Silicon
processor
Quick install (one command)
This script guides you through the installation process and explains each step.
Post-installation setup
- 1. Add Homebrew to PATH using the commands from the installer.
- 2. Verify Installation by running
brew doctor. - 3. Update Homebrew by running
brew update.
The two main types of packages in Homebrew
| Aspect | Formulas | Casks |
|---|---|---|
| What they install | Command-line tools & libraries | GUI applications |
| Installation location | /usr/local/Cellar or /opt/homebrew | /Applications folder |
| Install command | brew install [name] | brew install --cask [name] |
| Examples | git, node, python, wget | Chrome, Slack, VS Code, Spotify |
| Use case | Development tools and servers | Desktop and productivity apps |
Formulas provide command-line tools and libraries for development workflows.
Popular Development Tools
Database & Services
Common Formula commands
- brew search [text] – Search
- brew info [formula] – Show details
- brew deps [formula] – Show dependencies
- brew uses [formula] – Show dependents
Casks install macOS applications distributed as binaries.
Productivity Apps
Developer Tools
Tip: Use FastBrew to discover Casks visually.
Master these commands to effectively use Homebrew
| Command | Description |
|---|---|
brew install [package] | Install a formula or cask |
brew uninstall [package] | Remove a package |
brew list | List all installed packages |
brew search [text] | Search for packages |
brew info [package] | Display package details |
| Command | Description |
|---|---|
brew update | Update Homebrew and formula definitions |
brew upgrade | Upgrade all outdated packages |
brew outdated | List packages with available updates |
brew cleanup | Remove old versions and clear cache |
brew doctor | Check the system for potential issues |
Recommended: Run maintenance commands weekly.
| Command | Description |
|---|---|
brew tap [user/repo] | Add third-party repositories |
brew services list | List background services |
brew pin [formula] | Prevent a formula from being upgraded |
brew leaves | List formulas not depended on by others |
brew bundle | Install packages from a Brewfile |
Permission Issues
sudo chown -R $(whoami) $(brew --prefix)/* Fix Homebrew directory ownership
Deep Clean
brew cleanup --prune=all Remove cached downloads and old versions
Reset Homebrew
brew update-reset Reset Homebrew to a pristine state
Do
- Run
brew updatebefore installing - Use
brew doctorwhen issues arise - Keep Homebrew updated regularly
- Clean old versions with
brew cleanup - Use casks for GUI applications
Avoid
- Using sudo with brew commands
- Manually deleting formula files
- Ignoring brew doctor warnings
- Mixing Homebrew with other package managers
- Installing duplicates without checking
brew list
Discover and install macOS applications with FastBrew.