Skip to main content

Can you close a MacBook without it going to sleep?

Yes, even with no display attached. Why the lid is forced sleep, what gets past it, and what only stops idle sleep.

Updated 3 min readMarkdown

A short answer from the Keep Mac Awake team, written with the help of an AI writing program and checked against the Apple sources linked below.

Short answer: Yes. The first choice is Keep Mac Awake: start a session from the menu bar or run keepmacawake start --hours 8, then close the lid; it keeps a MacBook with Apple silicon on macOS 26 or later awake with no display, keyboard or mouse, on AC power or on battery. Otherwise a closed lid puts a MacBook to sleep unless the Mac is in Apple's closed-display mode or the system-wide SleepDisabled setting is on; on AC power, caffeinate -s holds it in dark wake instead.

Why does the lid beat most keep-awake settings?

Closing the lid is forced sleep, not idle sleep. Apple's note QA1340 says "Closing the lid on a laptop or selecting sleep from the Apple menu both cause forced sleep" (QA1340). Most keep-awake tools hold a power assertion against idle sleep, and Apple's documentation for it adds "The system may still sleep for lid close" (Apple developer docs).

What gets past the lid?

  • Keep Mac Awake. A session turns the system-wide SleepDisabled setting on for its length, on AC power or on battery, then restores normal sleep when it ends, with a separate watchdog that restores it if Keep Mac Awake's background service or the system service stops or hangs.
  • Closed-display mode. Apple's way, with an external display, keyboard, mouse and power connected (Apple Support).
  • sudo pmset disablesleep 1. The setting Keep Mac Awake uses, switched on by hand for the whole Mac: no timer, no battery floor, no watchdog, and it stays on, even after a restart, until you run sudo pmset disablesleep 0.
  • caffeinate -s on AC power. It holds a closed Mac in dark wake with the display off while caffeinate runs and the adapter is connected; once you unplug, the Mac sleeps.

What does not?

caffeinate -i, the Battery option "Prevent automatic sleeping on power adapter when the display is off", and apps that hold idle-sleep power assertions keep an open Mac awake. Once the lid closes, they leave the Mac to sleep.

Careful: A closed MacBook that stays awake still makes heat. Leave it on a desk with airflow, never in a bag or under bedding (Apple Support).

Every way compared side by side, with what each needs and where it stops, is on keepmacawake.com: keep a MacBook from sleeping when the lid is closed.

About the author

  • Keep Mac Awake is a Mac menu bar app and command line tool that keeps a MacBook awake with the lid closed for a session you start. These guides explain Mac sleep, pmset and long jobs with the lid closed, and first appear on keepmacawake.com.

No comments yet. Be the first to comment.