Skip to content
86% off$349 $48.86code BF2026

Guides

Prevent a Mac mini From Sleeping Overnight (Home Server)

Keep a Mac mini home server awake overnight: the Energy setting, pmset schedules and auto log-out that still shut it down, and rules for hours or apps.

GuideUpdated 8 min read

On this page

You have a Mac mini running as a home server, a Roon core or a backup target, and you want to know how to stop it from sleeping overnight. Many people reach for a keep-awake app first, but this is mostly a settings question. The app only matters when you want the mini awake during set hours, or only while a particular server or job runs.

Why a Mac mini sleeps overnight

Most to least common:

  1. The idle sleep timer. By default a desktop Mac sleeps after a period of inactivity. The Energy setting controls this.
  2. A repeating pmset schedule. Someone, possibly you years ago, set a nightly sleep or shutdown time. It overrides "never sleep."
  3. Automatic log-out. macOS can log you out after inactivity. If your server app runs inside your login session, logging out quits it, and the mini looks like it stopped.
  4. A manual sleep. Apple menu Sleep or the power button sleeps the Mac regardless of any setting.
  5. A power cut. The mini restarts or stays off, and nothing launches until you log in.

If your mini wakes every 5 to 10 minutes instead, that is a wake problem, not a sleep problem. See the last fix section.

Fix 1: Use the macOS Energy setting

  1. Open System Settings and search for "Energy". On a desktop Mac this opens the pane with the sleep options.
  2. Turn on the option that prevents automatic sleeping when the display is off. The wording differs between Sonoma, Sequoia and Tahoe, so match the meaning, not the exact label.
  3. In the same pane, look for an option to start up automatically after a power failure and turn it on if it is there.

The display can still turn off while the Mac stays awake. For many home servers this is the whole fix.

Fix 2: Remove the things that still shut it down

A repeating sleep or shutdown schedule

List scheduled power events in Terminal:

bash
pmset -g sched

This only prints; it changes nothing. Copy the output somewhere first. To clear a repeating schedule:

bash
sudo pmset repeat cancel

This deletes your repeating power schedule. To undo it, recreate the schedule from your copy with pmset repeat.

Automatic log-out

Open System Settings, search for "log out automatically", and make sure the inactivity log-out is off.

Find out what is holding the Mac

bash
pmset -g assertions

This lists the sleep-blocking assertions apps have made. It changes nothing.

Which method fits

MethodGood forWatch out for
macOS Energy settingA mini that should never idle-sleepCan't limit awake time to certain hours or to while an app runs
Amphetamine (free, Mac App Store, as of November 2026)Timed or app-based sessions, many trigger typesLast updated November 2023 (as of November 2026)
caffeinate (built in)Staying awake while one command runs, such as caffeinate -i rsync …Lasts only as long as the command or Terminal session
GlowmothIndefinite session, overnight or app-based rules, seeing other apps' sleep blockersCan't wake a sleeping Mac, remove a pmset schedule or stop an auto log-out

If the Energy setting works, stop there. For the built-in options see Mac sleep settings explained, and for flags see the caffeinate command guide. We make Glowmoth, so weigh our view accordingly; for a side-by-side with the free app, see Amphetamine vs Glowmoth.

Fix 3: Keep it awake with Glowmoth

Glowmoth is a menu bar app that needs macOS 14 or later. It holds one power assertion that blocks idle sleep and tells you why the Mac is awake. On a mini it covers an indefinite session, rules, wrapping a command, and listing what else holds the Mac awake. It does not wake a Mac that is already asleep, clear a pmset schedule, turn off auto log-out, or block manual sleep. Closed-lid mode is for laptops only.

Start an indefinite session

  1. Right-click the moth icon in the menu bar and choose Indefinitely under Keep This Mac Awake. Or left-click to open the panel and use the Keep Awake switch, which starts your default duration (Indefinitely unless you changed it).
  2. If the mini is headless or you want the screen off, open Show More in the panel and turn off Keep Display On. With it off, only idle system sleep is blocked.

To make that the default, go to Settings > Sessions > Display and turn off Keep the display on.

To check, run pmset -g assertions. You should see an assertion named like "Glowmoth: Session until you stop it".

Keep it running after a restart

Open-ended sessions are not restored after you quit or restart Glowmoth. Set this up once:

  1. Go to Settings > General > Startup and turn on Launch at login.
  2. Turn on Keep awake when Glowmoth opens, which starts your default duration.

Launch at login only happens when you log in, so after a power cut the mini must log in to your account. macOS has an automatic login option (search System Settings for "automatically log in"), but it has security trade-offs, so that decision is yours. If login-item setup fails, Glowmoth says "Allow Glowmoth in Login Items." and offers Open Login Items.

Or use a rule: only overnight, or only while the server runs

Use Settings > Automation. Outside the rule, your macOS energy settings decide when the mini sleeps.

While a server app runs (for example Roon Server):

  1. Open Apps, choose Add App, then pick the app (or Choose App…).
  2. Leave While on Running. Then Wait defaults to 1 Min, so the Mac stays awake briefly after the app quits.

For a command-line server, use Processes: type the executable name and click Add.

During a time window:

  1. Open Rules > Add Rule > Custom Rule… and give it a name.
  2. Choose Add Condition > During Hours, pick the days, and set From 22:00 and To 07:00. Overnight windows are allowed.
  3. Add App Running as a second condition if you want both. All conditions are true requires both; Any condition is true needs either.

Backups and scripts

Install the command-line tool from Settings > Advanced > Command Line > Install. It links to ~/.local/bin/glowmoth; add that folder to your PATH if glowmoth isn't found. Then wrap the job:

bash
glowmoth run -- rsync -a ~/Music /Volumes/Backup

This holds the Mac awake while the command runs and returns the command's exit code. If the app isn't running, run takes its own power assertion. Replace the rsync line with your own job. See the command-line docs.

A job scheduled for 3 a.m. only runs if the Mac is awake then. A rule or indefinite session keeps it awake, but Glowmoth can't wake a mini that has already gone to sleep.

Keep external drives from spinning down

For a music library or backup disk on an external drive, go to Settings > Advanced > Drives, turn on Keep drives from sleeping, then use Add Drive…. Glowmoth writes a tiny hidden file (.glowmoth-keepalive) to the drive every 4 minutes by default (1 to 30 allowed). See drive keep-alive.

See what else is involved

In the panel, Show More has Also Keeping This Mac Awake. It lists other apps holding sleep blockers with a plain purpose such as "downloading" or "backing up", and flags traps: "Scheduled to sleep/shut down/restart at …", "Set to sleep every day / on weekdays / … at …" and "Logs out after N minutes of inactivity." Glowmoth reports these but doesn't remove them; you change them in macOS. More in what's keeping my Mac awake.

Checklist before you try again

  • Energy setting prevents automatic sleep with the display off.
  • pmset -g sched shows no repeating sleep or shutdown.
  • Inactivity log-out is off.
  • Glowmoth is licensed or in trial, and Keep awake automatically is on.
  • Launch at login and Keep awake when Glowmoth opens are on.

If it still sleeps

CauseSymptomFix
Trial ended or license not verifiedPanel says "Your trial has ended…" or "Your license couldn't be verified…"Enter the license; Glowmoth holds nothing until then, including for glowmoth run. A licensed app works offline up to 7 days between checks.
Manual mode or Stop EverythingRules and apps do nothingSwitch the panel to Automatic, or start a session
Safety pauseIcon shows a slashHeat limit pauses after 60 s of serious thermal pressure; adjust in Settings > Safety
Session ended after restartAwake before, asleep nowEnable launch at login and start-on-open
Manual sleepSlept when someone chose itApple menu Sleep and the power button still work

For a mini that wakes every few minutes, Glowmoth doesn't diagnose why. Run pmset -g log for recent sleep and wake events and pmset -g assertions to see who holds it.

If nothing works

Contact Apple Support for Mac power behavior, or the server app's vendor if the app itself quits. For Glowmoth, use MacSuite support. Include your macOS version, the output of pmset -g sched, pmset -g assertions and pmset -g log, and what you already tried.

text
Hi, my Mac mini (macOS 15, Apple silicon) still sleeps overnight.
Energy setting is on, no pmset schedule (pmset -g sched is empty),
Glowmoth session set to Indefinitely. The Mac is asleep by 3 a.m.
Output of pmset -g log and pmset -g assertions attached.

Common questions

Is Amphetamine the best solution for an always-on server?

Not necessarily. The Energy setting often does the job without an app. Amphetamine is free and has many triggers, but its last update was November 2023 (as of November 2026).

Will Glowmoth wake my Mac mini at a set time?

No. It keeps an awake Mac awake. Wake-at-time needs privileges it doesn't get in normal installs.

Do I need Keep Display On for a server?

No. Turn it off and only idle system sleep is blocked, so the display can sleep.

Glowmoth is part of MacSuite; you can try it free for 7 days.

Every app.
One purchase.