October 4, 20265 min read

How to Keep a MacBook Awake with Lid Closed for Remote Access (No Monitor)

Here is a scenario almost every Mac developer runs into: you are running a long script, downloading a massive dataset, or hosting a local development server on your MacBook. You want to close the lid, tuck your laptop into a stand, and head into the next room or out to a coffee shop while connecting remotely from your iPhone or iPad.

You shut the lid, pick up your phone, and your connection instantly dies.

By default, macOS puts any MacBook into system sleep the exact second the lid closes unless an external monitor, keyboard, and power cable are plugged in. That is Apple's default clamshell mode.

If you want your MacBook to stay awake with the lid closed without an external display, you have to override that behavior. Here are the three practical ways to do it, along with the safety precautions you should know.

Method 1: The Native Terminal Command (pmset)

If you prefer not to install any extra apps, macOS has a built-in power management utility called pmset.

Open Terminal on your Mac and run this command:

sudo pmset -a disablesleep 1

You will need to enter your Mac user password. Once enabled, macOS completely ignores sleep triggers, including closing the laptop lid. Your network connections, terminal sessions, and background apps will keep running normally.

When you want to restore standard sleep behavior, run the reverse command:

sudo pmset -a disablesleep 0

You can verify your current settings at any time by running pmset -g. Look for the SleepDisabled line.

Method 2: Using Amphetamine (Free GUI Tool)

If you don't want to touch the command line every time you need to toggle sleep, the best graphical tool is Amphetamine, available for free on the Mac App Store.

Amphetamine sits quietly in your menu bar and lets you create temporary keep-awake sessions. To enable closed-display mode:

  1. Install Amphetamine from the Mac App Store.
  2. Go to Settings > Session Defaults.
  3. Uncheck the box labeled “Allow system sleep when display is closed”.
  4. Amphetamine will prompt you to install a small helper tool that communicates with macOS power assertions.
  5. Click the menu bar pill icon to start a session before closing your lid.

The biggest advantage of Amphetamine is safety: you can set triggers that automatically re-enable sleep if your battery drops below 20%, preventing your laptop from completely draining in your bag.

Method 3: An HDMI Dummy Plug ($7 Hardware Hack)

If your MacBook has an HDMI port (like the 14-inch and 16-inch MacBook Pro), there is a clever hardware workaround: an HDMI dummy plug (often called a headless ghost adapter).

It is a tiny dongle with no cable attached. When plugged into your HDMI port, it tricks macOS into thinking an external 4K monitor is connected. Apple's operating system natively allows clamshell mode whenever an external display is detected, provided your MacBook is plugged into power.

It requires zero software, no terminal commands, and never gets broken by major macOS version upgrades.

Critical Warning: Heat and Airflow

Modern Apple Silicon MacBooks (M1, M2, M3, M4) are remarkably power-efficient, but they still vent heat upward through the keyboard deck and out the rear hinge.

Important Safety Rule: Never leave a MacBook running closed inside a closed backpack or padded sleeve with sleep disabled. If a heavy build or background process kicks off, the laptop can reach high temperatures without airflow. Always keep your MacBook on a flat desk or vertical laptop stand when using clamshell mode.

Connecting Remotely Once Your Mac is Awake

Once your MacBook stays awake with the lid closed, you need a dependable client to connect from your phone or tablet.

Standard VNC and SSH setups often drop connections when network interfaces switch from Wi-Fi to cellular. With Macky, your session connects over peer-to-peer WebRTC. Whether your laptop is closed in your office or sitting on a shelf at home, you get:

  • • Instant Reconnection: WebRTC ICE agents reconnect automatically when you switch from Wi-Fi to 5G.
  • • Dual Terminal & Desktop: Run commands in a full zsh shell or check your graphical desktop with touch gestures.
  • • Zero Router Ports: Traverses firewalls automatically without port forwarding.

Try Macky

Connect to your Mac terminal from your iPhone. Free to start, no configuration required.