Back to Linux guides

Getting Started with Homebrew

Stanley Ulili
Updated on December 11, 2025

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?

Screenshot of Homebrew website homepage

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:

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

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:

 
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

To confirm everything installed correctly, check the version:

 
brew --version
Output
Homebrew 4.4.11

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:

 
brew install 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:

Output
==> Downloading wget...
==> Pouring wget--1.24.5.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/wget/1.24.5: 90 files, 4.3MB

To verify it worked, try running the tool:

 
wget --version
Output
GNU Wget 1.24.5 built on darwin23.0.0.

You can install multiple packages in one command:

 
brew install git node python

Homebrew also handles desktop applications through something called "casks". Install popular apps like this:

 
brew install --cask visual-studio-code
 
brew install --cask firefox

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:

 
brew list
Output
wget
git
node
python@3.13

For casks specifically:

 
brew list --cask
Output
visual-studio-code
firefox

Need to find a package? Search Homebrew's repository:

 
brew search postgresql
Output
==> Formulae
postgresql@14    postgresql@15    postgresql@16    postgresql@17

To get details about a package before installing:

 
brew info wget

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:

 
brew update

This refreshes Homebrew's database of available software and versions. You'll see which formulae have updates available.

Then upgrade your installed packages:

 
brew upgrade

This updates everything at once. If you only want to update specific packages:

 
brew upgrade wget

Homebrew stores old versions of packages in case you need to roll back. These take up disk space over time. Clean them up with:

 
brew cleanup

This removes outdated versions while keeping your current installations intact. To see how much space you'll free up first:

 
brew cleanup -n

Sometimes you'll want to remove packages you no longer need:

 
brew uninstall node

This removes the package but leaves its dependencies. To remove dependencies that nothing else uses:

 
brew autoremove

Want to see which packages have updates available without installing them?

 
brew outdated
Output
git (2.45.0) < 2.47.1
python@3.13 (3.13.0) < 3.13.1

To understand what a package depends on:

 
brew deps wget
Output
gettext
libidn2
libunistring
openssl@3

You can also see which packages depend on a specific package:

 
brew uses --installed openssl@3

This shows everything that needs openssl@3 to run.

If something breaks, Homebrew can diagnose issues:

 
brew doctor

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:

 
brew list --versions wget

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:

 
brew install --cask google-chrome

The application appears in your Applications folder ready to use. Install your entire development environment in one go:

 
brew install --cask visual-studio-code iterm2 docker postman slack

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:

 
brew upgrade --cask

Or update a specific application:

 
brew upgrade --cask firefox

Search for available applications:

 
brew search --cask chrome
Output
==> Casks
chrome-devtools        google-chrome        mkchromecast

Get information about an application before installing:

 
brew info --cask visual-studio-code
Output
visual-studio-code: 1.96.2
https://code.visualstudio.com/
/opt/homebrew/Cask/visual-studio-code (3 files, 2.5GB)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/v/visual-studio-code.rb
==> Name
Microsoft Visual Studio Code

Remove applications you no longer need:

 
brew uninstall --cask slack

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:

setup.sh
#!/bin/bash

# Development tools
brew install --cask visual-studio-code
brew install --cask iterm2
brew install --cask docker

# Communication
brew install --cask slack
brew install --cask zoom

# Browsers
brew install --cask google-chrome
brew install --cask firefox

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!

Got an article suggestion? Let us know
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.