in

What is Homebrew and How to Install on MacOS? The Complete Guide

Hey there! Have you ever wanted to install useful command line tools like Git, Python, MySQL on your Mac but found it confusing and tedious? Well my friend, I‘ve got the perfect solution for you – Homebrew!

As a fellow Mac user and tech enthusiast, I‘m going to walk you through everything you need to know about Homebrew – the legendary package manager for macOS. I‘ll explain what exactly Homebrew does, why you need it, and how to easily install and start using it. Sound good? Then let‘s get brewing!

What is Homebrew and Why it‘s Awesome

Homebrew (also known as "brew") is an open-source package manager that lets you install thousands of command line applications and tools on MacOS. Homebrew makes it incredibly simple to get apps like Git, Node, Python, databases etc up and running on your system with just a single terminal command!

Here are some of the awesome benefits of using Homebrew:

  • Huge collection of formulas – Homebrew has over 5000 formulas for popular apps/tools contributed by the open source community. Anything you need is likely available as a brew formula!

  • Simplifies installations – No more messing around with compiling source code or obscure install steps. Just brew install <formula> and you‘re done!

  • Centralized repository – Homebrew collects all packages in one place and lets you manage/update them easily.

  • Integrates seamlessly – Installs packages to /usr/local so they work like native Mac apps. Pure awesomeness!

  • Keeps tools up-to-date – Running brew upgrade fetches the latest versions of installed packages. Killer feature!

  • Easy to removebrew uninstall <formula> removes the package cleanly, leaving no traces behind. Mic drop!

According to industry surveys, Homebrew is used by a whopping 70% of Mac developers. And it‘s not just for programmers – data scientists, researchers, IT admin and power users also love Homebrew for its simplicity and usefulness. It truly is an essential tool for anyone on MacOS.

Now that you know what Homebrew is and why you need it, let‘s look at how to install and start using it. Trust me, it‘s super quick and easy!

Step-by-Step Guide to Installing Homebrew on Mac

The only prerequisites for Homebrew are having macOS Catalina or above, Command Line Tools for Xcode and administrator access to install packages. Let‘s first ensure you have those covered.

1. Check your MacOS version

Homebrew requires macOS Catalina (10.15) or newer. To check your macOS version, go to Apple menu > About This Mac. You should see something like this:

About This Mac menu on macOS

As long as you have Catalina or above, you‘re all set!

2. Install Command Line Tools for Xcode

Some Homebrew packages depend on Xcode development tools. To get those installed, open Terminal and run:

xcode-select --install

This will download and install Xcode command line tools for you. Click Install in the dialog box and enter your password to confirm. Easy peasy!

3. Install Homebrew!

Now the moment we‘ve been waiting for! In your Terminal, enter this magic one-liner:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

This downloads the Homebrew installation script and runs it. The script will explain what it will do – just press Enter to confirm.

Next, enter your account password when prompted to provide administrator access.

Sit back and watch the installation process unfold. The script will take a few minutes to download and setup Homebrew on your Mac.

Once done, you‘ll see the success message:

==> Installation successful!

==> Next steps
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh

Awesome! You now have Homebrew ready and waiting on your system.

4. Test the installation

To verify everything is ship shape, run:

brew doctor

This runs a quick checkup and spits out any potential issues. If you see "Your system is ready to brew", you‘re good to go!

And that‘s it – Homebrew is installed and ready for action! The whole process takes less than 5 minutes. Pretty sweet for such a powerful tool don‘t you think?

How to Use Homebrew like a Pro

Now that Homebrew is set up, let‘s go over some commands to use it like a pro:

Search for packages

To lookup available Homebrew packages, use:

brew search <package> 

For example:

brew search python

This searches and lists all Python related packages in Homebrew.

You can also browse packages on the formulae website. Over 5000 and counting!

Install packages

To install a package, use:

brew install <formula>

For example, to install the latest Python 3:

brew install python

Homebrew will download and install python for you automatically. No need to compile or figure out messy install steps!

Some other useful formulas I recommend installing:

  • git: Latest Git version control system
  • node: Node.js JavaScript runtime environment
  • ngrok: Tool for exposing local servers to the internet
  • wget: Command line utility for downloading files
  • mysql: MySQL open source database
  • terraform: Infrastructure-as-code tool by HashiCorp

The formulae website lists thousands of popular open source apps and libraries ready to brew install!

Upgrade packages

To fetch the latest version of a package:

brew upgrade <formula>

You can also upgrade all formulae:

brew upgrade 

I run this regularly to keep all my tools up-to-date and secure. Super handy!

Uninstall packages

To cleanly remove a package:

brew uninstall <formula> 

For example:

brew uninstall node

This will completely remove Node.js and all its files from your system.

Useful commands

Here are some other useful Homebrew commands I use regularly:

  • brew list – List all installed packages
  • brew update – Fetch latest formula versions
  • brew doctor – Check for system issues
  • brew config – View Homebrew configurations
  • brew help – List available commands

The Homebrew docs have extensive usage instructions. But these basics will get you pretty far!

Installing Mac Apps with Homebrew Cask

In addition to command line tools, Homebrew lets you easily install Mac GUI apps using Homebrew Cask.

For example, to install Google Chrome browser:

brew install --cask google-chrome

You can search for apps with:

brew search --casks <app> 

Some popular picks:

  • visual-studio-code: Visual Studio code editor
  • firefox: Firefox web browser
  • gimp: GNU image manipulation program
  • skype: Video chat and voice call app

Browse all available casks at https://formulae.brew.sh/cask/.

Uninstalling Homebrew

If you ever need to uninstall Homebrew for any reason:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"

This will cleanly remove Homebrew, all installed packages and dependencies from your system.

You can also manually download and run the uninstall script:

curl -fsSL -o uninstall.sh https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh

bash uninstall.sh

And that‘s all it takes to completely remove Homebrew!

Wrapping Up

Phew, that was quite the Homebrew journey! Let‘s recap what we‘ve learnt:

  • What Homebrew is: Package manager for installing command line apps/tools on Mac
  • Why it‘s awesome: Simple installs, centralized packages, seamless integration, easy to update/remove etc.
  • Requirements: macOS Catalina+, Xcode Command Line Tools
  • How to install: Download and run the Homebrew install script
  • Usage: brew search, brew install, brew upgrade, brew uninstall etc.
  • Install apps: With Homebrew Cask like Google Chrome
  • Uninstall: Run the Homebrew uninstall script

I hope you found this guide helpful for getting up and running with Homebrew, my favorite Mac power user tool!

Homebrew makes it so much easier to install and manage all kinds of useful software on your Mac. Give it a try and I‘m sure you‘ll be hooked.

Let me know if you have any other questions. Happy brewing!

AlexisKestler

Written by Alexis Kestler

A female web designer and programmer - Now is a 36-year IT professional with over 15 years of experience living in NorCal. I enjoy keeping my feet wet in the world of technology through reading, working, and researching topics that pique my interest.