macOS Developer Setup: Essential Homebrew Commands for 2026
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.
Why Homebrew?
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:
- No sudo required for installations
-
Easy uninstall with
brew uninstall -
Clean upgrades with
brew upgrade - Dependency management handled automatically
For GUI applications, Homebrew Cask extends the same philosophy to apps like VS Code, Docker, and iTerm2.
Installation: The 60-Second Setup
Open Terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
After installation, add Homebrew to your PATH (Apple Silicon Macs):
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
Verify everything works:
brew --version
# Homebrew 4.x.x
Essential Commands for Daily Use
Searching for Packages
# Search for a package
brew search python
brew search node
# Get info before installing
brew info node
brew info python@3.12
The brew info command shows version, dependencies, build options, and analytics.
Installing Packages
# Install a package
brew install git
brew install node
brew install python@3.12
brew install go
brew install rust
# Install specific versions
brew install node@20
brew install python@3.11
Managing Your Installation
# 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
Diagnosing Problems
# Check for issues
brew doctor
# This will tell you about:
# - Unlinked kegs
# - Missing dependencies
# - Permission issues
# - Config problems
Installing GUI Apps with Homebrew Cask
Homebrew Cask handles macOS applications—no more dragging .dmg files around:
# 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
Pro tip: Use brew list --cask to see all installed GUI apps.
The Developer Stack: One Command to Rule Them All
Here's the full stack most developers need. Create a script or copy-paste:
# 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 python@3.12 # 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)
Reproducible Setups with Brewfile
The real power of Homebrew shines with Brewfiles—declarative configurations that let you recreate your entire setup with one command.
Creating a Brewfile
# Generate from current installation
brew bundle dump
# This creates a Brewfile in the current directory
Example Brewfile
# 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 "python@3.12"
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"
Using a Brewfile
# 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
Store Your Brewfile in Git
# 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 git@github.com:username/dotfiles.git
git push -u origin main
Now any new machine is three commands away from your perfect setup:
git clone git@github.com:username/dotfiles.git
cd dotfiles
brew bundle
Real-World Scenarios
Scenario 1: Onboarding a New Developer
Create a team Brewfile in your repo:
# team/Brewfile
brew "node"
brew "python@3.12"
brew "postgresql@16"
brew "redis"
cask "docker"
cask "visual-studio-code"
New team members run:
git clone https://github.com/company/repo.git
cd repo
brew bundle
npm install # or pip install -r requirements.txt
Done. Development environment ready.
Scenario 2: Resetting a Messy Mac
If your system packages are a mess:
# Save current setup
brew bundle dump
# Uninstall everything
brew uninstall --all
brew uninstall --cask --all
# Clean reinstall
brew bundle
Scenario 3: CI/CD Environment Setup
For GitHub Actions or other CI:
# .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
Scenario 4: Multiple Python/Node Versions
# 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
FAQ
Q: How do I switch between Python versions?
Use pyenv (installed via Homebrew):
brew install pyenv
pyenv install 3.11
pyenv install 3.12
pyenv global 3.12 # Default
pyenv local 3.11 # Project-specific
Q: Can I install multiple Node versions?
Yes, use nvm:
brew install nvm
nvm install 18
nvm install 20
nvm use 20
nvm alias default 20 # Set default
Q: How do I update Homebrew itself?
brew update # Update Homebrew formulae
brew upgrade # Upgrade installed packages
brew cleanup # Remove old versions
Q: What's the difference between brew install and brew install --cask?
-
brew installinstalls command-line tools and libraries -
brew install --caskinstalls macOS applications (.app bundles)
Q: Where does Homebrew install things?
-
Apple Silicon:
/opt/homebrew -
Intel Macs:
/usr/local -
Casks:
/opt/homebrew/Caskroom(or/usr/local/Caskroom)
Q: How do I see what would be installed before running?
brew info package-name
brew bundle check --file=Brewfile
Common Pitfalls
Permissions Issues
If you see permission errors:
# 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)"
PATH Issues
If commands aren't found after install:
# Check PATH
echo $PATH | tr ':
| grep homebrew
# Add to PATH if missing
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Cask Conflicts
If a cask install fails due to existing app:
# Force install
brew install --cask --force visual-studio-code
# Or use --no-quarantine for unsigned apps
brew install --cask --no-quarantine some-app
Conclusion
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.
The key takeaways:
- 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 doctorwhen things break: It usually knows what's wrong
Your 30-minute setup is now complete. What will you build?
Got a Homebrew tip I missed? Drop a comment below!
Top comments (0)