Disable Automatic MacBook Startup with Terminal Commands

Apple has published an official support document detailing how to disable automatic startup when opening the lid or connecting a MacBook to power. This feature can be useful for those who want more control over their laptop’s behavior.

To access this setting, you’ll need macOS Sequoia or later and the Terminal app. Follow these steps:

1. Open the Terminal app from your Applications folder.
2. Type one of the following commands in Terminal and press Return:
* To prevent startup when opening the lid or connecting power: `sudo nvram BootPreference=%00`
* To prevent startup only when opening the lid: `sudo nvram BootPreference=%01`
* To prevent startup only when connecting to power: `sudo nvram BootPreference=%02`
3. Type your administrator password when prompted and press Return.
4. To re-enable automatic startup, use the command `sudo nvram -d BootPreference`

Note that these steps do not affect keyboard or trackpad input, but can be useful for cleaning the keyboard without triggering a boot. Alternatively, you can disable the startup chime in Settings > Sound.

Source: https://9to5mac.com/2025/02/03/apple-explains-how-to-stop-your-macbook-from-booting-up-every-time-you-open-it