Skip to content

Instantly share code, notes, and snippets.

@marutypes
Last active December 13, 2024 15:31
Show Gist options
  • Save marutypes/bc223ba125abc233c205cf7838cf3924 to your computer and use it in GitHub Desktop.
Save marutypes/bc223ba125abc233c205cf7838cf3924 to your computer and use it in GitHub Desktop.
Homebrew without sudo

Install Homebrew Without sudo

If you don't have sudo access (like on a work-managed machine), you can still install Homebrew locally.

  1. Create a Homebrew directory:

    mkdir -p ~/homebrew
  2. Download and install Homebrew into the local directory:

    curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
  3. Update your PATH: Add the following to your ~/.zshrc or ~/.bash_profile (depending on your shell):

    export PATH="$HOME/homebrew/bin:$PATH"
  4. Apply the new PATH:

    source ~/.zshrc  # or ~/.bash_profile if you're using bash
  5. Verify the installation:

    brew doctor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment