How to Stop Mac from Sleeping? Tried and Tested Methods

Mr Kumar Reviewed By Mr Kumar
Mahima Dave Mahima Dave
Updated on: Jun 04, 2026

If you are wondering how to stop Mac from sleeping during a movie or a heavy download/upload, the answer is just simple: adjust your display time to Never in your Lock Screen Settings. 

But what if you want to stop Mac from sleeping for only an hour or even when the lid is closed? We are going to explain every method, covering all macOS versions and Mac models currently in use.

TL;DR
The quickest way to stop Mac from sleeping is to set your display timer to “Never” in your native Lock Screen or Energy Saver settings. For more precise control, you can use the Terminal caffeinate command for temporary or indefinite tasks.

How to Stop Mac from Sleeping Using Built-in System Settings?

Starting with System Settings is the best way to keep your system awake. To use the built-in methods for how to stop Mac from sleeping, you just need to go to your System Settings/Preferences and adjust the display and battery timers to Never.

Let’s see how to turn off sleep mode on Mac (all versions).

Modern macOS (Tahoe, Sonoma, and Sequoia)

In these versions, Apple moved to a “System Settings” interface that looks similar to an iPhone or iPad.

For MacBooks (Air & Pro)

  1. Click the Apple Menu in the upper left corner and select System Settings
    Open System Settings
  2. Go to the Lock Screen in the left sidebar.
    Go to Lock Screen
  3. Set both “Turn display off on battery when inactive” and “Turn display off on power adapter when inactive” to Never.
    Set Turn display off to never
  4. Next, go to Battery in the sidebar.
    Go to Battery from the Sidebar
  5. Click Options.
    Options
  6. Toggle ON Prevent automatic sleeping on power adapter when the display is off.”
    ON Prevent automatic sleeping on power adapter when the display is off
  7. Click Done.
    Done button

For Desktops (iMac, Mac mini, Mac Studio)

  1. Go to the Apple Menu on the top left corner and choose System Settings or Open from the dock.
    Open System Settings from the dock
  2. Go to the Lock screen on the left sidebar.
  3. Change “Turn display off on battery when inactive” to Never,
  4. Select Energy in the sidebar.
    Go to Energy from the sidebar
  5. Enable “Prevent automatic sleeping on power adapter when the display is off”.
    Toggle on Prevent automatic sleeping on power adapter when the display is off

Classic macOS (Ventura, Monterey, and Big Sur)

These versions use the “System Preferences” layout with a grid of icons.

  1. Go to the Apple Menu on your MacBook and select System Preferences.
    Open System Preferences
  2. Click the Battery from the left sidebar.
    Go to Battery
  3. Select Power Adapter in the sidebar.
    Click Power Adapter tab
  4. Click on the Lock to make changes.
    Click the lock to make changes
  5. Enter your Mac password and click Modify Settings.
    Enter password and Modify Settings
  1. Drag the slider to Never.
    Set the slider to Never
  2. Check the box for “Prevent computer from automatically sleeping when the display is off”.
    Toggle on Prevent computer from automatically sleeping when the display is off

Legacy macOS (Catalina and older)

For older Macs running vintage software, all controls are in one place.

  1. Click on Apple Menu and select System Preferences….
    System preferences
  2. Click on Energy Saver (💡) from the grid.
    Click Energy Saver
  3. You will see two tabs: Battery and Power Adapter.
    Battery and Power Adapter tabs
  4. In both tabs, drag the “Computer Sleep” slider to Never.
    Drag the slider to Never
  5. Click OK on the warning pop-up.
    OK on the warning pop-up

You can also set the “Display Sleep” slider to Never as well, but the Computer Sleep slider is the one that prevents background tasks from stopping.

How to Stop Mac from Sleeping Using the “Caffeinate” Command in the Terminal?

Terminal commands are another way of keeping Mac from sleeping. For readers who want precision to stop Mac from sleeping without clicking through menus, the command line is the solution. To use Terminal for how to stop MacBook from sleeping, you need to use the built-in caffeinate command. It tells the system to ignore its usual energy-saving rules.

How Do You Keep Your Mac Awake Temporarily?

This is perfect if you only need your Mac to stay active for a set amount of time (for example, during a 2-hour download).

  1. Open Terminal (found in Applications > Utilities or via Spotlight search).
    Open Terminal app
  2. Type the following command.

    caffeinate -t [seconds] 

    In place of [seconds], enter the number of seconds you want to keep Mac from sleeping.

    caffeinate command
  3. Press Return.

Important: Keep the Terminal window open. Once the time runs out, the command will finish and your Mac will follow its normal sleep settings again.

How Do You Keep Mac Awake Indefinitely?

Use this when you don’t know how long the task will take and want to prevent the MacBook from sleeping until you manually tell it to stop.

  1. Open the Terminal.
    Search and open Terminal app
  2. Type the following command to stop Mac from sleeping.

    caffeinate -d 

    Here, -d stands for ‘display’. This keeps the MacBook’s display active.

    caffeinate command
  3. Press Return.

Your Mac will now stay awake for as long as that terminal window is open and the command is running.

How to Turn Off the Caffeinate Command?

When you are done and want your Mac to be able to sleep normally again, you must “kill” the process.

  1. Go back to the Terminal window where the command is running.
    Terminal Window
  2. Press Command (⌘) + C on your keyboard.
    Stop the command
  3. The cursor will return to a new line. This shows that the command has stopped and your Mac’s standard energy saving rules are back.

How to Keep Mac from Sleeping while a Specific App is Running?

This is an advanced, useful method to stop Mac from sleeping and keep awake until an App is running. It tells your Mac: “Stay awake as long as this program is open, then go back to sleep as soon as it closes.”

  1. Open the Terminal.
    Search and open Terminal app
  2. Type the following command.

    caffeinate -w <pid>

    Replace <pid> with the actual Process ID.

    To link your sleep-prevention rules to a specific application, you first need to look up its unique Process ID (PID). Open the native Task Manager Mac utility and go directly to the CPU column. From here, note down the digits listed next to your running application before typing your command.

To get the Process ID: Open Activity Monitor (via Spotlight) > Find the App > Look at the number in the PID column.

  1. Press Return.

As soon as that process ends, the caffeinate command will automatically stop, and your Mac will go back to sleep.

The caffeinate command only works while its specific Terminal window stays open, so keep it tucked away to one side of your desktop. You can learn how to split screen on Mac to perfectly work on one screen and keep your active Terminal running in the other.

All these methods work identically across every version of macOS, from the newest macOS Tahoe to the earliest version of OS X.

How to Handle Special Sleep Scenarios on Mac?

Sometimes you don’t just want to keep your Mac awake while you are sitting in front of it. You might need it to stay awake the whole night while doing a backup or when the lid is closed.

In this section, we will see how to handle these specific situations and make sure your Mac stays wide open, completing your background tasks needed.

How to Stop MacBook from Sleeping When the Laptop Lid is Closed?

Closing your laptop lid is usually the ultimate command for your hardware to go to sleep immediately. But sometimes there could be a need to keep the Mac from sleeping with the lid closed while you connect it to a large external monitor and use it, or you’re running an overnight backup for which you are wondering how to make Mac not sleep.

You can keep your MacBook plugged to power, toggle the hidden “Prevent automatic sleeping” preference to keep your laptop fully active when the lid is closed. Let’s see how.

Modern macOS

These versions use the modern list-style System Settings layout. Here’s how to stop the MacBook from sleeping when the lid is closed:

  1. Click the Apple Menu in the top left corner and select System Settings.
    Open System Setting
  2. Scroll down the left sidebar and select Battery.
    Select Battery option
  3. Click Options.
    Click Options
  4. Toggle ON Prevent automatic sleeping on power adapter when the display is off”.
    Toggle on
  5. Click Done to save.
    Click Done

Classic macOS

These versions have the older icon grid System preferences window showing a dedicated battery tab. 

How to stop Mac from sleep while the lid is closed:

  1. Click the Apple menu and open System Preferences.
    Open System Preferences
  2. Click the Battery icon.
    Go Battery
  3. Select  Power Adapter from the left-hand sidebar.
    Click Power Adapter tab
  4. Drag the “Turn display off after” slider all the way to the right to Never.
    Set the slider to Never
  5. Check the box next to “Prevent your Mac from automatically sleeping when the display is off”.
    Toggle on Prevent computer from automatically sleeping when the display is off

Legacy macOS

For vintage Macs, all power settings are consolidated into a single control panel. Let’s see how to stop Mac from sleeping with the lid closed.

  1. Click the Apple Menu and open System Preferences.
    System preferences
  2. Click the Energy Saver icon.
    Click Energy Saver
  3. Click the Battery tab at the top and drag the “Computer Sleep” slider all the way to the right to Never.
    Drag the slider Never
  4. Do the same in the Power Adapter tab.
  5. Check the “Prevent computer from sleeping automatically when the display is off” checkbox.

How to Schedule Custom Sleep and Wake Times on Mac?

You can set your Mac to wake up automatically a few minutes before you sit down, so your workspace is ready to go. Also, scheduling an automatic bedtime for your Mac cuts down on power consumption.

So, if you are running modern versions of macOS (Tahoe, Sequoia, Sonoma, Ventura), you must use the Terminal command line to schedule power time, while older versions (Monterey or earlier) have a simple built-in “Schedule” button in your System Preferences.

Below is the step-by-step breakdown for every model and software version to keep mac from sleeping by scheduling custom sleep and wake times.

Modern macOS (Tahoe, Sequoia, Sonoma, Ventura)

Apple removed the visual schedule manager from the System Settings graphical interface in these new versions. To create automatic timers now, you must use the pmset command in the Terminal app.

Open Terminal using Spotlight search and enter the following commands:

How to view your current power schedule:

  1. Enter the command:

    pmset -g sched

    Command to view current power schedule
  2. Press Return to see any existing wake or sleep events.

How to set repeating wake/power-on time:

  1. To make your Mac wake up automatically, use the format:

    sudo pmset repeat poweron [Days] [Time]

    For example, sudo pmset repeat poweron M 8:00:00 . This means wake every Monday at 8:00 AM.

    Command to set repeating wake power-on time
  2. Press Return.
  3. Type your admin password to confirm.
    Enter admin password

How to set repeating sleep/shutdown time:

  1. To put your Mac to sleep, use the format:

    sudo pmset repeat sleep [Days] [Time]

    For example, sudo pmset repeat sleep MTWRF 23:00:00 . This means sleep every weekday night at 11:00 PM.

    Command to set repeating sleep shutdown time
  2. Press Return.
  3. Enter your Mac’s Administrator password.
    admin password

How to clear all custom schedules:

  1. If you want to erase your automated power routines and return to manual controls, run:

    sudo pmset repeat cancel

    Command to set repeating sleep shutdown time
  2. Press Return.

Classic macOS (Monterey or earlier)

If your computer runs an older OS, Apple provides a very convenient graphical scheduler right inside the settings grid.

  1. Click the Apple Menu and open System Preferences.
  2. Select the Battery icon (on MacBooks) or Energy Saver icon (on desktop iMacs/Mac minis).
    Click Energy Saver
  3. Click Schedule.
    Click Schedule
  4. Check the top box to configure a Start up or wake schedule. Use the dropdown boxes to select the frequency and enter your preferred time.
    Enter start up or wake details
  5. Check the bottom box to configure a Sleep, Restart, or Shut Down schedule. Use the dropdown boxes to select the frequency and enter your preferred time.
    Enter sleep details
  6. Click Apply (or OK) to save your routine.
    Apply button

What are the Different Sleep Modes on Mac?

macOS has 3 main power states:

  • Standard Sleep (Mode 0), which keeps the system RAM fully powered, 
  • Safe Sleep (Mode 3), which saves data to your drive but leaves RAM active, and 
  • Deep Hibernation (Mode 25), which entirely cuts power to RAM for maximum battery savings.

Understanding these modes will help you to balance how fast your Mac wakes up versus how much battery it drains while sitting idle.

Sleep ModeNameWakeup Time
Mode 0Standard SleepInstant
Mode 3Safe SleepFast
Mode 25Deep HibernationSlower

How to Check the Current Sleep Mode of a Mac?

  1. Open Terminal (Applications > Utilities).
    Open Terminal
  2. Enter the following command:

    pmset -g | grep hibernatemode

  3. Press Return.
  4. The terminal will return a number like hibernatemode 3.

How to Change Sleep Modes Via Mac Terminal?

  1. Open Terminal Using Spotlight search (or Applications > Utilities).
  2. Type the following command:

    sudo pmset -a hibernatemode X 

    Replace X with the mode number.

    Hibernate command
  3. Press Return.
  4. Type your Mac’s administrator password and press Return.
    Enter password

To Sum It Up

Every generation of hardware has a clean solution to override Apple’s native power conservation rule. As discussed by Datarecovee, by using the built-in preferences or command line flags, you can easily stop your Mac from sleeping.

So, as per your requirements, choose the native UI or Terminal method and prevent Mac from sleeping.

Frequently Asked Questions

How do I make my Mac screen stay on?

Go to System Settings > Lock Screen. Drag the slider for both “Turn display off on battery when inactive” and “Turn display off on power adapter when inactive” to Never.

How do I deactivate sleep mode?

Open Terminal and type caffeinate -d, then hit Return. Keep the Terminal window open to completely deactivate the system and display sleep. Press Command (⌘) + C to turn it off.

How to change sleep mode on Mac?

To change sleep mode on Mac: open Terminal and enter sudo pmset -a hibernatemode X, replacing X with 0 for Standard Sleep, 3 for Safe Sleep, and 25 for Deep Hibernation. Press Return.

How do I turn on the always-on display on Mac?

There are 2 ways to turn on always-on display on Mac (i.e., keeping mac from sleeping):

  1. Go to System Settings > Lock Screen and set your display inactivity timer to Never.
  2. Open Terminal and type the command: caffeinate -d. Press Return.
How do I put my Mac to sleep with the keyboard?

MacBook Keyboard shortcuts to sleep:

  • On Built-in keyboards without Touch ID:
    • Control + Shift + Power button
    • Control + Power button
  • On Built-in keyboards with Touch ID:
    • Touch ID button
How to prevent Mac from sleeping when the lid is closed?

Go to System Settings > Battery. Toggle ON “Prevent automatic sleeping on power adapter when the display is off” to keep Mac from sleeping when the lid is closed.

Does my Mac stay awake while the screensaver is running?

No, the screensaver does not block system sleep. So, your Mac is still in sleep mode even when you see the screensaver.

What is the difference between display sleep and computer sleep?

Display sleep only turns off the screen backlight to save power. Computer sleep pauses the actual processor (CPU), operations, network connections, etc., which stops your background tasks completely.

Related Posts

Sorry, No post were found