I have an old MacBook laying around, and I wonder if it's possible to use it safely when the lid is closed? I want to run it as a network device, store files in my home network on it etc.

Is there a way to use it just plugged in to power and ethernet, close the lid and let it run as a server?


7 Answers 7


To use a MacBook as a server with the lid closed, all you need to do is to ensure that it's powered on and not in sleep state.

Closing the lid of a MacBook by default puts it into sleep mode irrespective of whether it is plugged into power or running on battery.

One common way to keep the MacBook powered on with the lid closed is to connect an external display (and keeping it plugged-in to power, to make sure that it doesn't run out of power) to your MacBook.

If that is not feasible, or is not an option that you are looking for, you can refer to the solution in the linked discussion:

You can accomplish this in terminal. No additional software needed.

Display global power settings:
pmset -g

System-wide power settings:
Currently in use:
 lidwake              1
 autopoweroff         1
 standbydelayhigh     86400
 autopoweroffdelay    28800
 proximitywake        1
 standby              1
 standbydelaylow      10800
 ttyskeepawake        1
 hibernatemode        3
 powernap             1
 gpuswitch            2
 hibernatefile        /var/vm/sleepimage
 highstandbythreshold 50
 womp                 0
 displaysleep         10
 networkoversleep     0
 sleep                1 (sleep prevented by sharingd)
 tcpkeepalive         1
 halfdim              1
 acwake               0
 disksleep            10

To stop sleep entirely:
sudo pmset -a disablesleep 1

To revert, allowing sleep again:
sudo pmset -a disablesleep 0


Use Amphetamine

No need to get another monitor, or to buy an HDMI connector or to execute some terminal command. You just need to download this free and open source utility called Amphetamine.

When you run it, it will appear in your menu bar, you can go ahead and click on the logo. And from now, two clicks are enough to finish this :

Click the "Indefinitely" button. Click "Indefinitely"

Uncheck the middle option saying "Allow system sleep when display is closed" Uncheck the middle option saying "Allow system sleep when display is closed"

And there you go, if you now close your lid, your Mac won't go to sleep. Additionally, if you want to save power and preserve your Mac, you can set the luminosity to the minimum amount (which should make a black screen).

  • 11
    I would always consider a 3rd party application a more shady option than cmd, not less. (A better solution that buying some hardware though). Not to say it is shady, just has a higher likelihood of being Commented Mar 13, 2021 at 22:18
  • 3
    @RichardTingle I like the idea of a headless adapter because it doesn't require any modifications of system settings, there's an obvious and easily seen indicator on when/if the laptop will not sleep when the lid is closed, and it's easily reversible. A 3rd party tool for this can fail after an OS update and support ends on the tool. If this were a $200 piece of hardware then I'd certainly consider a software solution but the hardware is less than $15. The hardware fix is inexpensive, well tested, and requires no special knowledge. I gave an up-vote regardless as it s a useful fix.
    – MacGuffin
    Commented Mar 14, 2021 at 13:12
  • 1
    @RichardTingle I'd say it depends on your user. For a person knowing its way around computers, a command is probably the best, but for someone who doesn't and may struggle with computers, a utility would be better. Depends on your case, that's why stack exchange allows for multiple answer :)
    – Titouan
    Commented Mar 14, 2021 at 16:52
  • 1
    Yeah @JohnChurchill I agree to keep the system clean. However I have to say that the risks for a fatal bug is quite low as the software is fully open source.
    – Titouan
    Commented Mar 14, 2021 at 21:39
  • 2
    @RichardTingle Yes, I'm going to remove the word shady as it isn't appropriate.
    – Titouan
    Commented Mar 14, 2021 at 21:40

The macbook is designed to dissipate a substantial portion of its heat through the keyboard. If you run it closed for a long period of time, it will have reduced performance (as it can't dissipate heat as effectively). Additionally, the added heat could reduce the lifespan of the screen.

None of these effects should be too large, and it will work fine closed, but if you can leave the lid open it will be better for the computer's performance and longevity.

  • 5
    In my experience, you also need to make sure there's airflow beneath your computer, otherwise the bottom starts to get hot (even with the lid open and powered off).
    – Laurel
    Commented Mar 13, 2021 at 0:12
  • 10
    It’s a common misconception that MacBook Pros dissipate heat through the keyboard. People believe it because the upper chassis gets hot under load, but that’s because of the Unibody construction and is not a thermal design feature. Heat is dissipated through a heatsink/fan combo that blows air out through an exhaust slit under the lid hinge on the back. Retina models (2012-current) pull air in through vent holes on the sides. Pre-2012 models pull air in through the same exhaust slit (which is a crappy design and hence why they changed it after the RADEONgate fiasco).
    – Wes Sayeed
    Commented Mar 14, 2021 at 22:32
  • 2021 16" MacBook Pro uses around 1W or 36 *C when running on caffeinate and screen off. It's a negligible amount of heat.
    – Dzh
    Commented Feb 23, 2022 at 0:17
  • @Dzh power usage will vary depending on what it's doing. That may be the idle power usage, but it'll be much higher if it's running computationally-intensive programs. Commented Feb 23, 2022 at 2:39

Closing the lid on a MacBook while it is running is common, people do that all the time with a keyboard, mouse, and display attached. Without a display attached it will go to sleep. A headless monitor adapter is one way to rectify that. Here's an HDMI example:


This is apparently a popular item as I've seen what appears to be the same product sold under different brands by different shops. A common use is to allow VNC/RDP/telework software without need for a monitor, which is not far from what you want. You'll be able to use the macOS screen sharing service to control it over a network for configuration and monitoring.

These HDMI headless adapters are common, if you don't have a HDMI port on your laptop then you will need an adapter or have to seek out a DVI, mini-DP, or whatever version. I did some looking and I haven't found one yet.


I do exactly this with my old MacBook Air and have done for some time. The only difference from the above posts is that instead of using macOS I wiped it clean and installed Ubuntu Server (it's still possible to reinstall macOS should I ever want to).

There are a few things you need to consider. One is that the wi-fi almost certainly won't work out of the box on Linux as it's Broadcom and depends on a proprietary driver that has to be manually installed. In my case I use a wired USB ethernet adapter which is a better fit for a server use case anyway.

To fix the lid closing issue on Ubuntu you have to edit the file /etc/systemd/logind.conf and uncomment the line #HandleLidSwitch=ignore (remove the # symbol at the start).

The other problem you'll encounter is the screen being on, which on older models means the Apple logo staying permanently lit. I would imagine this isn't good for it. On my machine I fixed this by adding a line to my crontab that automatically turns it off when the laptop boots:

Do sudo crontab -e then insert something like the line below:

@reboot echo 0 > /sys/class/backlight/intel_backlight/brightness

This may be specific to my MacBook Air but the setting looks like it probably applies to most or all Intel-based MacBooks.

Finally, I recommend controlling the machine via SSH, there is plenty about this if you are not familiar. The OpenSSH server should be enabled by default when you install Ubuntu Server iirc.


Try to use the Jiggler

It prevents sleep by jiggling the mouse a pixel at a time after the idle threshold is reached. This bypasses any power configuration set in Mac OS.

I've tested it with a Macbook Pro using the lid closed, with only power and ethernet attached.

PS: This tool is also helpful if you access a remote application (e.g. remote desktop) that times out. You can simply leave the mouse over the application window and let it jiggle and keep the session alive.


Approach that worked for me running Ubuntu Server 22.04 on a MacBook Pro 7,1; edit the login.conf file and utilize setterm cli command. This also helped make sure my screen and logo backlight turned off.

Edit file: /etc/systemd/logind.conf Adjust these two parameters:


Also, in the terminal, type: setterm --blank 1 --powerdown 2

  • This actually helped me. Thank you!
    – kkazakov
    Commented Sep 1, 2022 at 3:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .