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
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
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
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
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
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"