Launch daemons
Launch daemons are background services that run as root and generally start at system boot, independent of any user login session. Launch daemons are ideal for tasks that need to run at the system level or in the background continuously, without direct user interaction. For example, system maintenance tasks, hardware drivers, or services that should always run (like an antivirus engine or a network service) are implemented as daemons.
Startup behavior
When macOS boots, the global launchd
process loads all plist files from the LaunchDaemons directories (/System/Library/LaunchDaemons
for Apple-provided daemons, and /Library/LaunchDaemons
for third-party or administrator-installed daemons).
For each daemon plist
, launchd
may pre-register any sockets or resources it needs, then launch the specified program; either immediately at boot if RunAtLoad
or similar is set, or on-demand when triggered by some event (e.g. incoming connection). By default, daemons run in the system context (root user) and do not have access to GUI or per-user UI elements… macOS actually disallows daemons from interacting with the window server (no GUI allowed).
Locations
LaunchDaemon plists belong in /Library/LaunchDaemons
for non-Apple daemons (or in the system /System/Library/LaunchDaemons
for built-in macOS daemons). There is no concept of a per-user LaunchDaemons directory; they are always system-wide.
The executable launched can reside anywhere (common locations are /usr/local/bin
, /Applications/<AppName>.app/Contents/...
, etc.), but the plist must be in one of those LaunchDaemons folders to be loaded by launchd at boot.
Use cases
Launch Daemons are used for services that should run for all users or before any user logs in. For example, Apple uses daemons for system services like com.apple.mDNSResponder.plist
(multicast DNS responder) in /System/Library/LaunchDaemons
.
People or software might install daemons for things like auto-updaters, security monitoring services, or management agents. Daemons run with high privileges by default (root), so they must be used carefully. They are not suitable for tasks that need a logged-in user’s environment or display.