Closed-lid mode
Keep working with the lid shut. No external display needed.
Guides
Compare
Help
There's more than one way to keep a Mac awake. This is how they compare.
The built-in command, compared with a menu bar app.
Changing System Settings, compared with a keep-awake app.
Apple's closed-display mode, compared with closed-lid mode.