Use a MacBook as a home server with the lid closed

By Matyas Rathonyi. Updated October 5, 2026. Guides

It works, as long as the Mac stays awake. Closing the lid normally sleeps a MacBook and takes Plex, Jellyfin, SSH and screen sharing offline. Leave the lid open on power for a free setup, or arm Clamshell for Mac to keep the Mac awake and on the network with the lid shut. For a box that runs around the clock, a Mac mini is often the better buy.

Lid closedThe Mac sleeps, server offline
Lid openFree built-in settings
BatterymacOS can hold it near 80%
$9.99 onceAfter a 7-day free trial

Clamshell for Mac keeps a closed MacBook awake and on the network while armed, so SSH, screen sharing and server apps stay reachable. Free for 7 days.

Download free trial

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

A phone and a TV keep exchanging data with a MacBook while its lid closes.
A server has to stay awake.Streams, SSH and screen sharing reach the Mac only while it is on and online. The lid is what normally ends that.

An Apple Silicon MacBook you already own can do real server work: a Plex or Jellyfin media library, SSH and file access from another computer, screen sharing, scheduled scripts, home automation. The hardware is not the obstacle. Sleep is. This guide covers the sharing settings, what Wake for network access does and does not do, how to keep the server online with the lid closed, and how to look after the battery and heat. It also covers when a Mac mini is simply the better tool.

Turn on the sharing you need

  1. SSH and SFTP: in System Settings, General, Sharing, click the info button next to Remote Login and turn it on, then choose which users may log in. From another computer, connect with ssh username@hostname, where hostname can be an IP address or a domain name. Apple's Remote Login guide warns that remote login can make your Mac less secure, so limit it to the users who need it.
  2. Screen sharing: in the same Sharing pane, turn on Screen Sharing and pick who has access. Apple notes that Screen Sharing and Remote Management cannot be on at the same time.
  3. Media server: install Plex, Jellyfin or a similar server app and point it at your library. These are ordinary apps: they serve while the Mac is awake and stop when it sleeps.

Does Wake for network access keep a MacBook server online?

Not in the way a server needs. On a MacBook the option is in System Settings, Battery, Options. Apple describes it as waking the Mac when a user at another computer accesses its shared resources, such as a shared printer or Music playlist, and at intervals so the Mac can tell the network those resources are available. Apple does not describe it as keeping third-party server apps running, and the page says nothing about a closed lid. A Plex stream, a long SSH session or a cron job needs a Mac that is already awake.

Lid closed and asleep: SSH, Plex and file sharing connections to the Mac are cut. Mac z SSH Plex Files Lid closed, asleep Lid closed with Clamshell armed: SSH, Plex and file sharing keep exchanging data with the Mac. Mac SSH Plex Files Clamshell armed
Same closed MacBook, two outcomes. Asleep, every connection drops. Kept awake, the Mac stays on the network and keeps serving.

The free setup: lid open on power

If the MacBook can sit on a shelf with its lid up, macOS already has what you need. In System Settings, Lock Screen, set Turn display off on power adapter when inactive to a short time. In Battery, Options, turn on Prevent automatic sleeping on power adapter when the display is off. Both are in Apple's sleep settings guide. The display turns off and the Mac keeps serving. Many home servers need nothing more.

Two other routes keep a closed lid awake. Apple's closed-display mode works with an external display, keyboard, mouse and power. sudo pmset -a disablesleep 1 works with nothing attached, but it is a global admin switch with no timer that stays on until you undo it: see what pmset disablesleep does.

Keep the server online with the lid closed

Clamshell for Mac keeps an Apple Silicon MacBook on macOS 14 or later awake with the lid closed while armed. It needs no external display, sudo, admin password or kernel extension, and it restores normal lid sleep when you disarm or quit.

  1. Install Clamshell and open it once. It sits in the menu bar.
  2. Arm it so it stays armed. For a server, arm from the right-click menu or with the Shortcuts Arm action: that stays active across lid openings until you disarm. Arming from the regular menu covers the next close only.
  3. Disconnect external displays. With a display connected Clamshell pauses (yellow menu bar icon) and arms automatically once displays disconnect.
  4. Close the lid and test from another device. Open an SSH session or start a stream. The built-in display stays black and the Mac stays on the network.

Know the limits before you rely on it. Arming is never saved across a restart, so after a reboot or a macOS update you arm again. The direct edition can relaunch after an unexpected exit if its crash-recovery agent is permitted. Plugging in and unplugging do not end a session. Clamshell does not monitor your server apps, reconnect Wi-Fi or restart Plex. Opening the lid locks the Mac.

Battery health when the MacBook is always plugged in

A laptop that lives on a charger spends a lot of time full, which is the wear macOS tries to avoid. According to Apple, Optimized Battery Charging (macOS Big Sur or later) learns your routine and delays charging past 80 percent when it predicts long periods on power, showing Charging On Hold in the battery menu. On macOS Tahoe 26.4 or later, Apple silicon Macs also offer a Charge Limit you can set between 80 and 100 percent. Both live in System Settings, Battery. Apple notes the Mac still charges to 100 percent occasionally to keep its estimates accurate.

A battery fills to about 80 percent and holds there: Charging On Hold. Charging On Hold held near 80%
Let macOS manage the charge. On a server that rarely unplugs, Optimized Battery Charging or a Charge Limit keeps the battery from sitting at 100 percent.

Heat and placement

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

When a Mac mini is the better buy

Buy a Mac mini if

The server runs around the clock and never leaves the house. A desktop Mac has no lid to manage and no battery to wear, and it uses Apple's desktop Energy settings instead of laptop battery rules. For a dedicated home server, that is the cleaner setup.

Use the MacBook if

You already own it, you need the server some of the time, or you still carry the laptop. Lid open on power is free. Clamshell covers the times the lid has to be closed.

Frequently asked questions

Can I use a MacBook as a server with the lid closed?

Yes, if something keeps it awake. By default closing the lid puts the MacBook to sleep, and server apps, SSH and screen sharing go offline. Apple's closed-display mode keeps it awake with an external display, keyboard, mouse and power, and Clamshell for Mac keeps it awake with nothing attached.

Can I SSH into a MacBook with the lid closed?

Only while it is awake. Turn on Remote Login in System Settings, General, Sharing, then keep the Mac awake with the lid closed, for example with Clamshell armed. A sleeping Mac does not keep your SSH session running.

Does Wake for network access keep a MacBook server online?

Not as a substitute for an awake Mac. Apple describes it as waking the Mac when another computer accesses its shared resources, such as a shared printer or Music playlist. Apple does not describe it as keeping server apps running, or as working with the lid closed.

Is it bad for the battery to keep a MacBook plugged in all the time?

macOS manages this for you. Optimized Battery Charging delays charging past 80 percent when it predicts long periods on power, and on macOS Tahoe 26.4 or later Apple silicon Macs can set a charge limit between 80 and 100 percent. Apple notes the Mac still charges to 100 percent occasionally.

Should I buy a Mac mini instead of using a MacBook as a server?

For a server that runs around the clock at home, a Mac mini is usually the better fit: no lid and no battery to manage. A MacBook makes sense when you already own it, need the server only some of the time, or still carry the laptop around.

Can Plex or Jellyfin run on a MacBook with the lid closed?

Yes, as long as the Mac stays awake and on the network. Arm Clamshell or use closed-display mode, then keep the MacBook on power in a ventilated spot.

Related guides

Sources checked October 5, 2026: Apple's guides on Remote Login, screen sharing, sharing resources during sleep, sleep and wake settings, closed-display mode, Optimized Battery Charging and Charge Limit, laptop operating temperatures, and the MacBook Air product page. Clamshell behavior is described from its changelog and FAQ. Clamshell is an independent app, not affiliated with or endorsed by Apple, Plex or Jellyfin. Plex and Jellyfin are trademarks of their owners.