Skip to main content

Using Homebrew with Level on macOS

Level manages Homebrew on macOS with a secure dedicated "homebrew" user.

Updated over a week ago

Level manages Homebrew on macOS using a dedicated "homebrew" user account. This follows the Homebrew recommendation.

How the "homebrew" user works

  • The "homebrew" user is created automatically when you run either:

    • Install Homebrew action

    • Install Homebrew Package action

  • This account is configured for passwordless sudo and its configuration file is stored at "/etc/sudoers.d/homebrew".

  • If you already had Homebrew installed, Level will reconfigure it so that it is owned and managed by the "homebrew" user.


Running Homebrew Commands

Since Homebrew is managed by the "homebrew" user, commands need to be run as that user.

The full command looks like this:

sudo -E -H -u homebrew brew [COMMAND]


​Example:

sudo -E -H -u homebrew brew --version


Simplified Usage with Level

To make this easier, Level installs a wrapper script at "/usr/local/bin/brew". This script automatically runs brew commands as the "homebrew" user. With it, the previous example shortens to:

brew --version


Notification Banner

When using the Level-managed brew script, you'll see a note similar to the following:

NOTE: Homebrew is managed by Level on this device: https://docs.level.io/...


This banner is just an informational reminder that your Homebrew install is managed through Level.

Did this answer your question?