How to Stop a Mac from Sleeping (Caffeinate -D and Pmset)

Stop a Mac from Sleeping

Want to prevent your Mac from going into sleep mode, or from turning off the screen? Find out here how to stop a Mac from sleeping (in general using System Preferences, just now using Caffeinate, or with a countdown timer).

First, Pigeon’s Got Confused

When thousands and thousands of pigeons lost their way in the late 1990s around Europe and North America, it was a mystery connected by one common occurrence: supersonic flights of the Concorde in the vicinity.

Infrasonic waves from the aircraft, goes the idea that connects the two events, would interfere with other infrasonic sound used by the bids to navigate. Ocean waves continuously shake the earth and make it hum (inaudibly for us) in a characteristic fashion.

So, while we stumble or sleep, birds may listen to the landscape at night to find their way.

Want your Mac to hum through night and day? Here are the ways:

How to Stop a Mac from Sleeping (Ever)

Using System Settings (macOS Ventura 13 and Later)

Time needed: 3 minutes

To stop a Mac running macOS Ventura 13 and later from going into sleep mode altogether using system settings:

  1. Open System Settings or System Preferences on the Mac.

    Here’s how: Select the Apple logo in the menu bar () and choose System Settings… (or System Preferences…) from the menu that has appeared.

  2. Go to the Displays category.

  3. Click Advanced….

  4. Enable Prevent automatic sleeping on power adapter when the display is off

    Sleepy screen: You can always turn off the display.

  5. Click Done.

    Keep a Mac from sleeping using System Settings

Using System Preferences (macOS Monterey 12 and Earlier)

To prevent a Mac using macOS Monterey from sleeping using its system preferences:

  1. Open System Preferences.
  2. Go to the Battery category.
  3. On a laptop, select Power Adapter.
  4. Check Prevent computer from sleeping automatically when the display is off.
    Permanently keep a Mac from sleeping in System Preferences
  5. Click OK if macOS warns you (correctly) about potentially increased energy use.
    Confirm permantly preventing a Mac from sleep

Mac not going to sleep? How to Find Out Why Your Mac Is Not Sleeping

In macOS Catalina 10.5 and earlier, the steps differ slightly:

  1. Select System Preferences… from the Apple menu.
  2. Go to the Energy Saver category.
  3. On a laptop, choose the Power Adapter tab.
  4. Turn on Prevent computer from sleeping automatically when the display is off.

Using the Terminal (Pmset)

To prevent a Mac from going to sleep using the Terminal command prompt:

  1. Open Terminal.
  2. Type pmset -c sleep 0.
    Battery power: The command above will disable sleeping while the computer is plugged in; to also disable sleeping while using battery power, use pmset -a sleep 0 instead.
    Not admin: If you are not an administrator, type sudo pmset -c sleep 0 (or sudo pmset -a sleep 0) and use the admin password.
  3. Press Enter.
    Permanently keep a Mac from sleeping using Terminal

How to Stop a Mac from Sleeping Using Caffeinate (For Now)

To prevent your Mac from sleeping for this while (and keep the sleep settings intact overall):

  1. Open Terminal.
  2. Type caffeinate -i to prevent the computer from entering sleep mode (the disk and display can still turn off).
    Keep the display on: caffeinate -d: prevent the display from turning off;
    Keep the disk on: caffeinate -dm: stop the monitor and hard disk from turning off.
  3. Press Control C to end caffeinate at any time.
    Keep a Mac from Sleeping Indefinitely using Caffeinate on the Terminal

Using Mac Caffeinate with a Countdown Timer

To end the ban on sleeping:

  • Press Control C in Terminal to end the caffeinate command currently running in the foreground.
    Countdown timer: You can also have caffeinate prevent sleep for a certain time, then end automatically with the -t [seconds] command.
    Example: caffeinate -dt 10800 will prevent the display from sleeping for 3 hours (10,800 seconds).
    Stop now: You can still stop the command with ControlC.
    Keep a Mac from Sleeping with a Countdown Timer (Only Terminal Needed)

How to Keep a Mac from Sleeping with Amphetamine (Using Triggers)

Using a third-party utility, you can keep your Mac awake using a myriad of criteria and triggers:

  1. Install Amphetamine from the Mac App Store.
    Amphetamine menu with easy choices for keeping a Mac from sleeping
  2. Pick from criteria and tiggers ranging from simple
    – (time-based or
    – while an app is open or
    – file is downloading)
    to complex
    – (on a specific Wi-Fi network
    – with the battery above a certain threshold or
    – CPU usage above 40% and
    – a USB device connected).
    Amphetamine triggers for keeping a Mac from sleeping

How to Stop a Mac from Sleeping and Use Caffeinate: FAQ

What happens when my Mac runs out of battery power and is set to never sleep?

When the battery level is critically low, a macOS laptop will go into safe sleep (saving the system state to disk for restoration) no matter what.

Can I schedule my Mac’s awake time?

For scheduling times when your Mac needs to be awake without spending much time tinkering, it is best to use a tool like Power Manager.

(How to stop a Mac from sleeping using caffeinate tested with macOS Sonoma 14.1, Ventura 13.4, Monterey 12.0, Big Sur 11.3 and Catalina 10.15; updated December 2023)

Home » Mac Tips and Resources » How to Stop a Mac from Sleeping (Caffeinate -D and Pmset)