How to run a MacBook headless with the lid closed

By Matyas Rathonyi. Updated October 15, 2026. Guides

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.

Lid closedThe MacBook sleeps by default
Apple's rulePower, display, keyboard, mouse
RemoteSSH or Screen Sharing
$9.99 onceAfter a 7-day free trial

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 trial

Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or buy now, $9.99

SSH, Screen Sharing and an agent keep reaching a MacBook with nothing attached while its lid closes. SSH Screen Agent no display
Headless means awake with nothing attached.Remote sessions and agents need the Mac running. Close the lid on a default MacBook and all of them stop at once.

"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:

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:

  1. Power. The power adapter is connected.
  2. An external display. Connected and showing the desktop.
  3. An external keyboard. Wired or Bluetooth.
  4. 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.

Apple's clamshell mode: power, display, keyboard and mouse all attached, and the closed Mac keeps working. Power Display Keyboard Mouse Mac Apple: all four attached Headless with nothing attached: by default the closed Mac goes to sleep and work stops. Power? Display Keyboard Mouse Mac z Nothing attached: sleep
Apple's rule is all or nothing. With power, a display, a keyboard and a mouse attached, a closed MacBook keeps running. Take them away and closing the lid sleeps the Mac, which is exactly the headless case.

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 free

A 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

  1. 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.
  2. 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.
  3. 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.
  4. 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.

A phone or laptop reaches the closed Mac through Tailscale and connects over SSH or Screen Sharing. Every hop needs the Mac awake. You Tailscale Mac ssh screen every hop needs the Mac awake
Remote access finds the Mac, it does not wake it. Tailscale gives you a private path from anywhere, and Remote Login and Screen Sharing answer only while the Mac is running.

Headless MacBooks for agents, local models and builds

The reason most people want a headless MacBook today is to leave work running on it:

Run a MacBook headless with Clamshell

  1. Set up remote access with Remote Login or Screen Sharing, and Tailscale if you will be away. Test it with the lid open.
  2. Disconnect external displays and dummy plugs. With a display connected Clamshell pauses instead of arming.
  3. 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.
  4. 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 trial

Heat, 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.

A thermal gauge rises under sustained load. At serious or critical thermal pressure Clamshell disarms toward normal lid sleep. Thermal pressure serious: disarm
Thermal safety is always on. If macOS reports serious or critical thermal pressure, Clamshell disarms toward normal lid sleep and blocks arming until the Mac cools. pmset disablesleep has no such check.

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

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.