Keep your Mac awake for mining: caffeinate, pmset and Energy settings
Verified with T@H 3.7.0 on macOS 26.6.2 (September 30, 2026)
Published October 6, 2026 · 6 min read
If you only read one section of this guide, make it this one. A Mac that sleeps overnight is, by a wide margin, the easiest way to lose an entire night of training without noticing.
Why this matters: Train at Home doesn't keep itself awake
On a Mac actually running the miner, checking pmset -g assertions shows sleep-prevention assertions coming only from generic system daemons (powerd, runningboardd) or from a separate tool such as caffeinate — never from the Train at Home app or its worker process directly. The official FAQ confirms this is expected behavior, not a bug: "Training stops automatically. Nothing continues running when the app is closed or your computer goes to sleep."
So the app assumes something else is keeping the Mac awake. If nothing is, your Mac will sleep on its own schedule and training stops the moment it does. This guide covers the two ways to fix that: a Terminal command (caffeinate), or a System Settings toggle.
caffeinate, flag by flag
Everything below is taken directly from man caffeinate on macOS — not summarized secondhand:
| Flag | What it does, per the manual |
|---|---|
-d |
Create an assertion to prevent the display from sleeping. |
-i |
Create an assertion to prevent the system from idle sleeping. |
-m |
Create an assertion to prevent the disk from idle sleeping. |
-s |
Create an assertion to prevent the system from sleeping. Valid only while running on AC power. |
-u |
Declare that the user is active. If the display is off, this turns it on and prevents it from idle-sleeping. Without -t, this assertion defaults to a 5-second timeout — i.e. a genuinely momentary effect. |
-t <timeout> |
Sets how many seconds an assertion stays valid before being dropped. Not used at all when a utility (a trailing command) is given to caffeinate. |
-w <pid> |
Wait for the process <pid> to exit, then release the assertion. Ignored when a utility is given. |
Two details worth internalizing, because they change how people misuse this command:
- Calling
caffeinatewith no flags at all only prevents idle sleep — it does nothing for the display or for AC-only system sleep, which is rarely what you actually want for an overnight run. -uby itself is close to useless for a long run: it resets the idle timer once, for about 5 seconds, and then stops mattering. It's meant to simulate a single moment of user activity, not to hold the Mac awake continuously.
The recommended command
For a Mac meant to train for a long, unattended stretch, the combination that matches what "keep it awake" actually means is:
caffeinate -dims
That's display sleep, idle system sleep, disk idle sleep, and AC-only system sleep, all prevented for as long as this caffeinate process runs — no timeout, since none was given. Run it plainly in a Terminal window and leave that window open for the duration you want.
If you specifically also want to simulate periodic user activity (for example, to stop a screen lock tied to inactivity rather than to sleep), add -u -t <seconds> with an explicit duration — without a duration, remember, -u only lasts 5 seconds.
A few practical ways to run it
- Foreground, simplest: open Terminal, run
caffeinate -dims, and leave that window open. Closing the window ends the command and releases the assertions. - Tied to the app's own lifetime:
caffeinate -dims open -W -a "IOTA Train at Home"runsopen -W, which waits for the app to quit, as caffeinate's "utility" — so the assertions last exactly as long as the app is open, and release automatically when it quits. (This usesopen's own-W/-aflags, which aren't specific to Train at Home.) - Tied to a specific process ID:
caffeinate -dims -w <pid>releases the assertions once that process exits — useful if you already know the app's PID and aren't using a trailing utility command. - Survive closing the Terminal window: a plain background job (
caffeinate -dims &) is still tied to that Terminal session and can be interrupted when the window closes;nohup caffeinate -dims > /dev/null 2>&1 &detaches it so it keeps running after you close the window.
Verify it's actually working
Don't just assume the command did what you expect — check it:
pmset -g assertions
Look for caffeinate as the owner of PreventUserIdleSystemSleep, PreventUserIdleDisplaySleep, and/or PreventSystemSleep, depending on which flags you used. A process holding an assertion with no timeout is typically described as "asserting forever."
pmset -g
This shows your Mac's current effective settings — sleep, displaysleep, disksleep, and who (if anyone) is currently preventing each kind of sleep. If sleep shows as prevented and caffeinate (or another expected owner) is listed as the reason, you're set.
The System Settings alternative
If you'd rather not keep a Terminal command running at all, macOS has a built-in equivalent: System Settings → Energy → "Prevent automatic sleeping when the display is off." This is a general macOS setting, not something specific to Train at Home, and it achieves a similar practical outcome to caffeinate -dims without a Terminal window.
Two things that can undermine either approach
Separately, Wi-Fi power-saving behavior wasn't verified on a real Mac for this guide (telling Wi-Fi and Ethernet apart reliably needs networksetup -listallhardwareports, outside what this guide's research covered) — it's a general caution worth knowing about, not a measured result: some configurations let Wi-Fi power-saving drop or throttle a connection earlier than full system sleep would.
Checklist
- Confirm nothing is currently preventing sleep on your Mac:
pmset -g assertions. - Pick one method:
caffeinate -dimsin an open Terminal window, or System Settings → Energy → the sleep-prevention toggle. - If using
caffeinate, decide how you want it to end: manually (close the window), tied to the app (open -W -a), or tied to a PID (-w). - Re-check with
pmset -g assertionsandpmset -gthat the assertion is actually active. - Turn off Low Power Mode while training.
- Keep the Mac on AC power —
-sonly holds while on AC power anyway. - If you're on Wi-Fi, keep an eye out for connection drops as a possible (unconfirmed) power-saving side effect.
For everything else that affects a steady setup — install, network, bandwidth, monitoring — see the full optimal setup guide. If you haven't installed Train at Home yet, start with the install guide.
Sources
Related guides
Want to see this on your own Mac?
subnera shows the real queue position and phase in your menu bar.
Install subnera