Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Homebrew nicely allows package installations without sudo privileges, but it seems that I need admin privileges to install Homebrew itself.

I'd like to install Homebrew in a Mac environment where I don't have sudo or admin privileges. Is this possible?

share|improve this question

2 Answers 2

up vote 8 down vote accepted

No.. Unless you do significant surgery.

The reason is that Homebrew strongly insists on installing packages into /usr/local. In fact, even if you forced it to install somewhere else, you are likely to break dependencies when you use brew install to install packages. Most if not all of these packages are pre-compiled and linked expecting to live in /usr/local.

The reason for this insistence is that /usr/local is precisely where POSIX recommends that stuff like this gets installed. In order to create /usr/local Homebrew needs temporary admin credentials to create the directory and assign ownership.

This, in turn, is what allows you to install anything else without elevating credentials.

share|improve this answer
Thanks, but I think you missed my question. I know how & where it installs packages, but I want to install Homebrew without admin or sudo. –  BenjaminGolder Jul 14 '13 at 1:17
I didn't miss your question. The answer was "No".. I just said "Yes" accidentally. You cannot easily do what you are asking and even if you forced it by editing the Homebrew installer to put things into a branch off of your home directory, more than likely lots of brews would fail after installation. –  David Hoelzer Jul 14 '13 at 1:18
okay, thanks. I was confused by the previous "Yes". –  BenjaminGolder Jul 14 '13 at 1:25


I modified the install script to not use sudo and to use a directory of your choice. https://gist.github.com/skyl/36563a5be809e54dc139

Download that, set YOUR_HOME in the script to the absolute path. chmod +x the script. Then, execute the script.


In .bash_profile, I set (I'm not positive this is important, pretty sure):

export HOMEBREW_PREFIX=/The/path/to/YOUR_HOME/usr/local

Now, I can:

brew install wget

Make sure the bin directory, YOUR_HOME + /usr/local/bin is on your $PATH.

which wget
share|improve this answer
In the install script I had to add #{YOUR_HOME} prefix to the HOMEBREW_CACHE variable as well. That, and because the system admin already had homebrew installed, I had to add export PATH=/path/to/home/usr/local/bin:$PATH to .bash_profile as well. But with all that, it seems to work great. –  golmschenk Jun 26 at 19:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.