If you changed a Homebrew service’s configuration and need it to take effect, restart that service by its formula name: brew services restart formula. For example, use brew services restart postgresql@16 if that is the formula you installed. Homebrew stops the service if needed, starts it again, and registers it to launch at login. Check the service list afterward to confirm its reported state.
Before restarting, identify the service and the configuration
Homebrew services manage background processes through macOS launchctl. Without sudo, Homebrew operates on the current user’s LaunchAgents, which are intended to start at login. With sudo, it operates on system LaunchDaemons, which are intended to start at boot. Homebrew’s brew services reference documents this distinction, so use the same privilege level that originally started the service; switching between user and root contexts may make you inspect or affect a different service registration.
If you are unsure of the formula name, list the services Homebrew manages for your current user:
brew services list
The list can show the service name, status, user and plist path. Use the formula name shown there in the restart command. Avoid --all unless you intend to restart every managed service, since it affects more than the one whose configuration you edited. The reference also documents brew services list --debug for additional Homebrew and launchctl output when troubleshooting.
Apply the change with brew services restart
Run the restart in Terminal as the same macOS account that runs the service:
brew services restart postgresql@16
Replace postgresql@16 with the formula you found in the service list. The versioned name is only an example. Homebrew defines restart as stopping the service if necessary and starting it immediately, while registering it to launch at login (or boot when used with sudo). This makes restart appropriate when a running service must reload configuration. The command reference lists the behavior and the optional --all and --file flags.
Do not add sudo automatically. Use it only if the service was deliberately registered as a system service and you intend to manage the root-level registration. Otherwise, sudo may target a different LaunchDaemon, and the user-level service can remain unaffected. If you simply want a process to run once without registering it to launch at login, Homebrew documents brew services run formula; that command does not replace a restart for a service you expect to remain managed.
Check the result and troubleshoot a failed restart
After the command completes, check the managed service list again:
brew services list
Confirm that the intended formula appears with a started status and inspect its user and plist path. A started status confirms that Homebrew reports it started; it does not independently prove the application accepted the new settings or is responding to requests. Verify the application with its own documented health check or by checking the behavior the changed setting controls.
If the service does not start, run the list command with --debug and read the service’s own error output or logs before making further changes. Check the application’s configuration syntax, file permissions and paths against that application’s documentation. Homebrew’s service command starts the service using its service definition; it does not validate every application-specific configuration option. Avoid editing generated plist files as a first fix: Homebrew’s documented configuration mechanism depends on the setting you need to change.
When the change is an environment variable
If your change is an environment variable for the service, Homebrew documents a dedicated per-formula environment file. By default, place it at ~/.homebrew/services/formula.env; if HOMEBREW_USER_CONFIG_HOME is set, the directory is $HOMEBREW_USER_CONFIG_HOME/services. Use one KEY=value assignment per line, with # at the start of a comment line. Then restart the service; Homebrew says these values take effect on the next restart and persist across upgrades. See the service environment instructions in Homebrew’s reference.
For example, the documented file format is KEY=value, but the variable name and value must come from the application’s documentation. Do not assume every application accepts arbitrary environment variables, and do not paste secrets into an environment file without considering who can read it. If your configuration change is an application config file rather than an environment variable, edit the file location specified by that application, then use the same restart command.
The reliable sequence is: identify the exact formula and service context, edit the setting in the location its application or Homebrew documentation specifies, restart that one formula, and verify both Homebrew’s status and the application’s behavior.
Sources
- Manpage.md — Homebrew