Why does my Mac keep waking up from sleep?

Find out what is waking your Mac and stop it, using only built-in macOS power-management tools.

macOSmacossleepmonitoringpmsetPower & SleepbatteryMedium risk
Run the power management event log to see the reason for the last wake events before changing any settings.

What this covers

A Mac that keeps waking on its own drains battery overnight and is annoying to live with. The fix is almost always identifiable: the log records exactly why the machine woke, and the settings tools let you change what needs changing. This guide walks you from diagnosis to a verified fix.

Symptom

?Your Mac wakes by itself minutes after sleeping, or overnight; the screen or fan turns on with no one touching it; battery is noticeably lower every morning.

Find out what woke the Mac

The power management log records the reason for every sleep and wake event — lid open, keyboard input, network traffic, Bluetooth, and more. Read the last twenty events and look for a repeating wake source. If the same cause shows up every time, that is your culprit.

Read the power management event log to see sleep and wake reasons, e.g. lid, keyboard, network or Bluetooth.

Command
$ pmset -g log | grep -E "Entering Sleep|Wake from|DarkWake from" | tail -20

Check what is preventing or interrupting sleep

Apps can hold a power assertion that blocks sleep or triggers a dark wake. The assertions list names each one, so you can spot a runaway app, an audio stream, or a screen-sharing session keeping the machine awake. Once the named process is closed, the assertion should disappear.

List every power assertion — the named reason an app, audio stream, or screen share blocks sleep.

Command
$ pmset -g assertions

Read your current sleep settings

Before changing anything, print the live configuration — battery and charger are listed separately. Look for wake-on-network options and unusually short or zero sleep timers that make the Mac wake easily. Note the values so you can compare after fixing.

pmset -g custom prints the live sleep configuration separately for battery and charger.

Command
$ pmset -g custom

Set a sane idle-sleep timer

If the sleep timer is too short or unset, the Mac cycles between sleep and wake constantly. Set a clear idle-sleep threshold and read the value back to confirm it took effect. Setting 0 disables system sleep entirely — use that only deliberately.

Set exactly how many minutes of inactivity pass before the Mac sleeps, from the command line, and read the current value back.

Command
$ sudo systemsetup -setcomputersleep 15 && sudo systemsetup -getcomputersleep
▾ Undo
Undo
$ sudo systemsetup -setcomputersleep 0

Optionally hold the Mac awake during a long task

Sometimes the wake problem is the opposite: you need the Mac to stay awake for a download or render without changing system settings. caffeinate can suppress display sleep for a fixed period and ends on its own, so nothing is left running afterwards.

macOSKeep Your Mac Awake with caffeinateLow riskStep 5Optional

caffeinate holds sleep off while a command runs, or for a fixed number of seconds.

Command
$ caffeinate -d -t 3600

Verify the Mac sleeps and stays asleep

Put the Mac to sleep manually and give it a minute without touching it. If it does not wake on its own, then re-run the wake log from the first step: no new unexplained wake entries should appear after your fix.

pmset includes two one-shot commands: displaysleepnow blanks the screen, sleepnow puts the whole Mac to sleep.

Command
$ pmset displaysleepnow
!Commands that change power settings require sudo. Setting the sleep timer to 0 disables system sleep entirely, which can leave the Mac running hot or drain the battery — only do that deliberately.

How to confirm it worked

After fixing, put the Mac to sleep manually and leave it alone. Re-check the wake log: no new unexplained wake entries should appear.

Undo everything

Every command above can be reverted. Run these in order to undo all of it.

Undo everything
$ sudo systemsetup -setcomputersleep 0

Review before running — some steps may not be independent.

Sources

  • systemsetup(8) man page
    manpagez.com · technical · 2026-09-17
    Evidence: The systemsetup man page describes -setcomputersleep as setting the system sleep amount in minutes and -getcomputersleep as displaying it.
  • caffeinate — prevent sleep (macOS man page)
    SS64 · technical · 2026-09-17
    Evidence: Documents flags -d (display), -i (system idle), -m (disk), -s (system) and -t seconds for a timed assertion.
  • pmset(1) man page
    Xcode Man Pages (keith.github.io) · technical · 2026-09-17
    Evidence: Lists `-g log` among the -g getter options: display the system power management log including sleep and wake entries with their reasons.
  • pmset - Power management settings
    SS64 · technical · 2026-09-17
    Evidence: Documents `pmset -g log`: 'Display a history of sleeps, wakes, and other power management events', noting the log is for admin and debugging purposes.
  • systemsetup - Set System Configuration Preferences
    SS64 · technical · 2026-09-17
    Evidence: Documents -setcomputersleep minutes (0 = never) and -getcomputersleep for reading the current idle-sleep timer.

Last verified: 2026-09-21

Related guides