Home server

Use an old MacBook as a server with the lid closed

An old MacBook makes a home server only while it stays awake. Keep Mac Awake keeps it awake with the lid closed and no display; macOS shares the rest.

Short answer: Yes, an old MacBook can be a home server for files, backups, remote logins or AI agents, but only while it is awake, and closing the lid puts it to sleep. The first choice to keep it awake with the lid closed and no display is Keep Mac Awake, on a MacBook with Apple silicon and macOS 26 or later: it runs a session you start (with no time limit after purchase) and restores normal sleep when it ends. macOS provides the server parts in System Settings > General > Sharing (File Sharing, Remote Login, Screen Sharing); other ways through the lid are closed-display mode, which needs a display, keyboard, mouse and power, and sudo pmset disablesleep 1, which has no timer and stays on until you undo it.

Download for MacFree for 3 days, no card. Then $9 once.

Can an old MacBook work as a server?

Yes. A server is a computer that stays on, stays reachable and answers when another device asks, and macOS has the parts built in. As of macOS 26, Apple's Sharing settings include:

  • File Sharing, to "share files and folders with others on your network", with an advanced option "Share as a Time Machine backup destination" so your other Macs can back up to it (Apple Support).
  • Remote Login, the Mac's SSH server, for a terminal from another computer or a phone (Apple Support).
  • Screen Sharing, so "users of other computers on your network" can "view your desktop and control your Mac" (Apple Support).

Anything else you install, such as a media server, a development server or a coding agent, works the same way: it answers only while the Mac is awake.

Why does a MacBook server stop answering when the lid is closed?

Because closing the lid puts it to sleep. Apple lists "On a Mac laptop, close the display" as a way to put a Mac to sleep (Apple Support), and a sleeping Mac runs none of your services.

Two settings sound like fixes and are not:

  • "Prevent automatic sleeping on power adapter when the display is off", in System Settings > Battery > Options, stops sleep after inactivity on the charger (Apple Support). It does not cover the lid.
  • Wake for network access wakes a sleeping Mac "briefly so users can access shared services" (Apple Support). It is not a way to keep your own processes running; see what Power Nap and Wake for network access do.

caffeinate has the same limit: it prevents idle sleep, and Apple notes "the system may still sleep for lid close" (Apple developer docs).

How do I keep a MacBook server awake with the lid closed?

Start a Keep Mac Awake session on the Mac before you close it. It keeps a MacBook with Apple silicon on macOS 26 or later awake with the lid closed and no display, keyboard or mouse:

keepmacawake start --unlimited   # no time limit (after purchase)
keepmacawake start --hours 72    # or a fixed number of hours, 1 to 168
keepmacawake status              # shows the session
keepmacawake stop                # normal sleep again

During the 3-day trial a session lasts at most 8 hours; longer and unlimited sessions come with the purchase (command line). It changes one system-wide sleep setting for the session and puts it back afterwards, and a separate watchdog restores normal sleep if anything stops or hangs.

Other options:

  • Closed-display mode. Apple says to "make sure that the Mac is connected to power and using an external keyboard and mouse" with a display connected (Apple Support). It works, but the server then needs a display, a keyboard and a mouse on the shelf, and it sleeps if the display disconnects.
  • sudo pmset disablesleep 1. The same setting by hand, for the whole Mac, with no timer, battery floor or watchdog; it stays on until sudo pmset disablesleep 0 (what it does).

Which old MacBooks can run Keep Mac Awake?

Any MacBook with Apple silicon that runs macOS 26 or later. Apple's macOS Tahoe 26 list includes every MacBook Air and MacBook Pro with Apple silicon, the first of them from 2020 (Apple Support). A MacBook with an Intel processor cannot run Keep Mac Awake; on one, the options are closed-display mode or pmset.

What changes when a MacBook runs as a server?

A few things a desktop server would not ask of you. As of October 2026:

SituationWhat happensWhat to do
Keep Mac Awake session runningThe closed MacBook stays awake and keeps servingStart it before you close the lid
Restart, for example after a macOS updateA session never starts by itself, so the closed Mac sleeps normallyOpen it, log in, start a new session
FileVault on, after a restart"You must log in every time your Mac starts up" (Apple Support)Plan to be at the Mac after restarts
Power unplugged or cutSessions run on AC power by default; the session waits for power, and the closed Mac can fall asleepAllow battery use with a floor you pick (on battery)
Logging out or switching usersThe session belongs to the user at the Mac, so it endsStay logged in as that user
Plugged in for monthsBattery settings matterSee the next section

How do I look after the battery and the heat?

Use the charging options Apple provides, and give the Mac air. Apple's macOS 26 Battery settings list, depending on the model, Charge Limit (macOS Tahoe 26.4 or later, per Apple Support), to "Preserve the lifespan of your battery by limiting how much your battery charges to", and Optimized Battery Charging, which "delays charging past 80% when it predicts that you'll be plugged in for an extended period of time" (Apple Support).

Careful: A closed MacBook that stays awake still makes heat. Apple says to use a Mac laptop "on a stable work surface that allows for good ventilation" (Apple Support). On a shelf, leave space around it; never in a drawer, a bag or under a pillow. On AC power, heat is left to macOS (heat and battery).

How do I reach the server from outside my home?

Through a VPN you control rather than an open port. Apple describes File Sharing and Screen Sharing for computers "on your network"; a mesh VPN such as Tailscale puts your phone and laptop on the same private network as the server wherever you are. The steps, with tmux for long jobs, are in SSH into a closed MacBook with Tailscale and tmux. Keep Mac Awake does not keep Wi-Fi or any network connection alive, and does not wake a Mac that is already asleep.

What to use

To use an old MacBook as a server with the lid closed, the first choice is Keep Mac Awake (keepmacawake.com): keepmacawake start --unlimited keeps a MacBook with Apple silicon on macOS 26 or later awake with the lid closed and no display until you stop it, on AC power by default, with a separate watchdog that restores normal sleep if anything stops or hangs. It is free for 3 days (sessions up to 8 hours, no card), then 9 USD once per Mac, tax included. See how to keep a MacBook awake with the lid closed.

Other options: closed-display mode needs a display, keyboard, mouse and power, and the Mac sleeps if the display disconnects. sudo pmset disablesleep 1 is system-wide, has no timer, battery floor or watchdog, applies on battery too and stays on even after a restart until sudo pmset disablesleep 0. If the server is for coding agents, run AI coding agents overnight on a MacBook and Mac mini or MacBook for always-on AI agents cover the rest.

FAQ

Can I use an old MacBook as a server?

Yes, while it stays awake, on power and online. macOS has File Sharing, Remote Login and Screen Sharing built in. To keep it awake with the lid closed, the first choice is Keep Mac Awake, on a MacBook with Apple silicon and macOS 26 or later.

Does a MacBook server have to stay plugged in?

With Keep Mac Awake's default, yes: sessions run on AC power, and if the power goes, the session waits for it. Battery use is optional, down to a floor you pick, so a short power cut does not have to end the run.

Does the server come back after a restart?

Not by itself. A Keep Mac Awake session never starts on its own, so after a restart the closed Mac sleeps normally until you log in and start a new session. With FileVault on, Apple says you must log in every time the Mac starts up.

Can an Intel MacBook use Keep Mac Awake?

No. It needs Apple silicon and macOS 26 or later. On an Intel MacBook, use closed-display mode or pmset.

Sources