How to disable and enable Sleep mode on Mac devices

Edited

A Mac that has gone to sleep cannot accept an incoming remote connection. If you plan to connect to a Mac while you are away from it, turn off automatic sleep on that computer first. This article explains how to disable Sleep mode on a Mac, and how to turn it back on when you no longer need remote access.

Display sleep vs. system sleep

These are two different things, and only one of them blocks remote access:

  • Display sleep turns the screen off but leaves the Mac running. Remote connections still work normally.

  • System sleep suspends the whole computer, including its network connection. The Mac will appear offline and connection attempts will fail until something wakes it.

You only need to prevent system sleep. Letting the display sleep is fine, and saves power.

Before you start

  • You need to make these changes while you are physically at the Mac, or already connected to it.

  • You need an administrator account on that Mac.

  • Notebooks: leave the Mac connected to power. MacBooks sleep on battery regardless of these settings in order to protect the battery.

  • The exact menu names depend on your macOS version. Both the current and the older layouts are covered below.

Disable Sleep mode on macOS Ventura, Sonoma, Sequoia and later

On a desktop Mac (iMac, Mac mini, Mac Studio, Mac Pro):

  • Open the Apple menuSystem Settings.

  • Select Energy Saver in the sidebar.

  • Turn on Prevent automatic sleeping when the display is off.

  • Turn on Wake for network access.

  • Optionally turn on Start up automatically after a power failure, so the Mac comes back on its own after an outage.

On a MacBook:

  • Open the Apple menuSystem Settings.

  • Select Displays, then click Advanced.

  • Turn on Prevent automatic sleeping on power adapter when the display is off.

  • Go back to BatteryOptions and turn on Wake for network access (set it to Always or Only on power adapter).

Disable Sleep mode on macOS Monterey and earlier

  • Open the Apple menuSystem Preferences.

  • On a desktop Mac, click Energy Saver. On a MacBook, click Battery and then select the Power Adapter tab.

  • Drag the Turn display off after slider wherever you like — this does not affect remote access.

  • Select Prevent computer from sleeping automatically when the display is off.

  • Select Wake for network access (or Wake for Wi-Fi network access).

Optional: disable sleep from Terminal

If you want to block sleep completely, including when a MacBook lid is closed, you can use the pmset command. Open Terminal (Applications → Utilities) and run:

sudo pmset -a disablesleep 1

Enter your administrator password when prompted. To confirm the current settings, run pmset -g.

To keep the Mac awake for a single session only, without changing any settings, run caffeinate and leave that Terminal window open. Sleep behaviour returns to normal as soon as you close it or press Control-C.

Re-enable Sleep mode

When you no longer need the Mac to stay reachable, reverse whichever change you made:

  • In System Settings or System Preferences, turn off Prevent automatic sleeping in the same place you turned it on. The Mac immediately goes back to its normal idle-sleep schedule.

  • If you used Terminal, run sudo pmset -a disablesleep 0 to restore the default behaviour.

You can leave Wake for network access enabled either way — it does not keep the Mac awake, it only lets it respond to network activity.

Troubleshooting

  • The Mac still goes offline. Check that it is plugged into power. A MacBook running on battery will sleep even with these settings applied.

  • The lid is closed. Closing the lid puts a MacBook to sleep unless it is on power with an external display and keyboard attached, or you have used the pmset command above.

  • The Mac is asleep and you are already away. A sleeping Mac can sometimes be woken remotely, but only if another computer on the same local network is online and able to send the wake signal. If nothing else is on that network, you will need someone to wake the Mac by hand.

  • The Mac restarted. A Mac with FileVault turned on needs someone to sign in at the machine after a full restart before remote access becomes available again. Sleep and wake are not affected by this.

  • A profile is overriding your choice. On a managed Mac, a configuration profile from your IT team can enforce sleep settings and undo your change. Contact your administrator if the setting will not stay off.

Was this article helpful?

Sorry about that! Care to tell us more?

Thanks for the feedback!

There was an issue submitting your feedback
Please check your connection and try again.