Skip to content
Guide · 5-minute read

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.

Sources checked Saturday, 26 September 20265 min readBy Soubhik Biswas

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.

0 of 4 done
  1. Step 1 · Connect the power adapter

    Next up

    Clamshell mode needs the Mac on power. Check that it is charging before you go on.

  2. Step 2 · Connect an external display

    Turn the display on and make sure it shows your desktop.

  3. Step 3 · Close the lid

    The desktop moves to the external display and the Mac keeps running. Leave it on a hard, open surface, not in a bag or sleeve.

  4. Step 4 · Check that it stayed awake

    Terminal › pmset -g log

    pmset -g log records each sleep and wake with a reason. If it shows a sleep when you closed the lid, check the first two steps and Apple's guide for your model.

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 assertions lists every process asking macOS not to sleep. A browser keeping the screen on shows a PreventUserIdleDisplaySleep or NoDisplaySleep entry. caffeinate -i shows PreventUserIdleSystemSleep.
  • pmset -g prints 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.

Try it hereOr skip the settings: open AwakeTabWith the lid open, a tab is enough. The AwakeTab timer runs until you stop it. Kept in view in Chrome or Edge, it holds the display on, and the Mac skips idle sleep for as long as that lasts. The pill says "Screen awake" once the browser grants it, and "Paused — tab hidden" if you switch to another tab. No end time: it keeps the screen on until you stop it.Start this session

Questions

Not with its usual options. 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