A headless MacBook runs with no monitor, keyboard or mouse attached, and you use it remotely over SSH or Screen Sharing. macOS does not do this with the lid closed by default: a closed MacBook sleeps unless it has power, an external display and an external keyboard and mouse. To run one headless with the lid shut, use a dummy display plug, sudo pmset disablesleep 1, or an app such as Clamshell for Mac, which needs no display or admin rights.
Clamshell for Mac keeps a closed MacBook awake and on the network while armed, with no monitor, dummy plug or sudo. Free for 7 days.
Download free trialApple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or buy now, $9.99
"Headless" comes from servers: a machine with no screen, keyboard or mouse that you reach over the network. A Mac mini is easy to run that way because it has no lid. A MacBook is harder. Its screen is built in, and closing the lid is a sleep switch. This page covers what Apple supports, why a closed MacBook sleeps, every option for running one with nothing attached, how to reach it remotely, and how to keep it cool. For a Mac that serves files or media around the clock, see using a MacBook as a home server with the lid closed.
What headless means on a MacBook
On a MacBook, headless usually means one of two setups:
- Lid open, nothing attached. The Mac sits on a shelf with the display off and you work over SSH or Screen Sharing. macOS supports this with its own settings, as long as the Mac does not idle to sleep.
- Lid closed, nothing attached. The Mac is folded shut on a desk or a shelf and still running. This is what most people searching for a headless MacBook want, and it is the case macOS does not support out of the box.
The jobs are the same either way: a coding agent such as Claude Code or Codex working through a task list, a local model server answering requests, a long build or test run, a download, or a small server.
What Apple's clamshell mode requires
Apple's built-in way to use a closed MacBook is what most people call clamshell mode. Apple's support page for a dark external display states the setup for a closed Mac laptop with a display connected: make sure the Mac is connected to power and using an external keyboard and mouse. That adds up to four things attached:
- Power. The power adapter is connected.
- An external display. Connected and showing the desktop.
- An external keyboard. Wired or Bluetooth.
- An external mouse or trackpad. Wired or Bluetooth.
That is a desk setup, not a headless one. Unplug the display and close the lid, and the Mac sleeps. The clamshell mode without an external display guide goes deeper on that gap.
Why a closed MacBook sleeps
Closing the display is one of Apple's documented ways to put a Mac laptop to sleep. In sleep the Mac is still on but uses much less power, and it stops running your programs. SSH sessions freeze, Screen Sharing disconnects, agents and builds pause, and a model server stops answering.
Lid-close sleep is separate from idle sleep. Keep-awake tools that only hold off idle sleep, such as caffeinate, do not stop a closed lid from sleeping the Mac. See why caffeinate does not work with the lid closed.
Ways to run a MacBook headless
Lid open, display off, free
In System Settings, Lock Screen, set Turn display off on power adapter when inactive, and in Battery, Options, turn on Prevent automatic sleeping on power adapter when the display is off, both from Apple's sleep settings guide. Headless with the lid up, on power. The simplest option if the lid can stay open.
Dummy display plug, a few dollars
An HDMI or USB-C dummy plug is a display emulator. Adafruit's costs $3.50, contains only an EDID chip and can present up to 3840 x 2160. The Mac sees a monitor, which also gives Screen Sharing a resolution. Apple's page still names power and a keyboard and mouse, so test it on your Mac. See dummy display plug vs an app.
sudo pmset disablesleep 1, free
Stops all sleep with nothing attached, lid closed and on battery. It is a global admin switch with no timer and no heat check, and it stays on across restarts until you turn it off. Forget it and the Mac stays awake in a bag. See what pmset disablesleep does and how to undo it.
Amphetamine, free
The App Store listing describes keeping a MacBook awake while its lid is closed. On Apple Silicon laptops its listing says Power Protect needs a separate download and installation. The latest version listed is 5.3.2 from November 10, 2023. See Amphetamine not working with the lid closed.
Clamshell for Mac, $9.99 once
Keeps an Apple Silicon MacBook on macOS 14 or later awake and on the network with the lid closed while armed, with no external display, sudo or admin password. Thermal safety is always on, and normal lid sleep returns when you disarm or quit. Arming is never saved across a restart.
Try it freeA dummy plug and Clamshell do not combine: Clamshell pauses instead of arming while an external display is connected, and a dummy plug counts as one. Pick one or the other. For a wider comparison, see Clamshell vs Amphetamine vs pmset.
Reach the headless MacBook remotely
- SSH with Remote Login. In System Settings, General, Sharing, turn on Remote Login, then set Allow access for to Only these users. Connect with
ssh username@hostname; Apple's guide shows the exact command below the Remote Login: On indicator and warns that remote login can make your Mac less secure. More in SSH into a MacBook with the lid closed. - The desktop with Screen Sharing. In the same Sharing settings, turn off Remote Management if it is on, since Apple says the two cannot be on at the same time, then turn on Screen Sharing and choose who may connect. Screen Sharing is compatible with VNC viewers.
- Away from home with Tailscale. Install Tailscale on the Mac (macOS Monterey 12.0 or later) and on your phone or laptop, signed in to the same account. Its Personal plan is free. SSH and Screen Sharing then connect over that private network.
- Test before you close the lid. Connect from the other device with the lid open first, so you know any failure later is sleep and not setup.
Apple's Wake for network access, in Battery, Options, is not a way to keep a headless MacBook reachable. It wakes a sleeping Mac for shared services; it does not keep agents or builds running. The SSH guide covers what Apple's page does and does not say.
Headless MacBooks for agents, local models and builds
The reason most people want a headless MacBook today is to leave work running on it:
- Coding agents. Start Claude Code or Codex inside tmux over SSH, close the lid, and check in from your phone. The tmux docs describe protecting programs from connection drops, but tmux cannot help once the Mac sleeps. See keeping Claude Code running with the lid closed and running AI agents overnight.
- Local models. Ollama, LM Studio, llama.cpp and MLX servers stop answering when the Mac sleeps, and most listen only on the Mac itself by default. See running a local LLM with the lid closed.
- Agents that need the screen. Headless does not have to mean no screen. With Clamshell armed and its Let agents use the screen while the lid is closed setting on, which is the default, computer use and the iOS Simulator keep working while the built-in display stays black. See can AI agents use the screen with the lid closed.
- Builds and downloads. Anything that would finish with the lid open finishes with the lid closed, as long as the Mac stays awake.
Run a MacBook headless with Clamshell
- Set up remote access with Remote Login or Screen Sharing, and Tailscale if you will be away. Test it with the lid open.
- Disconnect external displays and dummy plugs. With a display connected Clamshell pauses instead of arming.
- Arm so it stays armed. Arm from the right-click menu or the Arm Clamshell Shortcuts action: those stay active across lid openings until you disarm. Arming from the regular menu covers the next close only. From a terminal,
open "clamshell://arm"also arms it; the request is asynchronous, so check the menu bar before you close the lid. - Close the lid on a hard, open surface. The built-in display stays black, the Mac stays on the network, and opening the lid locks the Mac.
Know the limits. Clamshell does not detect agents or jobs, so it will not disarm when work finishes; wrap scripted jobs with open "clamshell://arm" and open "clamshell://disarm", or use its Shortcuts actions. If you restart the Mac remotely, Clamshell is not armed after the restart, so the next lid close sleeps the Mac as usual.
Clamshell keeps your Mac awake with the lid closed. Free for 7 days, then $9.99 once for one Mac. 14-day money-back guarantee.
Download free trialHeat, power and safety
A headless MacBook works with its lid shut, so it sheds heat through its body and vents. Apple's operating guidance for Mac laptops sets the baseline.
pmset disablesleep has no such check.- Temperature and surface. Apple says to use a Mac laptop at 10 to 35 °C (50 to 95 °F) ambient, on a stable work surface that allows good ventilation, and not in bed, on a pillow or under bedding. Do not cover it or block the vents. A closed bag fails all of that: see running a MacBook in a bag.
- Fans. On Mac laptops that have fans, Apple says they turn on automatically to cool critical components. Fans or not, the Mac relies on airflow around it, so keep it on a hard, open surface.
- Power for long jobs. Clamshell works on battery too, and its optional Disarm on low battery setting (off by default) lets the Mac sleep below a level you choose. Long agent runs and inference belong on the power adapter. See running lid-closed on battery.
- Turn the screen fully off if nothing needs it. An agent working over SSH does not need the screen. Turning off Clamshell's Let agents use the screen while the lid is closed setting sleeps the display with the lid closed, which uses less battery and keeps the Mac cooler.
- The full checklist is in is it safe to run a MacBook with the lid closed.
Frequently asked questions
Can you run a MacBook headless?
Yes, but not with the lid closed by default. Closing the lid sleeps a MacBook unless it is on power with an external display, keyboard and mouse attached. Run it headless with the lid open on power, with a dummy display plug, with sudo pmset disablesleep 1, or with a lid app such as Clamshell for Mac.
What does Apple's clamshell mode need?
Apple's support page for a closed Mac laptop with a display connected says to make sure the Mac is connected to power and using an external keyboard and mouse. Without that setup, closing the lid puts the MacBook to sleep.
Does a dummy HDMI plug make a MacBook headless?
A dummy plug is a display emulator: the Mac sees a monitor that is not there. It covers the display part of Apple's closed-lid setup for a few dollars, and gives Screen Sharing a resolution to show. Apple's page also names power and an external keyboard and mouse, so test it on your Mac before you rely on it.
How do I control a headless MacBook remotely?
Turn on Remote Login for SSH or Screen Sharing for the desktop in System Settings, General, Sharing. Away from home, put the Mac and your other device on the same Tailscale network. Either way the Mac has to be awake.
Is it safe to run a MacBook headless with the lid closed?
Follow Apple's operating guidance: 10 to 35 C ambient, a stable surface with good ventilation, and never on a bed, pillow or bedding. Use the power adapter for long jobs. Clamshell for Mac disarms toward normal lid sleep if macOS reports serious or critical thermal pressure.
Related guides
- MacBook clamshell mode without an external display
- Dummy display plug vs an app
- Can you SSH into a MacBook with the lid closed?
- Use a MacBook as a home server with the lid closed
- Can Ollama keep running with the MacBook lid closed?
- Is sudo pmset disablesleep 1 safe?
Sources checked October 15, 2026: Apple's external display support page, putting a Mac to sleep, sleep and wake settings, Remote Login, Screen Sharing and laptop operating temperatures; Adafruit's HDMI dummy plug listing; Amphetamine's Mac App Store listing; Tailscale's macOS install and pricing pages; and the tmux wiki. Clamshell behavior is described from its published facts. Clamshell is an independent app, not affiliated with or endorsed by Apple, Adafruit, Amphetamine's developer or Tailscale. Product names belong to their owners.