Skip to main content

Instructions to Install Homebrew on macOS

Homebrew is a popular package manager for macOS that simplifies the installation of software and tools. Follow these steps to install Homebrew on your Mac:


Step 1: Open Terminal​

  1. Open the Terminal application on your Mac.
    • You can find it in Applications > Utilities > Terminal.

Step 2: Run the Installation Command​

  1. Copy and paste the following command into your terminal:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Press Enter to execute the command.


Step 3: Follow the On-Screen Instructions​

  1. The installation script will prompt you to:
    • Install Command Line Tools for Xcode (if not already installed). Follow the on-screen instructions to complete this step.
    • Provide your system password for permission to install Homebrew.
    • Confirm installation paths.

Step 4: Add Homebrew to Your Shell Configuration​

After the installation is complete, you may need to add Homebrew to your shell configuration file to ensure it works properly.

For Zsh (Default Shell on macOS Catalina and Later):​

  1. Update your .zshrc file:

    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
    source ~/.zshrc

For Bash​

  1. Update your .bash_profile file:

    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile
    source ~/.bash_profile

Step 5: Verify Installation​

  1. Run the following command to check if Homebrew is installed correctly:

    brew --version

    You should see the installed version of Homebrew.


Step 6: Install Software Using Homebrew​

Once Homebrew is installed, you can use it to install software and tools. For example:

brew install python

Step 7: Keep Homebrew Updated​

To ensure Homebrew and its packages are up-to-date, run:

brew update

Notes​

  • Homebrew installs packages in /opt/homebrew on Apple Silicon Macs and /usr/local on Intel Macs.
  • If you encounter any issues during installation, refer to the Homebrew documentation for troubleshooting tips.