macOSHomebrew

Homebrew Guide: A Package Manager for Developers and Everyday Users

Learn when to use Homebrew formulae, when to use casks, which daily commands matter most, and how Brewfile or brew services make a Mac setup easier to repeat.

·Updated ·11 min·Counting...
Homebrew Guide: A Package Manager for Developers and Everyday Users

Homebrew is the package manager most Mac developers install first, but it is also useful for everyday users who want repeatable software installs. The practical model is simple: use formulae for CLI tools and libraries, use casks for Mac apps, and use a Brewfile if you want to recreate the same setup later.

1. What is Homebrew?

Homebrew is a package manager built around one core idea: make missing things simple. Through a command-line interface, it helps you install, manage, update, and remove software packages and tools with very little friction. Whether you are setting up a development environment or just managing useful apps, Homebrew makes the process cleaner.


2. Installing Homebrew

2.1 Requirements

  • macOS: macOS 10.14 or newer
  • Linux: major distributions are supported; install basic development tools such as gcc and curl first

2.2 Installation steps

  1. Open Terminal.
  2. Run the following command:
COMMAND
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Follow the prompts and enter your password when needed.
  2. Configure environment variables if required. In many cases this is done automatically.

Verify the installation:

COMMAND
brew --version

If you see a version number, Homebrew is installed correctly.

The official Homebrew site still publishes the same install command and documents the default install locations such as /opt/homebrew on Apple Silicon Macs.


3. Basic commands

CommandWhat it does
brew install <package>install a package
brew uninstall <package>uninstall a package
brew search <keyword>search for packages
brew listlist installed packages
brew info <package>show package details
brew updateupdate Homebrew itself
brew upgradeupgrade installed packages
brew cleanupremove old versions and cache files
brew doctordiagnose common Homebrew issues

4. Installing and managing packages

4.1 Install a package

COMMAND
brew install wget

In this example, Homebrew installs wget, along with any dependencies it needs.

4.2 View package information

COMMAND
brew info wget

This shows the package version, installation path, and dependency details.

4.3 Uninstall a package

COMMAND
brew uninstall wget

This removes the package and cleans up its associated files.


5. Managing GUI apps with Homebrew Cask

Homebrew is not only for developer tools and command-line utilities. Through Homebrew Cask, it can also manage macOS GUI apps such as Google Chrome, Visual Studio Code, and Spotify. It makes installing and removing desktop apps as simple as a command.


5.1 What is Homebrew Cask?

Homebrew Cask is a Homebrew extension used to install and manage GUI apps on macOS. It installs apps directly into /Applications, so you use them just like normally installed apps.

Typical examples include:

  • Browsers: Google Chrome, Firefox
  • Developer tools: Visual Studio Code, Postman
  • Media apps: VLC, Spotify

5.2 Install GUI apps

Use the following command:

COMMAND
brew install --cask <app-name>

Example:

COMMAND
brew install --cask google-chrome

5.3 Search for GUI apps

COMMAND
brew search --cask <keyword>

Example:

COMMAND
brew search --cask chrome

5.4 Uninstall GUI apps

COMMAND
brew uninstall --cask <app-name>

Example:

COMMAND
brew uninstall --cask google-chrome

5.5 Why Homebrew Cask is useful

  1. Apps go directly into /Applications

    • They behave just like apps installed through the usual drag-and-drop workflow.
  2. It is faster

    • You do not need to visit websites and download DMG files manually.
  3. Dependency management

    • If an app requires supporting libraries or tools, Homebrew handles them.
  4. Unified upgrades

    • brew upgrade updates both command-line tools and GUI apps installed through Homebrew.

CategoryApps
Browsersgoogle-chrome, firefox
Developer toolsvisual-studio-code, postman, iterm2
Media toolsvlc, spotify
Communicationslack, zoom
Utilitiesalfred, rectangle

Example installs:

TERMINAL · ZSH
brew install --cask vlc
brew install --cask visual-studio-code
brew install --cask rectangle

If you are using this as part of a full Mac onboarding flow, pair it with New Mac? Go from Zero to a Full Dev Setup in 30 Minutes.


5.7 Listing and updating Cask apps

List installed GUI apps:

COMMAND
brew list --cask

Update everything installed through Homebrew and Cask:

COMMAND
brew update && brew upgrade

Clean old versions and cached files:

COMMAND
brew cleanup

View detailed information about a Cask app:

COMMAND
brew info --cask google-chrome

That shows the install path, version, and whether auto-update is supported.


6. Common Homebrew Cask questions

6.1 Can I install older GUI app versions?

Homebrew Cask does not directly support old GUI versions in the normal flow. If you need one, you usually have to locate an older cask definition manually.

6.2 What if a Cask app fails to install?

Possible causes include network issues or upstream changes.

  • Try updating Homebrew:
COMMAND
brew update
  • Then inspect the error output and follow the relevant fix.

6.3 Where can I browse all supported GUI apps?

See the official Homebrew Cask catalog:
https://formulae.brew.sh/cask/


7. Service management with Homebrew Services

With brew services, you can start, stop, and restart background services such as databases and web servers.

Start a service:

COMMAND
brew services start mysql

Stop a service:

COMMAND
brew services stop mysql

List service status:

COMMAND
brew services list

8. Common issues and fixes

8.1 Permission issues

If you run into permission errors during installation, you may need to change the ownership of the install directory:

COMMAND
sudo chown -R $(whoami):admin /usr/local

8.2 Disk cleanup

Over time, Homebrew accumulates old cache files. Free space with:

COMMAND
brew cleanup

8.3 Installing a specific version

Some packages support versioned formulas:

COMMAND
brew install <package>@<version>

Example:

COMMAND
brew install python@3.9

9. Advanced tips

9.1 Custom install prefix

Homebrew usually installs into /usr/local or /opt/homebrew. If you need a custom location, you can work with the HOMEBREW_PREFIX environment variable.

9.2 Add custom taps

If the official repositories do not include the software you need, add a community tap:

COMMAND
brew tap <repo-name/repo-url>

10. Typical use cases

  • Developers: set up Node.js, Python, Git, Docker, and other tooling
  • Everyday users: quickly install apps such as VLC or Chrome
  • System administrators: manage services such as MySQL and Redis

11. Final thoughts

Homebrew makes software management on macOS and Linux much easier, especially if you care about speed and consistency. If you have never used it before, it is absolutely worth trying.

References:

If this guide helped, keep exploring. Homebrew becomes more valuable the more of your setup you standardize around it.

Subscribe to FreeMac

Weekly picks: free Mac software reviews, trusted source updates, alternatives, and low-friction guides.