Keep a Mac awake with the lid closed: what works
No web page or browser extension can keep a Mac awake after you close the lid: closing it puts the Mac to sleep whatever the browser asks. The supported way round it is clamshell mode, with the Mac on power and an external display connected. Terminal settings and some apps can go further, at a cost in heat and battery. With the lid open, a visible tab is enough.
Use clamshell mode in 4 steps
Apple calls this closed-display mode. Apple's guide lists what your model needs. We have not checked every model's requirements, so read it for yours.
If it still sleeps or you can't change the settings
Make sure the adapter is charging and the external display is on and showing your desktop before you close the lid.
On a work or school Mac without admin rights, sudo pmset will ask for a password you don't have, and energy settings may be set by a profile. Ask your IT team. Clamshell mode and a visible tab need no admin rights.
Why closing the lid wins
Apps keep a Mac awake by holding a power assertion, a note to macOS that says "don't sleep yet". Chrome holds one while a page keeps the screen on, and caffeinate creates the same kind from Terminal. These assertions stop idle sleep: the sleep that follows a stretch with no keyboard or mouse input.
Closing the lid is not idle: it is a direct request to sleep. So the browser, AwakeTab for Chrome and caffeinate with its usual options all stop at the lid.
Other options, safest first
Keep the lid open with the screen dimmed
Turn the brightness down to its lowest and leave the lid open. Then either keep a tab visible, or run caffeinate -di in Terminal to stop both display and idle sleep until you press Control-C. caffeinate -i alone keeps the Mac awake and lets the screen turn off.
An app with a closed-display option
Amphetamine, from the Mac App Store, has a closed-display mode option (as of 26 September 2026). Read its own help for what it needs on your Mac. Caffeine for Mac holds a power assertion like caffeinate does, so it keeps the Mac awake with the lid open only; see AwakeTab vs Caffeine.
The pmset switch (advanced)
sudo pmset -a disablesleep 1 is widely used to stop a Mac sleeping at all, lid included. It is not described in the pmset manual, so Apple can change or remove it. It needs an administrator password. Turn it off with sudo pmset -a disablesleep 0 as soon as you are done.
Heat and battery
A closed Mac that stays awake still makes heat. Inside a bag or sleeve it has nowhere to go, so never keep one awake there; use a hard, open surface. On battery, a Mac that cannot sleep drains until it shuts down, and unsaved work goes with it. Clamshell mode avoids the battery problem because it needs the power adapter.
Confirm what is keeping it awake
pmset -g assertionslists every process asking macOS not to sleep. A browser keeping the screen on shows a PreventUserIdleDisplaySleep or NoDisplaySleep entry.caffeinate -ishows PreventUserIdleSystemSleep.pmset -gprints your current settings. After using the pmset switch, check it is off again.
If the job runs out of sight, AwakeTab for Chrome at its System level keeps the Mac awake with the tab hidden while Chrome runs. For long builds and agents, keeping your computer awake for an AI agent compares the options. The full Mac setup is on the macOS page.
Questions
caffeinate -i or caffeinate -di stops idle sleep while the lid is open. Closing the lid is not idle time, so the Mac sleeps anyway unless it is in clamshell mode with power and an external display.Soubhik Biswas · Builds AwakeTab. Sources checked Saturday, 26 September 2026. About AwakeTab