Is it possible to map the /usr/local/ path on MacOS to a directory that is unique for each user, for example ~/local/? Or is there another way to solve the following:

I trying to give each user on my MacOS server a personal homebrew installation. However the disadvantage of installing homebrew in a non-standard user directory is that all packages will need to be rebuilt from source. Homebrew only uses the binary bottles for the default /usr/local dir.

Preferably I would like each user to have a copy of homebrew in their home dir, and somehow map the /usr/local path to that directory so that the binaries still work.

  • 2
    This sounds like an XY Problem. Why would you want to have user specific homebrew installations?
    – Allan
    Sep 29, 2017 at 13:54
  • Because users need to be free to configure and manage their own software without interfering with each other? Sep 29, 2017 at 16:12
  • Do you have multiple developers all working on a single machine?
    – Allan
    Sep 29, 2017 at 16:21
  • Yes. It's a compute/build server with many users, each with their own requirements. Sep 29, 2017 at 16:27
  • 1
    I've seen multiple people use the same homebrew install, but never multiple people using multiple instances of homebrew sandboxed for individual needs.. They need their own machines.
    – Allan
    Sep 29, 2017 at 17:00

1 Answer 1


Yes, you can do it - but it is relatively involved.

Essentially you could chroot each user into his own directory and replicate the filesystem in there, except for the /usr/local directory, which would then be user-specific.

To access the system directories inside the chroot, you could use bindfs, osxfs or even a NFS mount.

Far easier to just let each user have a non-default homebrew and let them rebuild all their packages as needed. By definition, not sharing one folder implies duplicate storage and work but that’s likely far less hassle to set up.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .