Skip to content
All postsGuides

How to Keep Your MacBook Running with the Lid Closed: Complete Clamshell Mode Guide

Sumit Kumar
Sumit Kumar5 min read
How to Keep Your MacBook Running with the Lid Closed: Complete Clamshell Mode Guide

Why Does Your MacBook Sleep When the Lid Closes?

By default, closing your MacBook's display triggers sleep mode to conserve battery, prevent thermal buildup inside a backpack, and lock your user session.

However, many users want their Mac to keep working with the lid closed—whether driving an external monitor at a desk (clamshell mode), running a long render or download, or using it as a low-power home server.

Here is exactly how to keep your Mac awake with the lid closed on macOS Sequoia and earlier.

1. Apple's Official "Clamshell Mode" (With an External Monitor)

If you want to use your MacBook with the lid closed at your desk, Apple natively supports closed-display mode, but only when three conditions are met:

  • Power Connection: Your MacBook must be connected to power via MagSafe or a USB-C / Thunderbolt charger.
  • External Display: An external monitor must be connected via HDMI, DisplayPort, or Thunderbolt.
  • External Peripherals: An external keyboard and mouse/trackpad (Bluetooth or USB) must be paired.

Once these three are connected, simply close the lid. The external monitor will flicker for a second and then become your primary desktop.

2. Keeping Your Mac Awake Without an External Monitor (caffeinate)

What if you want to close your lid to download a game, back up files to Time Machine, or finish a video export without connecting a monitor?

macOS includes a native Terminal utility called `caffeinate` that prevents sleep without needing third-party kernel extensions:

  1. Open Terminal (press Cmd + Space, type Terminal).
  2. Type the following command and press Enter:
caffeinate -d
  1. As long as this Terminal window remains open, your Mac's display and system will stay awake.
  2. When your task is finished, press Ctrl + C in Terminal to cancel it.

To keep it awake for a specific duration (for example, 2 hours = 7,200 seconds):

caffeinate -u -t 7200

3. Recommended macOS Battery Settings

To prevent unexpected sleep interruptions while working on battery:

  • Open System Settings > Energy Saver (or Battery > Options).
  • Toggle on Prevent automatic sleeping when the display is off.
  • Toggle on Wake for network access if you stream media or connect via SSH.

4. Thermals and Battery Longevity on Apple Silicon

A common concern is whether running a MacBook closed damages the display:

  • Apple Silicon (M1, M2, M3, M4): These chips run exceptionally cool compared to older Intel MacBooks. Apple specifically designs the cooling exhaust vents at the display hinge to direct heat away from the panel.
  • Best Practice: If you are pushing heavy multi-hour 3D renders or 4K video exports, propping the lid slightly open can improve fan airflow and lower fan noise.

Summary

For everyday desk setups, Apple's built-in clamshell requirements are all you need. For headless background downloads or exports, the native caffeinate terminal command provides a clean, safe solution without third-party bloat.

Ledge for macOS

Your notch, put to work.

Ledge turns your Mac's camera cutout into a native drag & drop shelf, music controller, clipboard manager, and live activity hub. Built natively in Swift. Free while in beta.