Free Guide to Installing Homebrew on Mac and Linux
What Is Homebrew and Why Use It on Mac and Linux Homebrew is a package manager—software that helps you install, update, and remove programs on your computer....
What Is Homebrew and Why Use It on Mac and Linux
Homebrew is a package manager—software that helps you install, update, and remove programs on your computer. Think of it like an app store, but for command-line tools and applications that developers use. Instead of visiting websites to download individual programs one by one, Homebrew lets you install multiple tools from one central location using simple text commands.
On macOS, Homebrew fills a gap that doesn't exist on Windows. Mac users often need development tools, utilities, and programming languages that aren't available through the regular App Store. Linux users benefit similarly, though Linux distributions typically come with their own package managers. Homebrew offers an alternative that works across different Linux distributions consistently, which is valuable if you switch between systems or work in mixed environments.
The software was created in 2009 by Max Howell and has grown to include over 13,000 packages (as of 2024). Major companies and thousands of individual developers maintain these packages, ensuring they stay current and secure. Homebrew itself is open-source, meaning anyone can view its code and contribute improvements.
Common programs people install through Homebrew include Git (for version control), Python (a programming language), Node.js (for web development), and various command-line utilities. Even if you're not a developer, you might use Homebrew to install tools for photography editing, video processing, or system administration.
Practical takeaway: Before installing Homebrew, consider whether you actually need it. If you only use your Mac or Linux computer for browsing, email, and standard applications, Homebrew may not be necessary. However, if you do any programming work, system administration, or use developer tools, Homebrew streamlines installation significantly.
System Requirements and Prerequisites for Installation
Before installing Homebrew, your computer must meet certain requirements. On Mac, you need macOS 11 (Big Sur) or newer. If your Mac runs an older version, you'll need to update the operating system first. You can check your current macOS version by clicking the Apple menu, selecting "About This Mac," and looking at the "System Software" section.
Your Mac also needs at least 2 GB of free disk space, though more is better. Homebrew itself uses minimal space, but the programs you install through it may require additional storage. You should also have a stable internet connection, as Homebrew downloads packages from the internet during installation.
For Linux, Homebrew officially supports Ubuntu 16.04 and newer, Fedora 30 and newer, Debian 9 and newer, and several other distributions. Older versions may work but aren't officially tested. Like Mac, Linux requires at least 2 GB of free space and an internet connection.
Before installation, you'll need certain development tools already present on your system. On Mac, this means installing Xcode Command Line Tools—these are free tools Apple provides for developers. On Linux, you'll need basic build tools and Git. The installation process includes instructions for setting these up if they're missing.
You also need administrator (sudo) access on your computer. If you use a work computer or school computer with restricted permissions, you may not be able to install Homebrew. Contact your system administrator to verify you have the necessary permissions.
Practical takeaway: Run a quick system check before starting: verify your operating system version, confirm you have at least 2 GB free space, test your internet connection, and ensure you have administrator access. This prevents installation failures and saves time.
Step-by-Step Installation Process on macOS
Installing Homebrew on Mac involves opening Terminal—the command-line interface built into every Mac. Find Terminal by opening Spotlight (press Command + Space), typing "Terminal," and pressing Enter. A text-based window appears where you can type commands.
The installation begins with copying and pasting a single command into Terminal. As of 2024, the official installation command is: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". This command downloads the Homebrew installation script from the internet and runs it on your computer. Copy this exact command—spacing and punctuation matter.
After pasting the command and pressing Enter, Terminal displays information about what Homebrew will do. It asks you to press Enter to continue or Ctrl+C to cancel. Press Enter to proceed. The installation then shows a progress indicator while it downloads and configures files. This typically takes 2-5 minutes depending on internet speed.
During installation, Terminal prompts you to enter your computer's password—the same password you use to log in. This is normal; Homebrew needs administrator permission to install system-level software. Type your password and press Enter. Note that Terminal doesn't display the password as you type for security reasons.
Once installation completes, Terminal displays a success message. On newer Macs with Apple Silicon chips (M1, M2, M3, etc.), you may see an additional message about adding Homebrew to your PATH—instructions appear on screen for this step. Follow those instructions by copying the provided command into Terminal and pressing Enter.
To confirm successful installation, type: brew --version and press Enter. This displays the installed Homebrew version number. If you see a version number (such as "Homebrew 4.0.0"), Homebrew installed correctly. If you see "command not found," review the PATH setup instructions from the installation process.
Practical takeaway: Write down or bookmark the official Homebrew installation command from brew.sh before starting. This ensures you're using the most current version and reduces chances of copying an outdated or incorrect command.
Step-by-Step Installation Process on Linux
Installing Homebrew on Linux starts similarly to macOS—you open a terminal and run an installation command. Most Linux distributions have Terminal or a terminal emulator accessible from the applications menu. On Ubuntu and Debian, you can press Ctrl+Alt+T to open Terminal directly.
Before installing Homebrew itself, Linux requires certain build tools. Run this command first: sudo apt-get update && sudo apt-get install -y build-essential curl file git (for Ubuntu/Debian systems). This command updates your software package list and installs tools Homebrew needs to function. The "sudo" prefix asks for your password to perform administrator actions.
For Red Hat–based systems (Fedora, CentOS), run this command instead: sudo yum groupinstall -y "Development Tools" && sudo yum install -y curl file git. This accomplishes the same goal on different Linux flavors.
Once build tools are installed, the Homebrew installation command for Linux is: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". This is identical to the macOS command. Paste it into Terminal, press Enter, and let the installation proceed. Like macOS, you'll be prompted for your password during installation.
Linux installation typically completes in 3-7 minutes. After completion, Terminal displays instructions for adding Homebrew to your system PATH—the list of locations where your computer looks for programs. Follow the on-screen instructions exactly, as they're specific to your Linux distribution and shell type (usually Bash or Zsh).
Test the installation by running: brew --version. This displays the Homebrew version if installation succeeded. You may need to open a new Terminal window or run: source ~/.bashrc (or source ~/.zshrc depending on your shell) to refresh your terminal session before the version command works.
Practical takeaway: On Linux, note your distribution type (Ubuntu, Fedora, Debian, etc.) before starting, as the build tools command differs by distribution. Installing the wrong build tools won't break anything, but it wastes time—verify your distribution first.
Verifying Installation and Troubleshooting Common Issues
After installation completes, verify that Homebrew works correctly by running several diagnostic commands. First, run: brew doctor. This command checks your system for potential problems that might affect Homebrew's operation. It displays a list of issues found, if any, along with suggested solutions. Most systems show "Your system is ready to brew" if everything is configured correctly.
Next, run: brew search git
Related Guides
More guides on the way
Browse our full collection of free guides on topics that matter.
Browse All Guides →