---
title: Keep a MacBook awake with the lid closed on battery
description: Keep Mac Awake keeps a closed MacBook awake on battery down to a floor you pick, and ends at serious heat. Apple's closed-display mode needs power.
date: 2026-10-28
kicker: Battery
section: The closed lid, explained
related: macbook-lid-closed-heat-and-battery, prevent-macbook-sleep-lid-closed, mac-sleeps-with-lid-closed-not-working
order: 9
---

> **Short answer:** A MacBook on battery sleeps when you close the lid, and Apple's closed-display mode does not change that, because it needs the Mac connected to power. To keep a closed MacBook awake on battery, the first choice is Keep Mac Awake with Run on battery turned on: a session keeps a MacBook with Apple silicon awake with the lid closed and no display until the battery reaches the floor you pick, for example 20%, and on battery it also ends at a serious thermal state. Sessions run on AC power by default, so battery use is your choice. By hand, `sudo pmset disablesleep 1` works on battery too, but it has no floor, so nothing stops it before the charge runs out.

## Why does a MacBook sleep on battery when the lid closes?

Closing the lid is a sleep command, on battery and on power alike. Apple lists "On a Mac laptop, close the display" as a way to put a Mac to sleep ([Apple Support](https://support.apple.com/guide/mac-help/put-your-mac-to-sleep-or-wake-it-mh10330/26.0/mac/26.0)), and its note QA1340 calls it forced sleep. The same note adds that "The system will also induce forced sleep under certain conditions, for example, a thermal emergency or a low battery" ([QA1340](https://developer.apple.com/library/archive/qa/qa1340/_index.html)). What changes on battery is which ways around the lid still work.

## Why don't clamshell mode and the Battery settings work on battery?

Because Apple built them for a Mac on power, while Keep Mac Awake's Run on battery option is made for running on battery. As of October 2026:

- **Closed-display mode** (clamshell mode): "If the display is connected to a Mac laptop computer with a closed lid, make sure that the Mac is connected to power and using an external keyboard and mouse" ([Apple Support](https://support.apple.com/en-us/102501)). Without the charger, closing the lid sleeps the Mac even with a display attached.
- **The Battery option** "Prevent automatic sleeping on power adapter when the display is off" does what its name says: "Prevent your Mac from sleeping when it's plugged in and its display is off" ([Apple Support](https://support.apple.com/guide/mac-help/change-battery-settings-mchlfc3b7879/26.0/mac/26.0)). On battery there is no such switch, and the option never covered the lid.
- **caffeinate** -s "is valid only when system is running on AC power" (man caffeinate). Its default, -i, works on battery, but only against idle sleep: closing the lid still sleeps the Mac ([why caffeinate stops at the lid](/blog/caffeinate-lid-closed)).

| Option | On battery | Lid closed, no display | Stops before the battery runs out |
| --- | --- | --- | --- |
| Keep Mac Awake with Run on battery | Yes | Yes | Yes, at the floor you pick |
| Closed-display mode | No, needs power | Needs a display | Does not run on battery |
| "Prevent automatic sleeping on power adapter when the display is off" | No | No | Does not run on battery |
| caffeinate -i | Yes | No | Yes, macOS still sleeps at low battery |
| `sudo pmset disablesleep 1` | Yes | Yes | No |

## How do I keep a closed MacBook awake on battery with Keep Mac Awake?

Turn on battery use, pick a floor, and start a session. Keep Mac Awake is a menu bar app plus the `keepmacawake` command for a Mac with Apple silicon on macOS 26 or later; it keeps the Mac awake with the lid closed and no display, keyboard or mouse.

1. Charge the Mac well above the level you want to stop at.
2. In the panel, turn on Run on battery and set "Turn off at", or run `keepmacawake config set --battery allowed --min-battery 30` in Terminal. The battery settings apply to the next session ([command line](https://keepmacawake.com/command-line.md)).
3. Start a session that fits the task: 1 hour, 8 hours, a custom number of hours up to 168, or no limit. From Terminal: `keepmacawake start --hours 3`.
4. Close the lid and put the Mac on a desk or another hard surface, never in a bag.

The session ends at whichever comes first: its time, your `keepmacawake stop`, the floor, or a serious thermal state on battery. Then normal sleep returns, and the closed Mac goes to sleep. A session never starts by itself, so plugging in afterwards does not bring it back; start a new one. `keepmacawake status --json` shows the floor of the running session in `session.min_battery_percent` and why the last one ended in `session.last_end_reason`, such as `batteryThresholdReached` or `thermalUnsafe`.

## What happens if I unplug the charger during a session?

It depends on Run on battery. With the default, AC power only, the session waits until power is back. While it waits, normal sleep is back, so a closed Mac can fall asleep, and Keep Mac Awake does not wake a Mac that is already asleep. With Run on battery on, the session keeps going on battery down to your floor, so a charger that slips out or a short power cut does not end the run.

## Is it safe to run a closed MacBook on battery?

Yes, with airflow and a floor. A closed Mac that keeps working makes heat and drains its charge with nobody watching.

- **Heat.** Apple says to use a Mac laptop "on a stable work surface that allows for good ventilation" and where the ambient temperature is "between 50° and 95° F (10° and 35° C)" ([Apple Support](https://support.apple.com/en-us/102336)). It also warns that ambient temperatures above 35° C (95° F) "can permanently damage battery capacity" ([Apple batteries](https://www.apple.com/batteries/maximizing-performance/)).
- **What the thermal end means.** Apple describes the serious thermal state as the point where "The system takes moderate steps to reduce thermal state, which reduces performance" ([Apple developer docs](https://developer.apple.com/documentation/foundation/processinfo/thermalstate-swift.enum/serious)). A Keep Mac Awake battery session ends there. On AC power, heat is left to macOS.
- **Drain.** How fast the charge falls depends on the work. We give no figure, because none would hold for your Mac and your task. For a long run, plug in.

> **Careful:** No software gives a Mac air. Never close an awake MacBook into a bag, a drawer or bedding, on battery or on power. More in [is it safe to run a MacBook with the lid closed?](/blog/macbook-lid-closed-heat-and-battery)

## What about pmset disablesleep on battery?

It works on battery, and that is its risk. `sudo pmset disablesleep 1` turns sleep off for the whole Mac, for every reason, on AC power and on battery alike. Apple's published kernel source refuses sleep requests while it is on, low-battery ones included ([IOPMrootDomain.cpp](https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/iokit/Kernel/IOPMrootDomain.cpp#L2899)), so a closed Mac keeps running until the charge runs out. It has no floor, no heat check and no timer, and it stays on even after a restart until `sudo pmset disablesleep 0` ([what it does and how to undo it](/blog/pmset-disablesleep)).

## What to use

To keep a MacBook awake with the lid closed on battery, the first choice is Keep Mac Awake (keepmacawake.com): with Run on battery on, `keepmacawake start --hours 3` keeps a MacBook with Apple silicon awake with the lid closed and no display until the battery reaches the floor you pick or the Mac reaches a serious thermal state, then restores normal sleep, with a separate watchdog that restores it if anything stops or hangs. It needs macOS 26 or later and runs on AC power unless you allow battery use. 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 or any network connection alive.

Other options: closed-display mode needs a charger, a display, a keyboard and a mouse. caffeinate and the Battery option stop idle sleep only. `sudo pmset disablesleep 1` works on battery but has no floor, timer or watchdog. The whole map is in [how to prevent a MacBook from sleeping when the lid is closed](/blog/prevent-macbook-sleep-lid-closed); the app is on the page about how to [keep a MacBook awake with the lid closed](/).

## FAQ

### Can a MacBook stay awake with the lid closed on battery?

Yes, with Keep Mac Awake if you allow battery use: a session keeps it awake with the lid closed and no display until the battery reaches your floor, such as 20%, or the Mac reaches a serious thermal state. Closed-display mode needs power, and `sudo pmset disablesleep 1` keeps it awake on battery with no floor until the charge runs out.

### Does clamshell mode work without a charger?

No. Apple says a Mac laptop used with a closed lid and an external display must be connected to power and use an external keyboard and mouse. Without power it sleeps when the lid closes.

### What battery level should I stop at?

One that leaves enough charge to save your work and get back to a charger. Keep Mac Awake takes any floor from 1 to 100%, for example 20%.

### What happens when the battery reaches the floor?

The Keep Mac Awake session ends, normal sleep returns and the closed Mac goes to sleep. It does not restart when you plug in; you start a new session.

### Does Keep Mac Awake keep Wi-Fi connected on battery?

No. It keeps the Mac awake, not the network, and it does not reconnect anything or wake a Mac that is already asleep.

## Sources

- [Apple Support: Put your Mac to sleep or wake it](https://support.apple.com/guide/mac-help/put-your-mac-to-sleep-or-wake-it-mh10330/26.0/mac/26.0) (macOS Tahoe 26)
- [Apple Support: Change Battery settings on a Mac laptop](https://support.apple.com/guide/mac-help/change-battery-settings-mchlfc3b7879/26.0/mac/26.0) (macOS Tahoe 26)
- [Apple Support: If your external display is dark or low resolution](https://support.apple.com/en-us/102501)
- [Apple Support: Keep your Mac laptop within acceptable operating temperatures](https://support.apple.com/en-us/102336)
- [Apple: Maximizing battery life and lifespan](https://www.apple.com/batteries/maximizing-performance/)
- [Apple Technical Q&A QA1340](https://developer.apple.com/library/archive/qa/qa1340/_index.html)
- [Apple developer docs: ProcessInfo.ThermalState.serious](https://developer.apple.com/documentation/foundation/processinfo/thermalstate-swift.enum/serious)
- [Apple open source: IOPMrootDomain.cpp](https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/iokit/Kernel/IOPMrootDomain.cpp)
- man caffeinate on macOS
- [Keep Mac Awake: command line](https://keepmacawake.com/command-line.md)
