What Homebrew Does and Why You Need It
Homebrew is a package manager that installs software and development tools on your Mac or Linux computer from the command line. Instead of hunting for download links and running installers one by one, you type a single command and Homebrew fetches, installs, and sets up the tool for you. It saves time and keeps your system organized because Homebrew tracks what it installed and can update or remove everything in one place.
If you work with code, databases, or command-line tools, Homebrew handles the repetitive setup work. It also prevents version conflicts — if two programs need different versions of the same library, Homebrew can manage both without them breaking each other.
Key Takeaways
- Homebrew installation requires opening Terminal and running a single command that downloads and installs everything automatically.
- On Mac, you need Xcode Command Line Tools installed first, which Homebrew will prompt you to set up if you do not have it.
- On Linux, you need a C compiler and a few other build tools, which most distributions include or can install in one command.
- After installation finishes, you verify it worked by typing brew --version in Terminal and checking that a version number appears.
- Once Homebrew is running, you install packages by typing brew install packagename instead of searching for downloads online.
Installing Homebrew on Mac
On Mac, open Terminal (find it in Applications > Utilities, or press Command + Space and type Terminal). Copy and paste this entire command into Terminal and press Enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Terminal will ask for your Mac password. Type it in (you will not see the letters appear, which is normal) and press Enter. Homebrew will then download and install itself. This takes a few minutes. If Terminal says you need Xcode Command Line Tools, type xcode-select --install and follow the prompts — this is a smaller download than the full Xcode app and is required for Homebrew to work.
When the installation finishes, Terminal will print a message. On newer Macs with Apple Silicon chips, you may see a note about adding Homebrew to your PATH. If you do, copy the two lines it shows you, paste them into Terminal, and press Enter. These lines tell your Mac where to find Homebrew commands.
Installing Homebrew on Linux
On Linux, open a terminal window. First, check that you have the tools Homebrew needs. Type this command and press Enter:
sudo apt-get install build-essential curl file git
If you use a Linux distribution other than Ubuntu or Debian (such as Fedora or Arch), the package names differ slightly — search "install build tools [your distribution name]" if the command above does not work. Once those tools are installed, copy and paste this command into Terminal and press Enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Terminal will ask for your password. Type it in and press Enter. Homebrew will download and install. When it finishes, you will see a message with two lines to add to your shell configuration file. Copy those lines, open the file ~/.bashrc or ~/.zshrc (depending on which shell you use), paste them at the end, save, and close. Then type source ~/.bashrc or source ~/.zshrc and press Enter to reload your shell.
Verify the Installation Worked
After installation finishes, close Terminal completely and open it again. Type this command and press Enter:
brew --version
If Homebrew is installed correctly, Terminal will print a version number, such as Homebrew 4.0.0. If you see an error saying "command not found", the PATH setup did not work. Go back to the installation step and make sure you ran the two lines that Homebrew printed at the end — they are easy to miss.
You can also check that Homebrew is healthy by typing brew doctor and pressing Enter. This command scans your system and tells you if anything is misconfigured. Most of the time it will say everything is fine.
Installing Your First Package
Now that Homebrew is running, you can install packages. To install a package, type brew install packagename and press Enter. For example, to install Node.js, you would type brew install node. Homebrew fetches the software, installs it, and sets it up automatically.
To see what packages you have installed through Homebrew, type brew list. To update all your packages to their latest versions, type brew upgrade. To remove a package you no longer need, type brew uninstall packagename. Homebrew keeps your system clean by removing old versions automatically.
Troubleshooting Common Installation Problems
If the installation command fails with a permission error, make sure you typed your Mac or Linux password correctly when Terminal asked for it. If you are not sure whether you entered it right, press Control + C to stop the command, close Terminal, and start over.
If Terminal says "curl: command not found", your system is missing a basic tool. On Mac, run xcode-select --install again. On Linux, type sudo apt-get install curl and try the Homebrew installation command again.
If Homebrew installs but brew --version still says "command not found", the PATH was not set up correctly. Open Terminal and type echo $PATH to see your current path. If you do not see a Homebrew directory listed, you missed the two lines that Homebrew printed at the end of installation. Run those lines now, close Terminal, and open it again.
Frequently Asked Questions
Do I need to pay for Homebrew?
No. Homebrew is free and open source. The packages it installs may have their own licenses, but Homebrew itself costs nothing.
Can I use Homebrew on Windows?
Homebrew does not run natively on Windows. If you use Windows, you can use Windows Subsystem for Linux (WSL) to run a Linux environment, then install Homebrew inside it. Alternatively, Windows users can use Chocolatey or Scoop, which are package managers built for Windows.
What is the difference between brew install and brew cask install?
Brew installs command-line tools and libraries. Brew Cask installs graphical applications like Firefox or Slack. For most development work, you will use brew install. If you want to install a Mac app through Homebrew, use brew install --cask appname.
Will Homebrew slow down my computer?
Homebrew itself uses very little system resources. The packages you install through it will use whatever resources they normally would. Homebrew does not run in the background or monitor your system — it only runs when you type a command.
How do I uninstall Homebrew completely?
On Mac, open Terminal and type /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)". On Linux, type /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)". This removes Homebrew and all packages you installed through it.