When you start your coding journey, you’ll quickly learn that there’s a ton of tools, packages, and more that you’ll need to install on your computer. Some installation processes are more error-prone than others, but you’ll undoubtedly run into some issues either way.
Homebrew: the package manager for Mac/Linux
If you’re a Mac user, there’s a superfast and easy solution for that: Homebrew!
Homebrew is an open-source package manager for Mac that lets you install pretty much any programming language or tool with ease. Homebrew is like the app store but for developers on Mac (and Linux).
So far, I’ve installed node.js, git, git-gui, and Xampp-vm via Homebrew with one single line of code on the command line. No more hassle with finding the right download link, making sure you have the correct version installed or rolling back to a previous version because the current release is buggy when installing,… All you need to do is type a single line in the Terminal, let Homebrew do its thing and hey presto! You’ll be back to coding in no time.
How to install Homebrew?
Did you say…command line? (eeeek!)
Yes, you do need to use the Terminal to install and use Homebrew. But don’t panic! It’s less intimidating than you think.
- Simply open up your Terminal (Finder > Applications > Utilities )
- Go to https://brew.sh and copy/paste the installation code (below the title “Install Homebrew”)
- And hit Enter
Terminal will probably also ask you to hit Enter again and type your computer’s password to confirm that you want to install Homebrew. Once you do, you’ll see a lot of lines starting to run in your Terminal. This is normal, it’s basically Homebrew letting you know what it’s doing in your machine before executing. Terminal will also let you know when Homebrew is successfully installed.
If you’re not sure if Homebrew was installed successfully, you can try typing:
When you hit enter, this command should return the version of Homebrew that has been installed.
How to install packages with Homebrew?
To install packages on Homebrew, the easiest way is to search for what you want to install on https://brew.sh and copy the install command from there in your Terminal.
Usually, it will look somewhat like this:
brew install name-of-your-package
Important for non-native English speakers: use the search bar of the Homebrew website in English, not your native language. When I searched for Xampp-vm in Dutch, it didn’t find anything.
It’s possible that Homebrew requires an update before it can install your desired package. Terminal will give you a heads up if that’s the case and it will let you know what to do.
You’ll probably need to input something like:
What can you install with Homebrew?
Pretty much anything! You can find a full list here: https://formulae.brew.sh
For a list of commonly installed Homebrew packages, go here: https://gist.github.com/r5v9/bf9b32de7d9d02e12d0f3800e7f8805f
Is Homebrew safe to use?
Homebrew is open source, and as a beginner web dev myself, I was a bit uneasy installing it. But considering that Homebrew has been around since 2009, makes extensive use of Github, and is being used by Mac and Linux users worldwide, I’d say there’s nothing to worry about.
That is, as long as you know what it is that you’re installing. I wouldn’t recommend going through the list of packages and installing random stuff just because you can.