Server & LLM box
Make a Mac mini turn itself back on after a power failure
A Mac mini, Mac Studio or iMac can switch itself back on when the power returns, and a machine that serves files, models or a smart home has to. The setting lives in System Settings → Energy, but its name and choices changed in macOS 26.5, and turning it on is only the first link. A Mac that boots to a password prompt is on, not back. This guide covers the setting on every recent macOS, the Terminal version, a safe test, and the rest of the chain until your services answer again.
Where the setting is on your macOS
| macOS | Where to look | What it is called |
|---|---|---|
| Monterey 12 and earlier | System Preferences → Energy Saver | Start up automatically after a power failure |
| Ventura 13, Sonoma 14 | System Settings → Energy Saver | Start up automatically after a power failure |
| Sequoia 15 | System Settings → Energy | Start up automatically after a power failure |
| Tahoe 26, macOS 27 | System Settings → Energy | “Start up when power is connected” on a 2024+ Mac mini or iMac or a 2025+ Mac Studio with 26.5 or later; the older switch on other desktop Macs |
MacBooks do not show the option at all. A laptop rides through an outage on its battery, and macOS ignores the automatic restart settings on any Mac with an internal battery.
If a 2024 Mac mini still shows the old switch, check the version under General → About: the new menu arrived with macOS 26.5.
After power failure or Always
The newer menu has three choices. Never leaves it to the power button. After power failure turns the Mac on when power returns, but only if it was running when the power went. Always turns it on whenever power is connected, even after you shut it down on purpose.
For a server, After power failure is the right default: an outage brings it back, and a deliberate shutdown stays a shutdown. Always suits a Mac you switch on from a smart plug or a switched power strip.
The older switch behaves like After power failure, and that catches people out. Shut the Mac down from the Apple menu, then cut the power, and it stays off when the power returns, because macOS recorded a normal shutdown, not a failure.
Give the power supply time to discharge. Apple suggests waiting about 30 seconds between disconnecting and reconnecting power, so set a smart plug’s off period longer than that.
The Terminal version, and how to check it
- Run
pmset -g cap. If the list includesautorestart, your Mac supports restart after a power failure; if it also includesautorestartatconnect, it supports Always. - Turn on restart after a power failure with
sudo pmset -a autorestart 1. - For Always, on Macs that list it, use
sudo pmset -a autorestartatconnect 1. Set either back to0to turn it off. - Confirm with
pmset -g | grep autorestart. A 1 means on.
Older guides give sudo systemsetup -setrestartpowerfailure on. It is still documented, but on Apple silicon it has failed for some people with error -99, so pmset is the dependable route. Some guides also list -setrestartfreeze: that restarts the Mac after a system freeze, not after a power cut.
Test it once, properly
- Leave the Mac running with what it normally runs. Do not shut it down first; that would not be a power failure.
- Switch it off at the wall or pull the plug.
- Wait at least 30 seconds, then restore power.
- From another device, check that the Mac answers: a ping, an SSH login or Screen Sharing. On the Mac,
uptimeshows how long ago it booted.
Do this when you set the Mac up and after major macOS upgrades, not every week. A hard power cut is what you are preparing for, not something to rehearse.
On is not the same as back
With FileVault turned on, a Mac that starts after a power cut stops at the unlock screen and waits for a password. Until someone enters it, the data volume stays locked, so nothing stored there runs: not your apps, not third-party background services, not your normal SSH login.
On Apple silicon with macOS 26 or later there is a way through. If Remote Login was already on and the Mac has a network connection, you can unlock FileVault over SSH from another machine after the restart. The connection drops briefly while the rest of macOS starts. Ethernet is the safer bet for this than Wi‑Fi.
With FileVault off, turn on automatic login under System Settings → Users & Groups → “Automatically log in as”. macOS does not offer it while FileVault is on. Which way to go depends on what the Mac holds; the trade-off is laid out in FileVault vs automatic login on a headless Mac mini.
Bring your services back with it
Once the Mac is up and unlocked, what starts depends on how each service is installed. LaunchDaemons, in /Library/LaunchDaemons, start at boot before anyone logs in and have no windows. LaunchAgents and Login Items start when a user logs in, and only they can show a window or a menu bar icon.
That gives you a practical test. If a service has an app window or a menu bar icon, such as the Ollama app, Plex Media Server or Docker Desktop, it needs a logged-in session, so it needs automatic login. Command-line servers can run as a LaunchDaemon with RunAtLoad and KeepAlive set, and come up with no login at all.
Make every service retry rather than give up if the network is not there in the first seconds after boot. After an outage the router is often still starting when the Mac is already up.
With a UPS in the chain
A small uninterruptible power supply turns short outages into nothing at all. Connect it by USB and macOS shows UPS Options under Energy, where you choose to shut down after a number of minutes on battery or at a battery level.
The catch: a shutdown the UPS asked for is a clean shutdown, so After power failure does not bring the Mac back when mains power returns. There are two ways round it. Schedule a daily start-up with sudo pmset repeat wakeorpoweron MTWRFSU 07:00:00, so a Mac that stayed off is back the next morning at the latest. Or, on a Mac that offers Always, use that setting with a UPS that switches its outlets off after the shutdown, and test the whole sequence once.
Since Ventura the schedule is no longer in System Settings. pmset -g sched shows it and sudo pmset repeat cancel removes it.
What Wake on LAN can and cannot do
“Wake for network access” wakes a Mac that is asleep. It cannot start one that is shut down, so it is no substitute for the power settings above. Keep it on anyway, for the times the Mac does sleep; the details are in Wake on LAN on a Mac.
The unattended checklist
- Energy: restart after a power failure on, sleep set to never, wake for network access on.
- FileVault decided: automatic login with FileVault off, or Remote Login on so you can unlock over SSH.
- Services installed so they start by themselves, and set to retry.
- A daily scheduled start-up if a UPS can shut the Mac down.
- One real power-cut test, checked from another device.
SideMini’s Server mode sets the whole first line in one step, never sleep, restart after a power failure and wake for network access, and keeps a copy of your previous energy settings so one click puts them back.
Sources
- Apple — Change Energy settings on a Mac desktop computer ↗
- Apple — Turn on a Mac mini, Mac Studio or iMac without pressing its power button ↗
- Der Flounder — Automatic power-on with pmset on macOS 26.5 ↗
- Apple Platform Security — Managing FileVault in macOS ↗
- Apple — Set your Mac to log in automatically (FileVault note) ↗
- Apple Developer — Creating launchd daemons and agents ↗
- Apple — UPS options in Energy settings ↗