Managing software on macOS has historically been a fragmented experience. Unlike Linux distributions that come with powerful package managers built into the operating system, macOS relies primarily on the Mac App Store for consumer applications and manual downloads from developer websites for command-line tools and developer utilities. Homebrew fills this gap by providing a comprehensive, community-maintained package manager that allows you to install, update, and remove thousands of command-line tools, developer libraries, programming languages, and even full graphical applications directly from the Terminal. If you write code, manage servers, or work with any kind of development toolchain on a Mac, Homebrew is arguably the first utility you should install.
What Homebrew Actually Does
Homebrew manages software packages (called formulae for command-line tools and casks for graphical applications) by downloading pre-compiled binaries or source code, resolving dependencies automatically, and installing everything into a clean, isolated directory structure. This means:
- You can install complex tools like
ffmpeg,python,node,git, orpostgresqlwith a single command. - All dependencies are handled automatically — if a tool requires a specific library, Homebrew installs it.
- Updates are centralised — one command updates every installed package.
- Uninstallation is clean — Homebrew tracks every file it installs and removes them completely.
- Homebrew does not interfere with macOS system files. It installs everything into
/opt/homebrewon Apple Silicon Macs and/usr/localon Intel Macs.
Prerequisites
Before installing Homebrew, ensure you have:
- macOS 11 (Big Sur) or later — Homebrew supports the latest macOS versions and several prior releases.
- Xcode Command Line Tools — These provide the compilers and headers Homebrew needs to build software from source. If they are not already installed, the Homebrew installer will prompt you to install them automatically.
- An internet connection — Homebrew downloads packages from GitHub and its own binary cache.
- Administrator access — You need to be able to use
sudoduring installation.
How to Install Homebrew
- Open Terminal (you can find it in Applications → Utilities, or search for it with Spotlight using Cmd + Space).
- Paste the following installation command and press Enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- The installer will explain what it plans to do and ask for your password. Enter your macOS user account password (the one you use to log in) and press Enter. The password characters will not appear on screen — this is normal Terminal behaviour.
- If Xcode Command Line Tools are not installed, the installer will download and install them automatically. This may take several minutes depending on your internet speed.
- Once the installation completes, the installer will display important instructions for adding Homebrew to your shell’s PATH. On Apple Silicon Macs, you typically need to run:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
This ensures that the brew command is available in every new Terminal session.
- Verify the installation by running:
brew --version
You should see the Homebrew version number printed in the Terminal.
Installing Your First Package
Homebrew uses simple, memorable commands. To install a package:
brew install <package-name>
For example, to install the popular code editor wget (a command-line file downloader):
brew install wget
Homebrew will download the package, resolve any dependencies, and install everything automatically. Once complete, you can immediately use wget in your Terminal.
Here are several commonly installed packages for developers:
| Package | Command | Purpose |
|---|---|---|
| Git | brew install git | Version control system (newer than the macOS built-in version) |
| Node.js | brew install node | JavaScript runtime for server-side and build tools |
| Python | brew install python | Latest Python 3.x with pip |
| FFmpeg | brew install ffmpeg | Audio/video processing toolkit |
| htop | brew install htop | Interactive process viewer (better than top) |
| jq | brew install jq | Command-line JSON processor |
| tree | brew install tree | Display directory structures as a tree |
| PostgreSQL | brew install postgresql@16 | Relational database server |
Installing Graphical Applications with Homebrew Cask
Homebrew is not limited to command-line tools. The Cask extension allows you to install full macOS graphical applications — the same apps you would normally download from a website and drag into the Applications folder.
brew install --cask <app-name>
Popular cask installs include:
| Application | Command |
|---|---|
| Visual Studio Code | brew install --cask visual-studio-code |
| Google Chrome | brew install --cask google-chrome |
| Firefox | brew install --cask firefox |
| iTerm2 | brew install --cask iterm2 |
| Docker Desktop | brew install --cask docker |
| Slack | brew install --cask slack |
| Notion | brew install --cask notion |
This is significantly faster than manually visiting each developer’s website, downloading the installer, opening the DMG, and dragging the app to the Applications folder.
Updating Installed Packages
One of Homebrew’s greatest strengths is centralised updates. Instead of checking each application individually for updates, run:
brew update
This updates Homebrew’s internal index of available packages. Then:
brew upgrade
This upgrades all installed formulae and casks to their latest versions. To upgrade a specific package only:
brew upgrade <package-name>
To see which of your installed packages have updates available without actually upgrading them:
brew outdated
Removing Packages
To uninstall a package and remove all its files:
brew uninstall <package-name>
After uninstalling, you can clean up any leftover cached downloads and old versions:
brew cleanup
This frees disk space by removing outdated package downloads from the Homebrew cache.
Searching for Packages
To find a package by name or keyword:
brew search <keyword>
For example, brew search video will return all formulae and casks containing the word “video” in their name or description. You can also browse the complete catalogue at formulae.brew.sh.
Listing Installed Packages
To see everything Homebrew has installed on your system:
brew list
To see only formulae (command-line tools):
brew list --formula
To see only casks (graphical applications):
brew list --cask
Diagnosing Homebrew Problems
If something is not working correctly, Homebrew includes a built-in diagnostic tool:
brew doctor
This command checks your Homebrew installation for common issues — such as incorrect PATH configuration, outdated Xcode tools, or permission problems — and suggests fixes. Running brew doctor periodically is good practice, especially after macOS upgrades which can occasionally break developer toolchains.
Uninstalling Homebrew Completely
If you ever need to remove Homebrew and all packages it has installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
This script removes the Homebrew installation directory and all installed packages. Your manually installed macOS applications and system files are not affected.