Quick answer
Open Terminal and run sudo nvram AutoBoot=%00, then enter your password. To turn the feature back on, run sudo nvram AutoBoot=%03 or reset NVRAM.
Ever since 2016 when you open the lid of your Apple laptop whether it's an Apple MacBook Air or MacBook Pro it will automatically turn on and boot into macOS.
If for whatever reason you need to disable it you can open terminal from Applications > Utilities folder and type the following command to disable it:
sudo nvram AutoBoot=%00
How to turn AutoBoot back on
If you need to enable the Auto Boot all you need to do is to type the following command in terminal or reset the PRAM on your laptop:
sudo nvram AutoBoot=%03
To reset the PRAM all you need to do is to hold down the command+option+p+r while the computer is turned off and then press the power button to turn it on, keep holding the keys until the computer reboots and you see the Apple logo, then release the keys.
Related guide: How to Reset NVRAM on a Mac.
Frequently Asked Questions
Got questions? We've got answers.
Which Macs start up when the lid opens?
Apple laptops from 2016 onwards, including MacBook Air and MacBook Pro models, start automatically when you open the lid or connect power.
Is changing the AutoBoot setting safe?
Yes. It only changes one NVRAM setting, which you can undo at any time with the second command or an NVRAM reset.
How do I reset NVRAM on an Intel Mac?
Shut down, press the power button and immediately hold Command-Option-P-R until the Mac restarts and you see the Apple logo, then release the keys.
Does this command work on Apple Silicon Macs?
Apple Silicon Macs use a different startup process, and the AutoBoot setting may not be honoured; Apple’s own commands for these models are sudo nvram BootPreference=%00 to stop booting on lid open and sudo nvram -d BootPreference to undo it.
Do I have to restart after running the command?
No. The setting is saved in NVRAM immediately and applies the next time you open the lid.
Will the Mac still wake from sleep when I open the lid?
Yes. The setting only affects starting up a Mac that is shut down; a sleeping Mac still wakes when you open the lid.
How do I check the current AutoBoot value?
Run nvram AutoBoot in Terminal. It prints %00 when automatic start-up is off and %03 when it is on.