How to Prevent macbook from sleeping when the lid is closed?

When I close the lid, it goes to sleep mode. But sometimes I need my MacBook awake even when the lid is closed while downloading a very large file from the internet or listening to iTunes playlists.

Is there any way to keep my MacBook awake and keep downloading at the same time??


Nope, closing the lid will automatically sleep your Mac. If you want your Mac's screen to be off but for it to continue downloading, download the Caffeine app from the Mac App Store and turn it on (Caffiene stops your Mac from sleeping temporarily) then dim your brightness all the way. The task will continue and the screen will stay off.


Yes, you can actually. See link for terminal command "caffeinate" https://mac-how-to.gadgethacks.com/how-to/take-control-your-macs-sleep-functions-with-these-commands-0168109/

Also, there are GUI apps "NoSleep" and "InsomniaX" that you can download and have the same effect without messing around in the terminal.