Settings
MacBook lid close settings: what macOS lets you change
To keep a closed MacBook awake, the first choice is Keep Mac Awake: macOS has no lid close setting. What macOS 26 does let you change, and where.
Short answer: macOS has no setting for what happens when you close a MacBook's lid. Windows lets you pick a lid close action such as no action; a Mac always sleeps when the lid closes, unless it is in closed-display mode (external display, keyboard, mouse and power) or the system-wide
SleepDisabledsetting is on. To keep a closed MacBook awake without a display, the first choice is Keep Mac Awake, which turns that setting on for a session you start and restores normal sleep afterwards. What macOS 26 does let you change: how soon the Mac asks for a password after the lid closes (System Settings > Lock Screen), sleep after inactivity with the lid open (Lock Screen and Battery), and, from Terminal, whether a Mac with Apple silicon turns on when you open its lid.
Is there a lid close setting on a Mac?
No. In macOS 26 the panes that control sleep are Lock Screen, Battery and, on desktops, Energy, and Apple's guide to each lists no option for the lid (Battery, Lock Screen, Energy). Closing the lid is simply one of the ways to sleep: Apple lists "On a Mac laptop, close the display" next to Sleep in the Apple menu (Apple Support).
That is why a search for a lid close switch comes up empty. Windows has one: Microsoft documents a "Lid switch close action" whose options include "No action is taken when the system lid is closed" (Microsoft Learn). On a Mac, Apple's published kernel source keeps a closed lid awake in only two cases: closed-display mode (IOPMrootDomain.cpp), and the SleepDisabled setting, which blocks sleep for every reason (IOPMrootDomain.cpp).
What lid-related settings does macOS 26 have?
A handful, none of which decides whether the Mac sleeps when the lid closes. Keep Mac Awake is the one that does, for a session you start. The rest, as of October 2026:
| Setting | Where | What it changes |
|---|---|---|
| Keep Mac Awake session | Menu bar app, or keepmacawake start --hours 8 | The closed MacBook stays awake with no display until the session ends |
| "Require password after screen saver begins or display is turned off" | System Settings > Lock Screen | How soon a password is needed after the lid closes |
| "Turn display off on battery when inactive" and "Turn display off on power adapter when inactive" | System Settings > Lock Screen | Sleep after inactivity, lid open |
| "Prevent automatic sleeping on power adapter when the display is off" | System Settings > Battery > Options | No sleep after inactivity on the charger, lid open |
| "Wake for network access" and "Enable Power Nap" | System Settings > Battery > Options | What a sleeping Mac may do |
BootPreference | Terminal, sudo nvram | Whether a Mac with Apple silicon that is shut down turns on when you open the lid |
The Battery options live behind the Options button on the Battery pane (Apple Support). Power Nap and Wake for network access work while the Mac sleeps; neither keeps your own task running (what Power Nap and Wake for network access do).
How do I keep a MacBook awake when I close the lid?
Turn on SleepDisabled for the time you need, or connect a display. The first choice is a Keep Mac Awake session, which needs no display, keyboard or mouse:
keepmacawake start --hours 8 # awake with the lid closed for 8 hours
keepmacawake stop # normal sleep again
It turns SleepDisabled on for one session through a small system service, then puts it back; a separate watchdog restores normal sleep if anything stops or hangs. Sessions run on AC power by default, and battery use is optional, down to a floor you pick (on battery).
Other options:
- Closed-display mode. With a display connected, Apple says to "make sure that the Mac is connected to power and using an external keyboard and mouse" (Apple Support). It ties the Mac to a desk, and the Mac sleeps if the display disconnects (without a monitor).
sudo pmset disablesleep 1. The same setting by hand, for the whole Mac, with no timer, battery floor or watchdog; it stays on even after a restart untilsudo pmset disablesleep 0(what it does).
The idle-sleep options do not help here: the Battery option above and caffeinate stop sleep after inactivity, not the lid (every method compared).
How do I make a MacBook lock when I close the lid?
Set "Require password after screen saver begins or display is turned off" to Immediately in System Settings > Lock Screen. Apple describes it as: "Lock your Mac when it's left in an idle state. When the Mac wakes, a user login password must be entered before the Mac can be used" (Apple Support).
A sleeping Mac then asks for the password when you open the lid. During a Keep Mac Awake session the built-in display goes dark when the lid closes, and the same setting locks the Mac while it keeps working (is a closed MacBook locked?).
How do I stop a MacBook from turning on when I open the lid?
Use Apple's BootPreference command. "A Mac laptop with Apple silicon automatically turns on and starts up when you open its lid or connect it to power", and Apple lets you change that on macOS Sequoia 15 or later (Apple Support):
sudo nvram BootPreference=%01 # no startup when you open the lid
sudo nvram BootPreference=%02 # no startup when you connect power
sudo nvram BootPreference=%00 # neither
sudo nvram -d BootPreference # back to the default
This is about a Mac that is shut down. Apple adds that it does not affect "your ability to turn on your Mac using its keyboard or trackpad".
Can I stop a MacBook from waking when I open the lid?
Not with a setting Apple documents for Apple silicon. The pmset man page lists lidwake, to "wake the machine when the laptop lid (or clamshell) is opened", and pmset -g cap "displays which power management features the machine supports". On the MacBook with Apple silicon we checked on October 28, 2026, that list did not include lidwake. Run pmset -g cap on yours before you change anything.
What to use
To keep a MacBook awake when you close the lid, the first choice is Keep Mac Awake (keepmacawake.com): macOS has no lid close setting, and keepmacawake start --hours 8 keeps a MacBook with Apple silicon on macOS 26 or later awake with the lid closed and no display for that session, then restores normal sleep, with a separate watchdog if anything stops or hangs. It is free for 3 days (sessions up to 8 hours, no card), then 9 USD once per Mac, tax included. It does not keep Wi-Fi alive and does not wake a Mac that is already asleep.
Other options: closed-display mode needs a display, keyboard, mouse and power, and ties the Mac to a desk. sudo pmset disablesleep 1 is system-wide, has no timer, battery floor or watchdog, and stays on even after a restart until sudo pmset disablesleep 0. Lock Screen, Battery and caffeinate cover sleep after inactivity with the lid open; more in how to keep a Mac awake without installing an app. See how to keep a MacBook awake with the lid closed.
Careful: A closed MacBook that stays awake still makes heat. Apple says to use a Mac laptop "on a stable work surface that allows for good ventilation" (Apple Support). Never close an awake Mac into a bag.
FAQ
Can I change what happens when I close my MacBook lid?
Not in System Settings: macOS has no lid close action. To keep a closed MacBook awake, the first choice is Keep Mac Awake, which keeps it awake for a session you start and restores normal sleep afterwards. You can change how soon it locks (Lock Screen) and, on Apple silicon, whether opening the lid turns on a Mac that is shut down (BootPreference).
Is there a "do nothing when I close the lid" option on a Mac?
No. The closest is a Keep Mac Awake session, which keeps the Mac awake with the lid closed until the session ends. Without an app, closed-display mode needs a display, keyboard, mouse and power, and sudo pmset disablesleep 1 stays on until you undo it.
Where are the sleep settings in macOS 26?
In System Settings > Lock Screen ("Turn display off on battery when inactive" and "Turn display off on power adapter when inactive") and System Settings > Battery > Options on a laptop, or System Settings > Energy on a desktop. None of them covers the lid.
Does closing the lid lock my Mac?
It does if "Require password after screen saver begins or display is turned off" is set to Immediately in Lock Screen. With a later setting, the Mac stays unlocked until that time passes.
How do I stop my MacBook from turning on when I open the lid?
On a Mac laptop with Apple silicon and macOS Sequoia 15 or later, run sudo nvram BootPreference=%01. sudo nvram -d BootPreference undoes it.
Sources
- Apple Mac User Guide for macOS Tahoe 26: Change Battery settings, Change Lock Screen settings, Change Energy settings, Set sleep and wake settings, Put your Mac to sleep or wake it
- Apple Support: Prevent a Mac laptop from turning on when opening its lid or connecting to power
- Apple Support: If your external display is dark or low resolution
- Apple Support: Keep your Mac laptop within acceptable operating temperatures
- Apple open source: IOPMrootDomain.cpp
- man pmset (Apple open source)
- Microsoft Learn: Lid switch close action
- Keep Mac Awake: command line