# Can you close a MacBook without it going to sleep?

*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](https://developer.apple.com/library/archive/qa/qa1340/_index.html)). 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](https://developer.apple.com/documentation/iokit/kiopmassertiontypepreventuseridlesystemsleep)).

## 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](https://support.apple.com/en-us/102501)).
- **`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](https://support.apple.com/en-us/102336)).

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](https://keepmacawake.com/blog/prevent-macbook-sleep-lid-closed?utm_source=hashnode&utm_medium=referral&utm_campaign=syndication&utm_content=prevent-macbook-sleep-lid-closed).

