Community Tutorials macOS How to Set Up Homebrew on macOS
How to Set Up Homebrew on macOS
MACOS

How to Set Up Homebrew on macOS

SKYLINE Knowledge Base
Photo by Carl Heyerdahl on Unsplash

A field-tested, step-by-step guide. How to Set Up Homebrew on macOS — prerequisites, the actual commands, verification, and links to related macOS topics.

Homebrew is the de-facto package manager on macOS — Apple ships none of its own. This guide installs Homebrew, explains the Apple-Silicon vs Intel path differences, configures it for shell completion, and shows the daily commands.

Prerequisites

  • macOS 12 Monterey or newer.
  • An admin account.
  • Xcode Command Line Tools (the Homebrew installer triggers this automatically if missing).

Step 1: Install Homebrew

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

The installer prints a one-line shellenv snippet for your shell. Run the lines it prints, then add them to your shell profile so they persist:

For Apple Silicon (arm64) — Homebrew lives at /opt/homebrew:

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

For Intel — Homebrew lives at /usr/local:

echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/usr/local/bin/brew shellenv)"

Step 2: Verify

brew --version
brew doctor

brew doctor lists any environment issues. Fix everything before installing real software.

Step 3: Daily commands

brew update                    # refresh formula list
brew upgrade                   # upgrade everything
brew upgrade git               # upgrade one thing
brew install ripgrep fd jq fzf # the standard dev toolkit
brew search redis              # search names
brew info redis
brew uninstall package-name
brew list                      # what's installed
brew leaves                    # top-level installs (not deps)
brew cleanup                   # reclaim disk

Step 4: Casks for GUI apps

brew install --cask iterm2 visual-studio-code rectangle docker
brew list --cask
brew upgrade --cask

Casks install into /Applications — same place a .dmg drag-and-drop would put them.

Step 5: Services

Homebrew installs background services (PostgreSQL, Redis, Nginx, etc.) without needing launchd plists:

brew install postgresql@16
brew services start postgresql@16
brew services list
brew services stop postgresql@16

Step 6: Brewfile for reproducible setups

Pin your machine's whole package set:

brew bundle dump --file=~/Brewfile
cat ~/Brewfile

# On a new machine:
brew bundle install --file=~/Brewfile

Check that file into a private dotfiles repo and provisioning a new Mac is brew bundle install away.

Verify

brew config           # full environment dump
brew analytics off    # opt out of anonymous stats
brew doctor

Conclusion

Homebrew + a Brewfile is the closest thing macOS has to apt/dnf. Run brew update && brew upgrade weekly and you stay current with no Microsoft-Store-style friction.

Next steps

SKYLINE Engineering

@skyline

The engineering team at SKYLINE Industrial Solutions. We publish field-tested guides drawn from real KSA and GCC deployments.

See author profile
SKYLINE engineering services

Need this implemented for you?

Reading is free — building it right takes a team. SKYLINE engineers ship macOS for Aramco vendors, banks, hospitals and government agencies across Saudi Arabia. Talk to us before you start.

Aramco Approved Contractor ISO 9001 · ISO 27001 SAMA CSF aligned NCA ECC ready 247+ KSA clients

Comments

0 total · 0 threads
Be the first to leave a comment.