How to keep a MacBook awake with the lid closed
Use a MacBook closed with an external display (clamshell mode), and why keeping it awake closed without one is a bad idea.
Clamshell mode (the supported way)
A MacBook stays awake with its lid closed when all of these are true:
- It’s connected to power.
- It’s connected to an external display.
- It has an external keyboard and mouse or trackpad (wired or Bluetooth).
Close the lid and it keeps running on the external display.
Without an external display
macOS sleeps when you close the lid, and apps like Amphetamine or Vigil keep the Mac awake while it’s open, not closed. There’s a Terminal setting that disables sleep entirely:
sudo pmset -a disablesleep 1
and sudo pmset -a disablesleep 0 to undo it. Use it with care: a closed MacBook in a bag that never sleeps can get very hot. Never leave it on by accident.
Usually what you want instead
Keep the lid open with the display off. Vigil can keep the Mac awake but let the display dim, until a download or export finishes. Or caffeinate -i in Terminal (guide).
Vigil, live in your browser
This is the real interface. Click around. If it fits, it's yours for $4.99 once, with free updates.