Install Brew: Step-by-Step Guide for macOS and Linux

Learn how to install brew (Homebrew) on macOS and Linux with a clear, step-by-step approach. Prerequisites, installation, PATH setup, maintenance, and troubleshooting for homeowners and DIY enthusiasts.

Install Manual
Install Manual Team
·5 min read
Install Homebrew - Install Manual
Quick AnswerSteps

Installing brew, also known as Homebrew, provides a simple, reliable way to install and manage open-source software on macOS and Linux. This quick answer lays out the exact steps to install brew, verify the installation, and get you started with basic commands, plus tips for maintenance and security. It also explains platform differences and common post-install checks.

What is install brew and why homeowners use it

According to Install Manual, learning how to install brew (Homebrew) gives homeowners a repeatable, reputable way to manage software on

Tools and environment before you begin

Before you run any installer, confirm you’re on a supported platform (

Prerequisites and planning before you begin

Brew relies on a POSIX-compliant shell and a few build tools. On

Step-by-step planning before you run the installer

Although the actual installation steps come later, it helps to decide where you want brew to live on your system and which shell you’ll use (zsh, bash, etc.). Decide which profile file to modify (for example, .zprofile, .bash_profile, or .bashrc) based on your shell. Having a plan for PATH updates and environment configuration reduces the chance of brew being unavailable after restart. You’ll also want to consider whether you’ll use a single-user or multi-user setup on Linux and adjust permissions accordingly.

Authority sources

For authoritative guidance, consult these resources:

  • https://docs.brew.sh/Installation
  • https://brew.sh/
  • https://opensource.com/article/18/3/install-homebrew-macos-linux

These sources provide official installation instructions, platform considerations, and troubleshooting tips to complement this guide.

Maintenance, updates, and security best practices

Once Brew is installed, you’ll want to keep it up to date and minimize drift between environments. Regularly running brew update to fetch the latest formulae, brew upgrade to install newer versions, and brew cleanup to remove old files helps maintain a clean, efficient system. For security, avoid running scripts from untrusted sources, verify you’re using the official installer, and periodically audit the list of installed packages to remove anything no longer needed. Establishing a routine makes ongoing maintenance straightforward for DIY tasks.

Common issues and troubleshooting

If brew isn’t found after installation, re-check the PATH updates you added to your shell profile and restart your terminal. If you encounter permissions errors, verify you used sudo only when prompted by the installer and ensure your user account has sufficient privileges. Network blocks or proxy settings can interfere with the installer’s ability to fetch files; in that case, try a different network or configure your proxy settings to allow traffic to brew.sh and GitHub raw content. For many users, these steps resolve the most frequent hiccups during setup.

How Brew fits into your DIY workflow

Brew acts as a centralized gateway to open-source tools, accelerating common tasks like text processing, scripting, and lightweight development. As you complete projects around the home—automation, data collection, or small software experiments—brew makes it easier to add and upgrade tools without tracking manual downloads. Pair Brew with a simple habit of running a quick brew update weekly, and you’ll maintain a stable, modern toolkit that supports your home improvement goals.

Quick-start checklist

  • Confirm prerequisites (shell, admin rights, internet).
  • Run the official brew installer script.
  • Configure PATH according to your shell and platform.
  • Verify installation with brew --version and brew doctor.
  • Install at least one test package (e.g., wget or curl).
  • Schedule regular maintenance (update/upgrade/cleanup).

Tools & Materials

  • Computer with internet access(macOS or Linux environment; admin privileges may be required)
  • Command line tools (curl or wget)(Needed to fetch the installer if not preinstalled)
  • Administrative credentials(Required to install system-wide components)
  • Xcode Command Line Tools (macOS)(Required for compilation and certain brew activities)
  • Build-essential (Linux)(Ensures compilers and basic build tools are available)
  • Stable network(Public network preferred over restricted environments)

Steps

Estimated time: 20-30 minutes

  1. 1

    Open Terminal and verify prerequisites

    Launch Terminal on macOS or your Linux shell. Confirm you have internet access and admin rights. This ensures the installer can fetch files and write to system directories without interruption.

    Tip: If curl is missing, use your package manager to install it before proceeding.
  2. 2

    Run the official brew installer

    Execute the installer script provided by the official Brew project. Example command: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". This script guides you through installation prompts and places Brew in its default directory.

    Tip: Copy the command directly from the official site to avoid tampered scripts.
  3. 3

    Follow prompts and grant permissions

    During installation you may be asked to enter your password for elevated privileges. Allow the installer to proceed when prompted and note the installation path shown by the script.

    Tip: If you’re on Apple Silicon, note the potential /opt/homebrew path.
  4. 4

    Configure PATH for your shell

    Add Brew to your PATH so you can run it from any terminal window. For Apple Silicon macOS, append the shellenv script to your profile, e.g., echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile && eval "$($(brew --prefix)/bin/brew shellenv)". Linux users may need to adjust PATH to the Linuxbrew location.

    Tip: Restart your terminal or source the profile file after edits.
  5. 5

    Verify installation

    Run brew --version to confirm installation. Then run brew doctor to identify any common setup issues and follow suggested fixes.

    Tip: If brew command is not found, recheck PATH changes and reopen the terminal.
  6. 6

    Update and upgrade

    Update brew’s formulae index with brew update and upgrade any outdated packages with brew upgrade. This keeps your software current and reduces compatibility problems.

    Tip: Regular maintenance reduces long-term drift between environments.
  7. 7

    Install a test package

    Install a lightweight utility to validate your setup, for example brew install wget or brew install curl. This confirms the package manager can fetch and compile software as intended.

    Tip: Choose a small, non-essential tool for the test to minimize risk.
Pro Tip: Always copy the installer command from the official Brew site to prevent tampering.
Warning: Do not run the installer as root. It will request elevated privileges when needed.
Note: Apple Silicon vs Intel matters for install location and PATH configuration.
Pro Tip: Set up a simple weekly maintenance ritual: brew update, brew upgrade, and brew cleanup.

Got Questions?

What is Homebrew and why should I use it?

Homebrew is a package manager that simplifies installing and managing open-source software on macOS and Linux. It standardizes how tools are downloaded, built, and updated, which helps DIY projects stay consistent.

Homebrew is a package manager that makes installing and updating software easy on macOS and Linux.

Can I use brew on Linux as well as macOS?

Yes. Brew supports both macOS and Linux. On Linux, Brew installs in the user space by default and may require PATH adjustments.

Yes, you can use Brew on Linux with PATH adjustments after installation.

Do I need Xcode or build tools just to install brew?

On macOS, the installer may prompt you to install the Xcode Command Line Tools. These tools provide compilers and essential utilities Brew may need for some packages.

Xcode tools may be required on macOS for compilation.

How do I uninstall brew if I change my mind?

Uninstalling Brew is a separate process that involves running the uninstall script provided by Homebrew. It removes Brew and its installed packages from your system.

To remove Brew, run the official uninstall script from the Brew site.

What should I do if brew commands aren’t found after install?

This usually means PATH updates didn’t take effect. Revisit your shell profile changes, restart the terminal, and verify the Brew path aligns with your platform (Apple Silicon vs Intel).

If Brew isn’t found, check PATH and restart the terminal.

Is Brew secure to use on a home network?

Brew is widely used and maintained by a large community. Always use the official installer and sources, and review what you install from Brew to minimize risk.

Yes, as long as you use the official installer and vetted packages.

Watch Video

Main Points

  • Install brew simplifies macOS/Linux software management
  • Follow the official installer to ensure security
  • Configure PATH correctly for your shell
  • Regular maintenance keeps Brew reliable
Three-step process showing prepare, install, verify for Homebrew
Brew installation steps at a glance

Related Articles