Homebrew commands

Install Homebrew, keep apps and tools up to date, clean up old versions and back up everything you have installed.

8 commands

Install Homebrew

macOSLinuxCareful

The official one-line installer from brew.sh.

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

Runs a script from the internet with your permissions. This is Homebrew’s official installer.

Update everything

macOSLinux

Refreshes Homebrew and upgrades all installed formulae and casks.

brew update && brew upgrade

Free space from old versions

macOSLinux

Removes old versions and the entire download cache.

brew cleanup --prune=all

Install a Mac app

macOS

Installs a GUI app. Search names with brew search.

brew install --cask

What’s installed

macOSLinux

All installed formulae and casks.

brew list

Diagnose problems

macOSLinux

Checks your setup and explains how to fix issues.

brew doctor

Run a background service

macOSLinux

Starts a database or server and keeps it running at login.

brew services start

Back up your installed apps

macOSLinux

Saves everything installed to a Brewfile. Restore on a new Mac with brew bundle --file=~/Brewfile.

brew bundle dump --file=~/Brewfile

Every command copies as plain, clean text: no curly quotes, no long dashes, no invisible characters.

Related guides