Home/Troubleshooting/Homebrew install fails with Permission denied on a rented Mac, or brew: command not found

Homebrew install fails with Permission denied on a rented Mac, or brew: command not found

Updated · airankrush

Symptom

Running the official Homebrew install command reports Permission denied or says it needs an administrator, or it stalls at the password step. In other cases the install appears to succeed, but typing brew gives command not found.

Possible causes (most common first)

  1. The install script creates system-level folders and asks for a password along the way. Either the password entered was not this Mac's login password, or nothing showed on screen while typing and you assumed it was not being accepted.
  2. After installation, the commands printed at the end of the script were never run, so the folder containing brew is not in PATH.
  3. Homebrew's folder was written to at some point by another account or with elevated privileges, and some files are not owned by you.
  4. The command line developer tools are not installed, so packages that compile from source cannot be installed.

Troubleshooting steps (easiest first)

  1. Use the official command; the password is the Mac's login password

    Take the install command from the brew.sh home page, not from a script modified by a third party. The script stops and asks for a password: it wants this Mac's login password (the macOS password in the customer console). Terminal shows no characters while you type; finish typing and press Return. Your account is an admin account, so this step goes through.

  2. Add brew to PATH after installing

    The official installation documentation states that on Apple silicon Macs Homebrew installs to /opt/homebrew by default, and that folder is not in PATH by default. When the script finishes it prints “Next steps”. Run those commands exactly as shown, open a new Terminal window, and verify with brew --version. command not found is almost always this missed step, not a permission problem.

  3. Use brew doctor to find the exact path

    Day-to-day brew install and brew upgrade run as your own account with no elevated privileges. The official documentation also explains that the default location is designed so that no admin password is needed after installation, with a few casks and system services as exceptions. When you get Permission denied, run brew doctor first; it names the specific folders with the wrong owner.

  4. Do not change permissions on the whole folder

    The official Common Issues page is explicit: read the full error, find the one path that failed and the owner it should have, and do not recursively change ownership or permissions on the whole Homebrew folder. The “one command to fix permissions” tips that circulate online usually do exactly that, and on a rented machine they can also hit components the platform keeps in system folders.

  5. Install the build tools if they are missing

    The official documentation says that installing precompiled packages on Apple silicon does not require the command line developer tools; they are needed only when compiling from source. If the error mentions a missing compiler or developer path, run xcode-select --install and click Install in the dialog that appears in the remote desktop.

When to contact support directly

Contact support on Contact support when: a login password you have verified is still rejected; brew doctor reports abnormal ownership on /opt/homebrew or system folders and you are not sure whether you may change it; or the install script asks to modify network or proxy settings. Include your machine ID, macOS version, and the full text of brew doctor and the error. Do not send the password.

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All troubleshooting pages