Prevent Mac from Sleeping When Lid Closed

Tired of your MacBook going to sleep when you close the lid—even when it’s connected to an external monitor or keyboard? If so, MacKeeper’s Safe Cleanup can help you manage your device's performance and system settings to prevent your Mac from sleeping when the lid is shut.

System Requirements: macOS 10.11 or later

60+ million downloads

i

AV-TEST certified

AV-TEST is an independent lab that checks the effectiveness of antivirus apps against real malware samples.

i

Notarized by Apple

Notarization by Apple is a security measure to check if software is free from malicious components.

i

Trustpilot is an independent digital platform that hosts insightful and honest consumer reviews.

Prevent Mac from Sleeping When Lid Closed
Written by   Tanya Ellis
Published: August 19, 2025

Is it safe to keep Mac awake with lid closed

Yes, it’s generally safe to keep Mac on when the lid is closed, when it's shut correctly to avoid resource overconsumption or a depleted battery. Closing your Mac, with it still on, should not become a common occurrence, but when it’s necessary, here’s what we recommend to help keep your device stable:

  • Put your Mac on a stand to promote air circulation and reduce MacBook overheating.
  • Keep the charger plugged in to avoid draining your MacBook’s battery life.
  • Avoid closing the lid for an extended time or with apps running in the background.

You can disable Mac sleep when closing the lid, so long as you ensure your settings and hardware are properly configured beforehand. If you’re still unsure how to keep Mac from sleeping, our supporting blog has a full step-by-step breakdown to help you choose the right method most suited to your macOS version and setup.

A note from our experts: 

 

One reason why people close the lid on their Mac is to keep processes running in the background when they aren't using the device. Whilst handy–so long as Mac doesn’t sleep–this can drain your battery if there are also too many processes running simultaneously. The solution? MacKeeper’s Safe Cleanup automatically removes unnecessary files to free up vital system resources and keep your Mac optimized to avoid overheating or performance drops when the lid is shut.

 

Here’s how MacKeeper’s Safe Cleanup works:

  1. Download MacKeeper.
  2. Go to Safe Cleanup and press Start Scan.
  3. Allow the app to scan your device for Logs, Cache, Trash, and Languages.
  4. Tick everything you want to remove, press Clean Junk Files, and Remove.
To use MacKeeper’s Safe Cleanup tool to declutter your device from cache or Logs, that might make your Mac sleep with the lid shut–begin by opening the app. Then go to Safe Cleanup and press Start Scan.
Step 1. In the MacKeeper app, go to Safe Cleanup and click on Start Scan
Let MacKeeper scan your device. Once it’s finished, you can look through and tick all the Logs, cache, and digital junk you want to remove. Just press Clean Junk Files and Remove to rid your device of digital debris, hopefully optimizing your Mac and avoiding your Mac going to sleep when you shut the lid.
Step2. Tick everything you don’t need, press Clean Junk Files and Remove to confirm

How to keep Mac on when lid is closed

If you’re trying to stop Mac from sleeping when the lid is closed, try adjusting macOS Energy Settings, Terminal Command, or third-party apps–other methods may require additional accessories.

 

We’ll now guide you through the best methods to disable Mac sleep when closing the lid:

  • Use Terminal commands.
  • Use Third-party apps.
  • Change Mac Settings.

A hint from us: 

 

Not sure what the difference is between your Mac being in hibernate vs sleep mode? Yes, we know it can be confusing; that’s why we’ve attached this supporting blog article to help walk you through the differences as well as times when each mode can come in handy.

1. Use Terminal commands

Advanced MacBook users might wish to use Terminal Commands to temporarily disable Mac sleep when closing the lid. It’s a quick solution that requires third-party apps, but still allows you to have full control over your system.

 

Let us show you how to use a Terminal Command to keep Mac on when the lid is closed:

  1. In Finder, go to Applications > Utilities.
  2. Open Terminal.
  3. Type in the following command: caffeinate -i and press Enter.
  4. To stop the command, press Control + C in the Terminal window.
Advanced Mac users could benefit from using a simple terminal command to ensure their Mac stays awake and active even when it's shut. Just go to Finder, look through your Applications and Utilities until you find Terminal.
Step 1. Open Terminal
Now all that’s left is to type in the following command: caffeinate -i and press Enter. This will allow you to close your Mac lid and stop it from shutting down.
Step 2. Type in the following command caffeinate -i and press Enter

Important: 

 

You’ll need to keep Terminal open while the command is running, to ensure your Mac doesn’t sleep when shut. If you just want to know how to adjust sleep time on Mac, our supporting blog has all the steps for you to follow.

2. Use third-party apps

If you’d like an extra hand to stop your Mac from sleeping when the lid is closed, apps like Amphetamine can help. It’s available via the App Store, and uses a simple toggle that lets you decide if you would like to keep your MacBook awake with an on/off option. Third-party apps, like Amphetamine, are ideal if you want more control than macOS can offer.

 

Here’s how to find the Amphetamine app:

  1. Go to your App Store.
  2. Search Amphetamine and press Download.
If you’re not sure how to use Terminal commands, you can head to the App Store and look for a third-party app like Amphetamine that allows you to turn on/off the sleep function when your MacBook is closed; turning it off will prevent the Mac from sleeping when shut.
A third-party app, like Amphetamine, allows you to toggle on/off Mac’s sleeping mode when the lid has been shut

3. Change Mac settings

To keep your Mac awake, you can also adjust your MacBook’s built-in settings. While the OS lets you control the sleep function through Energy Saver or Battery preferences, there are some limitations depending on your operating System version.

For macOS Ventura and later:

Here’s how to change sleep settings on Ventura or newer models:

  1. Open System Settings.
  2. Select Lock Screen from the sidebar.
  3. Find Turn display off on the power adapter when inactive and change to Never.
For Mac users with Ventura or newer, go to System Settings, look for Lock Screen, and where it says Turn display off on power adapter when inactive–choose Never from the drop-down options. This will stop Mac from sleeping when the lid is shut.
In System Settings, select Lock Screen and change Turn display off on power adapter when inactive to Never

For macOS Catalina, Big Sur, or Monterey:

For devices with an older macOS, you’ll need to follow these steps:

  1. Open System Preferences.
  2. Click Energy Saver.
  3. Select the Power Adapter tab.
  4. Drag the Turn display off after slider to Never.
If you have an older Mac that runs older macOS software, you’ll need to open System Preferences and go to Energy Saver. From there, select Power Adapter and drag the bar where it says Turn display off aff all the way to Never as this will keep your Mac on even when it's shut.
In System Preferences, click on Energy Saver > Power Adapter and drag Turn display off after to the right where it says Never

Keeping your Mac awake even when it’s shut

Preventing your Mac from sleeping when the lid is closed is possible so long as you correctly adjust your Settings. Alternatively, you can use Terminal commands or third-party apps, but just remember that there are some macOS limitations with older models.

 

Remember to use MacKeeper’s Safe Cleanup to keep your system optimized. It’ll help remove clutter, free up resources, and improve your Mac’s reliability. Try it out today..

Use your Mac to the fullest! Sign up and get:
Effective tips on how to fix Mac issues
Reliable advice on how to stay safe online
Mac-world news and updates

Thank you!

You’ll love exploring your Mac with us.

Oops, something went wrong.

Try again or reload a page.

Here’s another sign you need to upgrade your macOS ASAP:

30% off your MacKeeper subscription

Сopy the code now and use it in the MacKeeper checkout after the upgrade.

Copy Code

Please be aware that this code cannot be combined with any other discounts, offers, or promotions.

Contents

Unlocked
PC

MacKeeper - your all-in-one solution for more space and maximum security.

Try Now

Read more

How to Uninstall DaisyDisk
How to Uninstall DaisyDisk
How to Convert PDF to Word on Mac?
How to Convert PDF to Word on Mac?
arrow

Run Application

step_1

Click Continue

step_2

Click Install

step_1

Your macOS version is lower than OS 10.11. We’d like to offer you MacKeeper 4 to solve the cleaning, privacy, and security issues of your macOS.