This guide is a development environment setup document for Apple Silicon Macs. Setup methods for Intel Macs are not covered.
What is Homebrew?
Homebrew is a package manager for macOS. Unlike the App Store, it's a community-run open-source repository that allows developers to freely install and manage the tools and libraries they need from the command line.
Why You Need Homebrew
Most development tools are not available on the App Store. Essential tools like Git, Node.js, Python, and Docker require downloading from their respective websites and going through complex installation processes. With Homebrew, you can solve all of this with simple commands.
Key Features
- Package Installation: Install programs with a single command
- Dependency Management: Automatically installs required libraries
- Version Management: Keep installed packages up to date
Before You Start
Installing Homebrew
Check Installation
Check if Homebrew is already installed
if command -v brew &> /dev/null; then
echo "Homebrew is already installed."
brew --version
else
echo "Homebrew is not installed."
fi
Install Homebrew
Run the Homebrew installation script
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"[!NOTE] The installation process will request your Mac login password. It's normal that the password doesn't appear on screen when typing.
Environment Setup
Add the Homebrew path to your terminal configuration file
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
Apply immediately to the current terminal session
eval "$(/opt/homebrew/bin/brew shellenv)"
Verify Installation
Confirm the installation is complete
brew --version[!TIP] If version information is displayed, the installation has been completed successfully.
Next Steps
Homebrew installation is complete.