• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
OpenTechTips

OpenTechTips

Practical IT Guides, Expert Tips, and Real-World Solutions

MENUMENU
  • HOME
  • ALL TOPICS
    • Exchange
    • InfoSec
    • Linux
    • Networking
    • Scripting
      • PowerShell
    • SSL
    • Tools
    • Virtualization
    • Web
    • Windows
  • ABOUT
  • SUBSCRIBE
Home » How to Disable Sleep on Mac When Closing the Lid

How to Disable Sleep on Mac When Closing the Lid

June 27, 2025 - by Zsolt Agoston - last edited on July 27, 2026

Closing a MacBook lid normally puts the Mac to sleep. If you need a task, download, or remote session to continue while the lid is closed, you can disable system sleep with pmset.

Important: This setting disables sleep system-wide, not only lid-close sleep. It can increase battery use and heat. Keep the Mac on a hard, ventilated surface, never leave it running in a bag, and restore normal sleep when you are finished.

Keep the Mac awake with the lid closed

Open Terminal (Applications > Utilities > Terminal), then run:

sudo pmset disablesleep 1

Enter your administrator password when prompted. Terminal does not display characters while you type the password.

Restore normal sleep

Re-enable sleep as soon as you no longer need the Mac to stay awake:

sudo pmset disablesleep 0

You can check the current power-management settings with:

pmset -g

Using a MacBook with the lid closed and an external display

If your goal is a normal desktop setup, use Apple's closed-display mode instead of disabling sleep globally: connect the Mac to power, an external display, and an external keyboard and mouse or trackpad. This is the safer choice for routine desk use.

Do you mean “stop the Mac from turning on when I open the lid”?

Sleep and automatic startup are different settings. On a Mac laptop with Apple silicon running macOS Sequoia 15 or later, this command prevents startup only when the lid is opened:

sudo nvram BootPreference=%01

To restore automatic startup:

sudo nvram -d BootPreference

Apple also documents %00 to prevent startup both when opening the lid and when connecting power, and %02 to prevent startup only when connecting power. These BootPreference options require Apple silicon and macOS Sequoia 15 or later.

Source: Apple Support: Prevent a Mac laptop from turning on when opening its lid or connecting to power.

Reader Interactions

Comments Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Tools

Secondary Sidebar

CONTENTS

  • Keep the Mac awake with the lid closed
  • Restore normal sleep
  • Using a MacBook with the lid closed and an external display
  • Do you mean “stop the Mac from turning on when I open the lid”?

  • Terms of Use
  • Disclaimer
  • Privacy Policy
Manage your privacy
We use technologies like cookies to store and/or access device information. We do this to improve browsing experience and to show (non-) personalized ads. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Manage options
  • {title}
  • {title}
  • {title}
Manage your privacy
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Manage options
  • {title}
  • {title}
  • {title}