How to use a MacBook with the lid closed and no external display
By Janesh Kapoor · · 4 min read
An old MacBook is the cheapest always-on Mac most people already own. The problem is that closing the lid puts it to sleep, and Apple's official way round that needs an external display you do not want to buy, plug in or find desk space for. Here is what is actually happening, the three ways round it ranked by how much you will regret them, and how Servey removes the problem instead of working around it.
The behaviour is deliberate. macOS treats a closed lid as a signal that you have finished, and it sleeps the machine unless it can see a reason not to. Historically the only reason it accepted was clamshell mode: an external display, plus power, plus a keyboard or mouse. That made sense when a closed MacBook on a desk meant a docked workstation. It makes much less sense when you want the machine on a shelf answering requests, which is what people actually want from a spare laptop today.
| Method | What it needs | Honest verdict |
|---|---|---|
| Official clamshell mode | External display, power, and a keyboard or mouse | Reliable, but you are buying and powering a monitor you never look at |
| Dummy HDMI plug | A cheap headless display emulator, plus power | Works, costs a few pounds, and fixes the resolution problem too |
| pmset disablesleep 1 | Admin rights, a Terminal command, and remembering to undo it | Free and effective, but it is system-wide and easy to leave on by mistake |
| A remote tool that manages it for you | Servey, on macOS 15.3 or later | Opt-in, authorised once, and reverted automatically when you go offline |
The short answer: if the machine is staying on a shelf, sudo pmset disablesleep 1 with a cheap dummy HDMI plug is the free route and it works. If you want the lid handled without a permanent system-wide override you will forget about, Servey - the app we make - does it as an opt-in mode and puts the Mac's screen and shell on your iPhone or iPad at the same time. Either way it is worth understanding what that command really does before you paste it into a Terminal.
What does pmset disablesleep actually change?
It turns off the machine's ability to sleep entirely, for every reason, until something turns it back on. Running sudo pmset disablesleep 1 is not a lid setting - it is a global override that also stops idle sleep, and it persists across reboots. That is exactly what you want on a machine living on a shelf, and exactly what you do not want on the laptop you carry, because a MacBook that cannot sleep will run its battery flat in a bag and get warm doing it.
- sudo pmset disablesleep 1 - stop the machine sleeping at all, lid included.
- sudo pmset disablesleep 0 - put it back to normal behaviour.
- sudo pmset -g - check which of these is currently set.
How does Servey handle the lid?
Servey has a closed-lid mode that manages the same system setting for you, and the design of it is mostly about not leaving a mess behind. It is opt-in, so nothing changes unless you ask. It asks for administrator authorisation at the point the Mac goes online rather than silently changing a system-wide power setting behind your back. And it records what your settings were beforehand and restores them when it goes offline or quits, so your laptop goes back to sleeping normally the moment you stop using it as a server.
That last part is the difference between this and the Terminal command, and it is the whole reason the feature exists. The failure mode of pmset disablesleep is not that it does not work - it works fine. It is that six weeks later you take the machine to a cafe, it never sleeps in your bag, and you have long since forgotten you typed it. A setting that undoes itself when it is no longer needed is the same capability without the trap.
No external display and no dummy plug are required for the lid part: the Mac's screen goes straight to your iPhone or iPad, so the machine can sit closed on a shelf while you use it from the sofa. It connects on your local network directly and, from outside, over a private peer-to-peer connection between your own devices, including on carrier-grade NAT, without a VPN or port forwarding. There is also a real terminal one tap away, which on a headless machine is usually what you wanted anyway.
Is a MacBook or a Mac mini the better always-on Mac?
A Mac mini is the better machine and a spare MacBook is the better deal. The mini has no lid, no battery to age and no vent to block, so none of this arises. The argument for the laptop is that you already own it, and it has a built-in uninterruptible power supply, so a brief power cut that would drop a mini does not interrupt it. Either way it is the same app on both, and if you are setting up a mini we have written that up separately.
The honest limits on Servey: it is Apple-only, it needs macOS 15.3 on the Mac and iOS or iPadOS 18.5 on the device you control it from, and it launches soon rather than today. If you need a headless MacBook working this weekend, use pmset with a dummy plug and reach it with Screen Sharing over Tailscale. That combination is free, it works now, and it is what we would suggest to a friend who did not want to wait.
Frequently asked questions
- Can I use a MacBook with the lid closed and no external monitor?
- Yes, but not with default settings, because macOS sleeps the machine when the lid closes unless it sees an external display, power and an input device. The three ways round it are a dummy HDMI plug that pretends to be a monitor, the command sudo pmset disablesleep 1 which turns off sleep entirely, or a remote tool that manages the setting for you. Servey has an opt-in closed-lid mode that asks for authorisation when the Mac goes online and restores your original power settings when it goes offline.
- What does sudo pmset disablesleep 1 do?
- It stops the Mac sleeping at all, for any reason, until you set it back to 0. It is not a lid-specific setting: it is a system-wide override that also disables idle sleep and persists across reboots. That is right for a machine living on a shelf and wrong for a laptop you carry, because a MacBook that cannot sleep will flatten its battery in a bag. The usual mistake is not that the command fails but that people forget they ran it.
- Do I need a dummy HDMI plug?
- Not for the sleep behaviour if you use pmset or a tool that manages it, but it solves a second problem worth knowing about. With no display attached at all, macOS falls back to a default resolution that is often an awkward shape, so your remote desktop arrives small or letterboxed. A headless display emulator costs very little and presents a normal display to the system, fixing both issues at once. Servey streams the Mac's screen to an iPhone or iPad directly, so no external display is needed for the lid part.
- Is it bad for a MacBook to run with the lid closed all the time?
- There are two real trade-offs rather than a hard no. Heat, because a closed lid partially blocks the main vent, so give the machine airflow and do not stack anything on top of it. And battery, because a cell held permanently at full charge ages faster than one that cycles. Neither is dangerous, but both argue for a Mac mini if you are actually buying a machine rather than repurposing one you already own.
- Should I use a spare MacBook or buy a Mac mini for an always-on Mac?
- A Mac mini is the better machine and a spare MacBook is the better deal. The mini has no lid, no battery to age and no vent to block, so none of the problems in this article arise. The argument for the laptop is that you already own it and it has a built-in uninterruptible power supply, so a brief power cut that would drop a mini does not interrupt it at all.
Servey puts your Mac in your pocket. Launching soon.