

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). I do exactly this with my old MacBook Air and have done for some time.

To stop sleep entirely: sudo pmset -a disablesleep 1 To revert, allowing sleep again: sudo pmset -a disablesleep 0 No additional software needed.ĭisplay global power settings: pmset -g System-wide power settings: 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: 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. 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.Ĭlosing the lid of a MacBook by default puts it into sleep mode irrespective of whether it is plugged into power or running on battery.
