Homebrew is a popular open-source package manager for macOS, Linux, and Windows via WSL. It gives you a simple command-line interface for downloading, installing, and updating command-line tools and desktop applications from one unified place.
In this guide, you’ll learn Homebrew’s core features, how to use it effectively, and how to streamline software management on your Mac or Linux/WSL development environment.
Prerequisites
Before getting started with Homebrew, you’ll need a supported system:
- macOS: A Mac running macOS 11 (Big Sur) or later. Homebrew will prompt you to install the Xcode Command Line Tools if they’re not already present.
- Linux: A modern 64-bit Linux distribution (such as Ubuntu, Debian, Fedora, or similar) with a standard user account that can use
sudo. - Windows (WSL): Windows 10 or 11 with WSL2 enabled and a Linux distribution installed (for example, Ubuntu on WSL).
Homebrew’s installer will guide you through any missing dependencies on your platform as you set it up.
Why use Homebrew?
Homebrew transforms how you manage software on macOS in meaningful ways:
It eliminates the need to hunt down installers from various websites and deal with different installation processes.
It keeps all your command-line tools and applications updated through a single command.
It tracks dependencies automatically, installing everything a program needs to run properly.
It installs software in isolated locations, keeping your system clean and avoiding conflicts with macOS system files.
Imagine having a central hub for all your developer tools instead of downloading installers one by one. That's what Homebrew provides. It brings order to software installation and makes updates painless.
Throughout this guide, you'll see how Homebrew can make maintaining your development environment faster and more reliable.
Installing Homebrew
Now that you understand what Homebrew does and why it's valuable, let's get it running on your Mac.
Homebrew doesn't come pre-installed on macOS, but setting it up takes just one command. The installation script handles everything automatically, including installing the Xcode Command Line Tools if you don't have them yet.
Open your Terminal application and paste this command:
The installer will explain what it's about to do and ask for your password to proceed. This is normal—Homebrew needs administrative access to create its directories.
During installation, you'll see progress messages as it downloads files and sets up directories. The whole process usually takes a few minutes depending on your internet speed.
Once it finishes, you might need to add Homebrew to your PATH. The installer will show you the exact commands to run if this step is necessary. They'll look something like this:
To confirm everything installed correctly, check the version:
Perfect! Homebrew is now ready to use on your system.
Getting started with Homebrew
Now let's explore how Homebrew operates. It makes installing and managing software straightforward through simple commands.
The most common task is installing packages (called "formulae" in Homebrew terminology). Let's install a useful tool like wget:
This single command handles everything—downloading the software, checking dependencies, and installing it in the right location. You'll see output showing the progress:
To verify it worked, try running the tool:
You can install multiple packages in one command:
Homebrew also handles desktop applications through something called "casks". Install popular apps like this:
This installs the full application just like downloading a DMG file and dragging it to your Applications folder, but faster and cleaner.
Want to see what you've installed? Use:
For casks specifically:
Need to find a package? Search Homebrew's repository:
To get details about a package before installing:
This shows the version, dependencies, installation location, and other useful information.
You can see how Homebrew consolidates software management into a consistent, predictable workflow. No more searching for download links or running different installers for each program.
Managing packages with Homebrew
Let's look at how Homebrew helps you maintain your installed software over time.
Keeping software updated is crucial for security and features. Homebrew makes this simple with two commands. First, update Homebrew itself and get the latest package information:
This refreshes Homebrew's database of available software and versions. You'll see which formulae have updates available.
Then upgrade your installed packages:
This updates everything at once. If you only want to update specific packages:
Homebrew stores old versions of packages in case you need to roll back. These take up disk space over time. Clean them up with:
This removes outdated versions while keeping your current installations intact. To see how much space you'll free up first:
Sometimes you'll want to remove packages you no longer need:
This removes the package but leaves its dependencies. To remove dependencies that nothing else uses:
Want to see which packages have updates available without installing them?
To understand what a package depends on:
You can also see which packages depend on a specific package:
This shows everything that needs openssl@3 to run.
If something breaks, Homebrew can diagnose issues:
This checks your installation and suggests fixes for any problems it finds.
For packages that have been upgraded and you want the old version back:
This shows all versions Homebrew has downloaded. You can then switch versions if needed.
These maintenance commands keep your system clean and your software current without manual tracking or multiple update mechanisms.
Desktop applications with Homebrew Cask
Beyond command-line tools, Homebrew manages full desktop applications through its Cask system. This extends Homebrew's convenience to the graphical programs you use every day.
Installing applications through casks offers real advantages:
- All your software updates happen in one place using the same commands
- Applications install without the usual drag-and-drop or installation wizards
- You can script and automate setting up new machines with all your preferred applications
Installing a cask works just like installing a formula, with the --cask flag:
The application appears in your Applications folder ready to use. Install your entire development environment in one go:
This installs five applications with a single command—much faster than visiting five websites and running five installers.
Update all your cask applications the same way you update command-line tools:
Or update a specific application:
Search for available applications:
Get information about an application before installing:
Remove applications you no longer need:
This removes the application cleanly, including moving it to your Trash.
For teams setting up consistent development environments, you can create a script with all your required installations:
Run this script on a new machine and it installs everything automatically. This makes onboarding new team members or setting up a fresh Mac much faster.
Not every application is available as a cask—some software vendors don't support this distribution method. But the Homebrew Cask repository has thousands of popular applications, covering most development and productivity tools.
Using casks alongside formulae gives you unified software management across your entire system, from command-line utilities to graphical applications.
Final thoughts
This article covered Homebrew's essential features to help you take control of software management on macOS. With Homebrew, you can install, update, and maintain both command-line tools and desktop applications through a consistent, efficient interface.
To learn more advanced features and customization options, visit the official Homebrew documentation.
Thanks for reading!