Amphetamine vs pmset vs MacHead: keeping a MacBook awake with the lid closed
Most "keep my Mac awake" questions are really two different questions wearing one coat:
- "Don't fall asleep during this task" — a download, a render, a long build, a presentation. The lid stays open; you just need idle sleep blocked for a while.
- "Run as a server with the lid closed, 24/7" — no display, no desk setup, weeks of unattended operation, reachable from your phone.
For the first question, Amphetamine and friends are excellent and this article will happily recommend them. For the second, they solve only the first layer of the problem — because closing the lid triggers clamshell sleep, a separate, lower-level mechanism that keep-awake assertions don't cover. Here's every realistic option, compared fairly.
- Task-length keep-awake → Amphetamine (or free, simple KeepingYouAwake)
- Free, manual, supervised → caffeinate / pmset
- Desk setup with a real monitor → clamshell mode + any keep-awake app
- Lid-closed 24/7 server, broken screen, remote access → MacHead (full disclosure: that's us — the comparison below is still honest)
The contenders
caffeinate (built into macOS)
Apple's own command-line tool. caffeinate -i blocks idle sleep while it runs; free, zero install, scriptable. But it's a terminal command you babysit, and like every assertion-based tool it does not survive a closed lid on a machine without an external display setup. Best for: a one-off long task from the terminal.
Amphetamine (App Store)
The polished GUI keep-awake app: sessions, schedules, triggers (apps, disks, downloads), and years of refinement. For keeping a Mac awake during work, it's the one to beat. Its limits show up in the server scenario: it's built around awake-ness, not headless operation — no internal-display management as a server feature, no web console, no tunnels, no battery-guard logic for unattended weeks. Its closed-display mode comes with caveats and helper components, and still assumes a machine you'd normally sit at. Best for: power users keeping a working Mac awake, lid open.
KeepingYouAwake (open source)
A tiny, free menu-bar wrapper around caffeinate with a timer. Lovely for what it is — and what it is, is idle-sleep blocking only. No lid-closed operation, no server tooling. Best for: "stay awake for the next two hours," nothing more.
pmset disablesleep (manual)
sudo pmset -a disablesleep 1 is the raw system lever the lid-closed guides reach for. It genuinely works with the lid shut — and it's a global, sticky switch with no safeguards: lose mains power and the machine runs the battery into the ground; system updates and forgetfulness can leave it on (or off) at the wrong time; reverting is another sudo you must remember. Best for: a supervised test, not a permanent setting.
Dummy HDMI plug
A ~$5 dongle that pretends to be a monitor, unlocking clamshell mode without a real display. A legitimate trick — the only hardware on this list. But the Mac now renders a desktop nobody sees, a port is occupied, and battery protection, remote access, and monitoring are still unsolved problems you get to solve separately. Best for: a dedicated machine on a desk where a fake display is harmless.
MacHead (open source, ours)
MacHead starts from the other end: it's not a keep-awake app, it's a headless workstation mode. One click turns the internal display off, handles lid-closed operation, locks the built-in keyboard/trackpad, and mutes the mic. Around that core it wraps the things a server needs and the options above lack: a battery guard that restores normal sleep at low charge (the pmset failure mode, designed out), temperature alerts, a LAN web console with a generated admin password, remote access via Cloudflare Tunnel / Dev Tunnels / FRP, and monitoring integrations (ServerStatus, Uptime Kuma). It also works when the internal screen is broken — the case where every alternative above runs out of road. The honest trade-offs: it's a younger, smaller project than Amphetamine, and if you only need "awake for an hour," it's more tool than you need.
Side by side
| Capability | caffeinate | Amphetamine | KeepingYouAwake | pmset manual | Dummy plug | MacHead |
|---|---|---|---|---|---|---|
| Blocks idle sleep | Yes | Yes | Yes | Yes | — | Yes |
| Runs with lid closed (no real display) | No | Partial, with caveats | No | Yes | Yes | Yes |
| Turns internal display off | No | No | No | No | No (renders fake one) | Yes |
| Works with a broken screen | No | No | No | Partial | Partial | Yes |
| Battery guard (low-charge sleep) | No | No | No | No | No | Yes |
| Remote access built in | No | No | No | No | No | Yes (3 tunnel options) |
| Web console / monitoring | No | No | No | No | No | Yes |
| Price | Free (built-in) | Free + IAP | Free | Free | ~$5 | Free |
| Open source | No | No | Yes | — | — | Yes (Apache-2.0) |
So which should you pick?
- You use your Mac daily and just hate sleep timers: Amphetamine. It's the best tool for that job, full stop.
- You need one long task to finish:
caffeinate -iin a terminal, or KeepingYouAwake if you prefer a menu bar. - You have a desk, a monitor, and a working screen: clamshell mode with power and peripherals, plus any keep-awake app, is a fine server-ish setup.
- The machine's job is to be a server — lid closed, possibly broken-screen, unattended for weeks, reachable from anywhere: that's the headless case, and it's what MacHead is built for. Our full setup walkthroughs: 24/7 AI agent server guide and the broken-screen MacBook guide (中文).
FAQ
Why doesn't Amphetamine keep my MacBook awake with the lid closed?
Amphetamine blocks idle sleep via power assertions; a closing lid triggers clamshell sleep, a lower-level mechanism assertions don't cover. Its closed-display mode exists with caveats, but the app is designed around keeping a Mac awake for tasks — not display-off headless serving with battery protection and remote access.
Is pmset disablesleep safe to leave on?
It works, but it's a global sticky switch with no safeguards: on battery it will drain the pack completely, and you must remember to revert it. Fine supervised; risky as a permanent 24/7 setting.
Is a dummy HDMI plug worth it?
It's a legitimate, cheap trick to unlock clamshell mode. Downsides: a fake desktop being rendered, an occupied port, and battery/remote/monitoring still unsolved.
Can I just use Amphetamine with an external display?
Yes — with a working screen, monitor, power and peripherals, clamshell + keep-awake is a perfectly good desk setup. Headless tooling matters when there's no working display or the machine must run unattended.
What if the screen is already broken?
Then most options above are off the table. MacHead turns the internal display off entirely and works through a virtual display, web console and tunnels — see the broken-screen guide.
Running a lid-closed server? MacHead is free and open source (Apache-2.0), Apple Silicon & Intel, macOS 12+.
Download MacHead GitHub Read the agent-server guide