Keeping a Mac mini always on: pmset, sleep settings and power-failure recovery
A Mac mini that serves builds or remote sessions has to stay awake and come back on its own after an outage. This guide covers the key pmset settings, Apple's related Energy options and a checklist for unattended recovery.

Sleep settings that suit a Mac mini on a desk can work against one in a rack. A remote Mac is expected to stay reachable, finish a build at three in the morning, and start again by itself after a power cut. The command-line tool for this is pmset, and desktop Macs also expose related options in System Settings. This article covers the settings that matter, how to confirm them, and what else unattended recovery needs. Some options differ by model and macOS version, so treat man pmset on your own machine as the final authority.
How pmset is organized
The pmset manual, mirrored on SS64, says the tool must run as root to modify settings, so prefix changes with sudo. A scope flag chooses the power source a value applies to: -a for all, -b for battery, -c for the charger and -u for a UPS. A Mac mini has no battery, so -a is the usual choice, and several setting and value pairs can go in one command.
sudo pmset -a sleep 0
The timers: sleep, displaysleep, disksleep
sleepis the system sleep timer in minutes.0disables it.displaysleepis the display sleep timer in minutes.0disables it.disksleepis the disk spindown timer in minutes.0disables it.
For an always-on server the important value is sleep 0; pmset lists display sleep as a timer of its own. For desktop Macs, Apple's sleep and wake page puts Prevent automatic sleeping when the display is off under Energy in System Settings and the display-off timer under Lock Screen. After changing anything there, check that pmset -g still shows sleep at 0.
sudo pmset -a sleep 0 disksleep 0
sudo pmset -a displaysleep 15
Wake and nap: womp and powernap
womp is wake on Ethernet magic packet (1 on, 0 off). It matters only when a machine is allowed to sleep and must be woken over the network. Apple's Energy settings for desktop Macs include a related option, Wake for network access.
powernap enables or disables Power Nap on supported machines. Apple describes Power Nap as letting the Mac check for email, calendar and other iCloud updates while it sleeps. The values below are examples; choose what fits your setup.
sudo pmset -a womp 1
sudo pmset -a powernap 0
pmset -g cap shows which power management features the machine supports; check it first if a setting does not seem to apply.
Recovering from a power failure: autorestart and Energy options
The pmset manual lists autorestart (1 on, 0 off) as automatic restart on power loss.
sudo pmset -a autorestart 1
Apple's page on Energy settings for Mac desktops lists two related options, Start up automatically after a power failure and a Start up when power is connected menu (Never, After power failure, Always), and notes that some options depend on your Mac. Apple's article on turning on a Mac mini without pressing its power button says that menu appears only on computers that meet its requirements: for a Mac mini, a model introduced in 2024 or later running macOS 26.5 or later. Set to Always, Apple says, the computer turns on whenever it gets power, including after an outage.
A setting is not proof: a planned power cut, with someone on site, tells you more than any read-out. For the power-connected setting, Apple advises waiting about 30 seconds after unplugging before reconnecting a computer that stayed plugged in since shutdown.
Reading what is actually active
pmset -gshows the settings currently in use.pmset -g customshows custom settings for all power sources, which might not be the ones in use.pmset -g assertionsshows a summary of power assertions, which can prevent system sleep or display sleep.pmset -g logshows a history of sleeps, wakes and other power management events; the manual says it is meant for administration and debugging.
pmset -g
pmset -g log | tail -n 50
If the log shows sleeps on a machine meant to stay awake, check the assertions output and any configuration profile applied by management software.
Checklist for a Mac that must recover alone
- Power settings:
sleep 0,autorestart 1or the startup option in Energy, and your other values, confirmed withpmset -g. - FileVault versus login: Apple's Mac User Guide says automatic login is disabled while FileVault is on, and its FileVault page says users unlock the encrypted disk with their login password. Plan how the disk will be unlocked after an unplanned restart: if a person must type a password after every outage, the machine cannot recover alone. Apple also warns that automatic login lets anyone get in just by restarting the Mac.
- Services at boot: Apple's launchd guide says system-level daemons are loaded from
/Library/LaunchDaemons/after the system boots, while a user agent runs only while that user is logged in. Choose a daemon for anything that must start without a login. - Remote access: confirm SSH or your remote tool is available before login where intended.
- Verification: after a real or planned restart, read
pmset -g logand confirm your service answers.
The same guide marks Label and ProgramArguments as required plist keys and says KeepAlive sets whether a daemon launches on demand or must always run, recommending on-demand designs; man launchd.plist has the full list. It also says globally installed daemons must be owned by root and must not be group or world writable.
sudo launchctl bootstrap system /Library/LaunchDaemons/com.example.service.plist
The launchctl manual, mirrored on SS64, describes bootstrap as the equivalent of the legacy load subcommand and says changes to the system domain require root. Apple's launchd guide was last updated in 2016, so check man launchctl on your Mac before scripting it.
Sources
- SS64: pmset man page reference
- Apple: Set sleep and wake settings for your Mac
- Apple: Change Energy settings on a Mac desktop computer
- Apple: Turn on a Mac mini, Mac Studio, or iMac without pressing its power button
- Apple: If you don't see a login window when you start your Mac
- Apple: Protect data on your Mac with FileVault
- Apple: Creating launchd jobs (archive)
- SS64: launchctl man page reference


