Resource center

Prevent computer from sleeping

Keeping your computer on all the time is essential for many automated tasks, whether it’s for running scripts, maintaining a server, or simply ensuring that processes continue uninterrupted. This guide will walk you through how to disable sleep mode and keep your computer awake across different operating systems including Windows 11, 10, 8, 7, macOS, Linux, and Windows Server.

Windows 11/10
  1. Access Power & Sleep Settings:
    • Right-click on the Start button and select Settings.
    • Navigate to System > Power & sleep.
    • Under the Screen and Sleep sections, set both to Never to keep your computer awake.
  1. Disable Sleep Mode via Control Panel:
    • Open the Control Panel.
    • Navigate to Hardware and Sound > Power Options.
    • Choose Change plan settings next to your selected power plan.
    • Set Put the computer to sleep to Never.
  1. Advanced Power Settings:
    • In the Power Options, click on Change advanced power settings.
    • Expand the Sleep section, and set Sleep after to Never.
    • Do the same for Hibernate after if present.
Windows 8/8.1
  1. Access Power Options:
    • Right-click the Start button and select Power Options.
    • Select Change when the computer sleeps.
  1. Adjust Sleep Settings:
    • Set Turn off the display and Put the computer to sleep to Never.
    • Click Save changes.
Windows 7
  1. Open Power Options:
    • Click the Start button, and select Control Panel.
    • Navigate to Hardware and Sound > Power Options.
  1. Change Plan Settings:
    • Click Change plan settings next to your selected power plan.
    • Set Put the computer to sleep to Never.
  1. Prevent Sleep Mode:
    • Click on Change advanced power settings.
    • In the pop-up, set Sleep > Sleep after to Never.
Windows Server 2008/2012/2016/2019/2022
  1. Access Power Options:
    • Open Server Manager.
    • Go to Local Server, and then click Power Options.
  1. Prevent Sleep:
    • Set Turn off the display and Put the computer to sleep to Never.
    • Confirm by clicking Save changes.
MacOS
  1. Open System Preferences:
    • Click on the Apple menu and select System Preferences.
    • Click on Energy Saver.
  1. Adjust Sleep Settings:
    • Drag the slider to Never under both Turn display off after and Computer sleep.
    • Ensure the checkbox for Prevent computer from sleeping automatically when the display is off is checked.
  1. Use Terminal (for advanced users):
    • Open Terminal.
    • Type sudo pmset -a sleep 0 and hit Enter. This will disable sleep mode.
Linux (Ubuntu)
  1. Access Power Settings:
    • Open Settings from the system menu.
    • Navigate to Power.
  1. Disable Sleep:
    • Set Blank screen to Never.
    • Turn off Automatic suspend.
  1. Use Command Line (optional):
    • Open Terminal.
    • Run the command xset s off to disable screen saver and sleep.

Ensuring that your computer stays on continuously is crucial for the reliability of automation processes. By following the above steps, you can prevent your machine from entering sleep mode across different operating systems, ensuring that your tasks run without interruption.