Tools: macOS Developer Setup: Essential Homebrew Commands for 2026
macOS Developer Setup: Essential Homebrew Commands for 2026
Why Homebrew?
Installation: The 60-Second Setup
Essential Commands for Daily Use
Searching for Packages
Installing Packages
Managing Your Installation
Diagnosing Problems
Installing GUI Apps with Homebrew Cask
The Developer Stack: One Command to Rule Them All
Reproducible Setups with Brewfile
Creating a Brewfile
Example Brewfile
Using a Brewfile
Store Your Brewfile in Git
Real-World Scenarios
Scenario 1: Onboarding a New Developer
Scenario 2: Resetting a Messy Mac
Scenario 3: CI/CD Environment Setup
Scenario 4: Multiple Python/Node Versions
Q: How do I switch between Python versions?
Q: Can I install multiple Node versions?
Q: How do I update Homebrew itself?
Q: What's the difference between brew install and brew install --cask?
Q: Where does Homebrew install things?
Q: How do I see what would be installed before running?
Common Pitfalls
Permissions Issues
PATH Issues
Cask Conflicts
Conclusion Setting up a new Mac for development used to mean hours of downloading installers, configuring paths, and fighting with dependencies. Not anymore. Homebrew has become the de facto package manager for macOS, and with the right approach, you can have a complete development environment running in under 30 minutes. Whether you're setting up a fresh Mac, onboarding a new team member, or just want a reproducible configuration, this guide covers everything you need. Homebrew (or just "brew") installs packages into their own directories and symlinks them into /opt/homebrew (Apple Silicon) or /usr/local (Intel Macs). This isolation means: For GUI applications, Homebrew Cask extends the same philosophy to apps like VS Code, Docker, and iTerm2. Open Terminal and run: After installation, add Homebrew to your PATH (Apple Silicon Macs): Verify everything works: The brew info command shows version, dependencies, build options, and analytics. Homebrew Cask handles macOS applications—no more dragging .dmg files around: Pro tip: Use brew list --cask to see all installed GUI apps. Here's the full stack most developers need. Create a script or copy-paste: The real power of Homebrew shines with Brewfiles—declarative configurations that let you recreate your entire setup with one command. Now any new machine is three commands away from your perfect setup: Create a team Brewfile in your repo: New team members run: Done. Development environment ready. If your system packages are a mess: For GitHub Actions or other CI: Use pyenv (installed via Homebrew): If you see permission errors: If commands aren't found after install: If a cask install fails due to existing app: Homebrew transforms macOS from a consumer OS into a proper development workstation. With a single brew bundle command, you can recreate your entire environment anywhere—on a new Mac, a colleague's machine, or in CI/CD. Your 30-minute setup is now complete. What will you build? Got a Homebrew tip I missed? Drop a comment below! Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
brew --version
# Homebrew 4.x.x
brew --version
# Homebrew 4.x.x
brew --version
# Homebrew 4.x.x
# Search for a package
brew search python
brew search node # Get info before installing
brew info node
brew info [email protected]
# Search for a package
brew search python
brew search node # Get info before installing
brew info node
brew info [email protected]
# Search for a package
brew search python
brew search node # Get info before installing
brew info node
brew info [email protected]
# Install a package
brew install git
brew install node
brew install [email protected]
brew install go
brew install rust # Install specific versions
brew install node@20
brew install [email protected]
# Install a package
brew install git
brew install node
brew install [email protected]
brew install go
brew install rust # Install specific versions
brew install node@20
brew install [email protected]
# Install a package
brew install git
brew install node
brew install [email protected]
brew install go
brew install rust # Install specific versions
brew install node@20
brew install [email protected]
# List installed packages
brew list # See what's outdated
brew outdated # Upgrade everything
brew upgrade # Upgrade a specific package
brew upgrade node # Uninstall a package
brew uninstall node # Clean up old versions
brew cleanup
# List installed packages
brew list # See what's outdated
brew outdated # Upgrade everything
brew upgrade # Upgrade a specific package
brew upgrade node # Uninstall a package
brew uninstall node # Clean up old versions
brew cleanup
# List installed packages
brew list # See what's outdated
brew outdated # Upgrade everything
brew upgrade # Upgrade a specific package
brew upgrade node # Uninstall a package
brew uninstall node # Clean up old versions
brew cleanup
# Check for issues
brew doctor # This will tell you about:
# - Unlinked kegs
# - Missing dependencies
# - Permission issues
# - Config problems
# Check for issues
brew doctor # This will tell you about:
# - Unlinked kegs
# - Missing dependencies
# - Permission issues
# - Config problems
# Check for issues
brew doctor # This will tell you about:
# - Unlinked kegs
# - Missing dependencies
# - Permission issues
# - Config problems
# Development tools
brew install --cask iterm2
brew install --cask visual-studio-code
brew install --cask docker
brew install --cask postman
brew install --cask rectangle # Window management
brew install --cask appcleaner # Clean uninstall # Browsers
brew install --cask google-chrome
brew install --cask firefox # Communication
brew install --cask slack
brew install --cask discord # Utilities
brew install --cask 1password
brew install --cask caffeine # Keep Mac awake
# Development tools
brew install --cask iterm2
brew install --cask visual-studio-code
brew install --cask docker
brew install --cask postman
brew install --cask rectangle # Window management
brew install --cask appcleaner # Clean uninstall # Browsers
brew install --cask google-chrome
brew install --cask firefox # Communication
brew install --cask slack
brew install --cask discord # Utilities
brew install --cask 1password
brew install --cask caffeine # Keep Mac awake
# Development tools
brew install --cask iterm2
brew install --cask visual-studio-code
brew install --cask docker
brew install --cask postman
brew install --cask rectangle # Window management
brew install --cask appcleaner # Clean uninstall # Browsers
brew install --cask google-chrome
brew install --cask firefox # Communication
brew install --cask slack
brew install --cask discord # Utilities
brew install --cask 1password
brew install --cask caffeine # Keep Mac awake
# Version control & core tools
brew install git gh # Git + GitHub CLI
brew install tree wget jq # Utilities # Languages & runtimes
brew install node # Node.js (LTS by default)
brew install [email protected] # Python 3.12
brew install go # Go
brew install rust # Rust via rustup-init # Databases
brew install postgresql@16
brew install redis
brew install sqlite # Usually pre-installed, but explicit # Containers & orchestration
brew install --cask docker # Docker Desktop
brew install kubectl # Kubernetes CLI
brew install helm # Kubernetes package manager
brew install minikube # Local Kubernetes # Development tools
brew install --cask iterm2 # Better terminal
brew install --cask visual-studio-code # Editor
brew install --cask postman # API testing # Cloud CLIs
brew install awscli # AWS
brew install azure-cli # Azure
brew install google-cloud-sdk # GCP (use cask version)
# Version control & core tools
brew install git gh # Git + GitHub CLI
brew install tree wget jq # Utilities # Languages & runtimes
brew install node # Node.js (LTS by default)
brew install [email protected] # Python 3.12
brew install go # Go
brew install rust # Rust via rustup-init # Databases
brew install postgresql@16
brew install redis
brew install sqlite # Usually pre-installed, but explicit # Containers & orchestration
brew install --cask docker # Docker Desktop
brew install kubectl # Kubernetes CLI
brew install helm # Kubernetes package manager
brew install minikube # Local Kubernetes # Development tools
brew install --cask iterm2 # Better terminal
brew install --cask visual-studio-code # Editor
brew install --cask postman # API testing # Cloud CLIs
brew install awscli # AWS
brew install azure-cli # Azure
brew install google-cloud-sdk # GCP (use cask version)
# Version control & core tools
brew install git gh # Git + GitHub CLI
brew install tree wget jq # Utilities # Languages & runtimes
brew install node # Node.js (LTS by default)
brew install [email protected] # Python 3.12
brew install go # Go
brew install rust # Rust via rustup-init # Databases
brew install postgresql@16
brew install redis
brew install sqlite # Usually pre-installed, but explicit # Containers & orchestration
brew install --cask docker # Docker Desktop
brew install kubectl # Kubernetes CLI
brew install helm # Kubernetes package manager
brew install minikube # Local Kubernetes # Development tools
brew install --cask iterm2 # Better terminal
brew install --cask visual-studio-code # Editor
brew install --cask postman # API testing # Cloud CLIs
brew install awscli # AWS
brew install azure-cli # Azure
brew install google-cloud-sdk # GCP (use cask version)
# Generate from current installation
brew bundle dump # This creates a Brewfile in the current directory
# Generate from current installation
brew bundle dump # This creates a Brewfile in the current directory
# Generate from current installation
brew bundle dump # This creates a Brewfile in the current directory
# Brewfile
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core" # Core tools
brew "git"
brew "gh"
brew "jq"
brew "tree"
brew "wget" # Languages
brew "node"
brew "[email protected]"
brew "go" # Databases
brew "postgresql@16"
brew "redis" # Kubernetes
brew "kubectl"
brew "helm" # GUI Apps
cask "docker"
cask "iterm2"
cask "visual-studio-code"
cask "rectangle"
cask "1password" # Fonts (optional)
cask "font-jetbrains-mono"
cask "font-fira-code"
# Brewfile
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core" # Core tools
brew "git"
brew "gh"
brew "jq"
brew "tree"
brew "wget" # Languages
brew "node"
brew "[email protected]"
brew "go" # Databases
brew "postgresql@16"
brew "redis" # Kubernetes
brew "kubectl"
brew "helm" # GUI Apps
cask "docker"
cask "iterm2"
cask "visual-studio-code"
cask "rectangle"
cask "1password" # Fonts (optional)
cask "font-jetbrains-mono"
cask "font-fira-code"
# Brewfile
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core" # Core tools
brew "git"
brew "gh"
brew "jq"
brew "tree"
brew "wget" # Languages
brew "node"
brew "[email protected]"
brew "go" # Databases
brew "postgresql@16"
brew "redis" # Kubernetes
brew "kubectl"
brew "helm" # GUI Apps
cask "docker"
cask "iterm2"
cask "visual-studio-code"
cask "rectangle"
cask "1password" # Fonts (optional)
cask "font-jetbrains-mono"
cask "font-fira-code"
# Install everything from a Brewfile
brew bundle # Install from a specific file
brew bundle --file=/path/to/Brewfile # Check for missing dependencies
brew bundle check # Clean up packages not in the Brewfile
brew bundle clean
# Install everything from a Brewfile
brew bundle # Install from a specific file
brew bundle --file=/path/to/Brewfile # Check for missing dependencies
brew bundle check # Clean up packages not in the Brewfile
brew bundle clean
# Install everything from a Brewfile
brew bundle # Install from a specific file
brew bundle --file=/path/to/Brewfile # Check for missing dependencies
brew bundle check # Clean up packages not in the Brewfile
brew bundle clean
# Create a dotfiles repo
mkdir ~/dotfiles
cd ~/dotfiles
brew bundle dump
git init
git add Brewfile
git commit -m "Initial Brewfile"
git remote add origin [email protected]:username/dotfiles.git
git push -u origin main
# Create a dotfiles repo
mkdir ~/dotfiles
cd ~/dotfiles
brew bundle dump
git init
git add Brewfile
git commit -m "Initial Brewfile"
git remote add origin [email protected]:username/dotfiles.git
git push -u origin main
# Create a dotfiles repo
mkdir ~/dotfiles
cd ~/dotfiles
brew bundle dump
git init
git add Brewfile
git commit -m "Initial Brewfile"
git remote add origin [email protected]:username/dotfiles.git
git push -u origin main
git clone [email protected]:username/dotfiles.git
cd dotfiles
brew bundle
git clone [email protected]:username/dotfiles.git
cd dotfiles
brew bundle
git clone [email protected]:username/dotfiles.git
cd dotfiles
brew bundle
# team/Brewfile
brew "node"
brew "[email protected]"
brew "postgresql@16"
brew "redis"
cask "docker"
cask "visual-studio-code"
# team/Brewfile
brew "node"
brew "[email protected]"
brew "postgresql@16"
brew "redis"
cask "docker"
cask "visual-studio-code"
# team/Brewfile
brew "node"
brew "[email protected]"
brew "postgresql@16"
brew "redis"
cask "docker"
cask "visual-studio-code"
git clone https://github.com/company/repo.git
cd repo
brew bundle
npm install # or pip install -r requirements.txt
git clone https://github.com/company/repo.git
cd repo
brew bundle
npm install # or pip install -r requirements.txt
git clone https://github.com/company/repo.git
cd repo
brew bundle
npm install # or pip install -r requirements.txt
# Save current setup
brew bundle dump # Uninstall everything
brew uninstall --all
brew uninstall --cask --all # Clean reinstall
brew bundle
# Save current setup
brew bundle dump # Uninstall everything
brew uninstall --all
brew uninstall --cask --all # Clean reinstall
brew bundle
# Save current setup
brew bundle dump # Uninstall everything
brew uninstall --all
brew uninstall --cask --all # Clean reinstall
brew bundle
# .github/workflows/test.yml
steps: - uses: actions/checkout@v4 - name: Set up Homebrew uses: Homebrew/actions/setup-homebrew@master - name: Install dependencies run: brew bundle
# .github/workflows/test.yml
steps: - uses: actions/checkout@v4 - name: Set up Homebrew uses: Homebrew/actions/setup-homebrew@master - name: Install dependencies run: brew bundle
# .github/workflows/test.yml
steps: - uses: actions/checkout@v4 - name: Set up Homebrew uses: Homebrew/actions/setup-homebrew@master - name: Install dependencies run: brew bundle
# Install version managers
brew install pyenv
brew install nvm # Then use them for project-specific versions
pyenv install 3.11.0
pyenv install 3.12.0
pyenv local 3.11.0 # Set for this project nvm install 18
nvm install 20
nvm use 20
# Install version managers
brew install pyenv
brew install nvm # Then use them for project-specific versions
pyenv install 3.11.0
pyenv install 3.12.0
pyenv local 3.11.0 # Set for this project nvm install 18
nvm install 20
nvm use 20
# Install version managers
brew install pyenv
brew install nvm # Then use them for project-specific versions
pyenv install 3.11.0
pyenv install 3.12.0
pyenv local 3.11.0 # Set for this project nvm install 18
nvm install 20
nvm use 20
brew install pyenv
pyenv install 3.11
pyenv install 3.12
pyenv global 3.12 # Default
pyenv local 3.11 # Project-specific
brew install pyenv
pyenv install 3.11
pyenv install 3.12
pyenv global 3.12 # Default
pyenv local 3.11 # Project-specific
brew install pyenv
pyenv install 3.11
pyenv install 3.12
pyenv global 3.12 # Default
pyenv local 3.11 # Project-specific
brew install nvm
nvm install 18
nvm install 20
nvm use 20
nvm alias default 20 # Set default
brew install nvm
nvm install 18
nvm install 20
nvm use 20
nvm alias default 20 # Set default
brew install nvm
nvm install 18
nvm install 20
nvm use 20
nvm alias default 20 # Set default
brew update # Update Homebrew formulae
brew upgrade # Upgrade installed packages
brew cleanup # Remove old versions
brew update # Update Homebrew formulae
brew upgrade # Upgrade installed packages
brew cleanup # Remove old versions
brew update # Update Homebrew formulae
brew upgrade # Upgrade installed packages
brew cleanup # Remove old versions
brew info package-name
brew bundle check --file=Brewfile
brew info package-name
brew bundle check --file=Brewfile
brew info package-name
brew bundle check --file=Brewfile
# Fix permissions (Apple Silicon)
sudo chown -R $(whoami) /opt/homebrew # Or reinstall Homebrew entirely
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Fix permissions (Apple Silicon)
sudo chown -R $(whoami) /opt/homebrew # Or reinstall Homebrew entirely
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Fix permissions (Apple Silicon)
sudo chown -R $(whoami) /opt/homebrew # Or reinstall Homebrew entirely
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Check PATH
echo $PATH | tr ': | grep homebrew # Add to PATH if missing
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# Check PATH
echo $PATH | tr ': | grep homebrew # Add to PATH if missing
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# Check PATH
echo $PATH | tr ': | grep homebrew # Add to PATH if missing
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# Force install
brew install --cask --force visual-studio-code # Or use --no-quarantine for unsigned apps
brew install --cask --no-quarantine some-app
# Force install
brew install --cask --force visual-studio-code # Or use --no-quarantine for unsigned apps
brew install --cask --no-quarantine some-app
# Force install
brew install --cask --force visual-studio-code # Or use --no-quarantine for unsigned apps
brew install --cask --no-quarantine some-app - No sudo required for installations
- Easy uninstall with brew uninstall
- Clean upgrades with brew upgrade
- Dependency management handled automatically - brew install installs command-line tools and libraries
- brew install --cask installs macOS applications (.app bundles) - Apple Silicon: /opt/homebrew
- Intel Macs: /usr/local
- Casks: /opt/homebrew/Caskroom (or /usr/local/Caskroom) - Start with the basics: git, node, python, your editor
- Use Brewfile for reproducibility: Version control it
- Layer on version managers: pyenv, nvm for project-specific needs
- Run brew doctor when things break: It usually knows what's wrong