Skip to main content
PublishedUpdated

How to Create a Brewfile (2026)

To create a Brewfile, run brew bundle dump to capture your current setup into a file named Brewfile — or write one by hand listing tap/brew/cask lines — then run brew bundle to reinstall everything on any Mac.

  1. 1

    Capture your current setup

    The fastest way to create a Brewfile is to dump what you already have installed. This writes a Brewfile listing every tap, formula, and cask on your Mac.

    brew bundle dump --file=~/Brewfile
  2. 2

    Understand the format

    A Brewfile is plain text. Each line is one entry: tap adds a source, brew installs a CLI tool, cask installs a GUI app, and mas installs a Mac App Store app. Here is a minimal example:

    tap "homebrew/bundle"
    
    brew "git"
    brew "node"
    
    cask "visual-studio-code"
    cask "raycast"
    cask "rectangle"
  3. 3

    Edit it to taste

    Open ~/Brewfile in any editor and add or remove lines. Keep only the apps you actually want on a fresh machine — this file becomes your canonical setup.

  4. 4

    Install everything from it

    On this or any new Mac (with Homebrew installed), run brew bundle to install every entry in one pass.

    brew bundle --file=~/Brewfile
  5. 5

    Version-control it

    Commit your Brewfile to a Git repo (often alongside your dotfiles). Now your entire app setup is reproducible on any Mac in two commands: install Homebrew, then brew bundle.

    git add Brewfile && git commit -m "Add Brewfile"

Frequently Asked Questions

What is a Brewfile?
A Brewfile is a plain-text manifest of your Homebrew taps, formulae (CLI tools), and casks (GUI apps). Running brew bundle installs everything listed in it, so your whole setup is captured in one version-controllable file.
How do I generate a Brewfile from my current Mac?
Run brew bundle dump --file=~/Brewfile. Homebrew writes a Brewfile describing every tap, formula, and cask currently installed. Add --force to overwrite an existing file.
How do I install everything in a Brewfile?
Run brew bundle --file=~/Brewfile. Homebrew installs every entry; lines already installed are skipped, so it is safe to re-run.
Can a Brewfile include Mac App Store apps?
Yes. Install the mas CLI (brew install mas), then add lines like mas "Things 3", id: 904280696. brew bundle will install them via the App Store.