Logo

Prevent Windows VPS from Sleeping

Prevent Windows VPS from Sleeping

Complete guide to prevent Windows VPS from sleeping on RDP disconnection.

Prevent Windows VPS from Sleeping

Introduction

This guide shows you how to prevent your Windows VPS from going to sleep using the graphical interface.

Method: Graphical Interface

Step 1: Configure Power Options

Open Power Settings

  1. Press Windows + R
  2. Type: powercfg.cpl
  3. Press Enter

Modify Active Power Plan

  1. Click on Change plan settings next to your active power plan
  2. Set EVERYTHING to Never:
    • Turn off the display: Never
    • Put the computer to sleep: Never

Advanced Settings

  1. Click on Change advanced power settings
  2. Configure these settings to Never or 0:
    • Hard disk → Turn off hard disk after: Never
    • Sleep → Sleep after: Never
    • Sleep → Allow hybrid sleep: Off
    • Sleep → Hibernate after: Never
  3. Click Apply then OK

Step 2: Configure RDP via Registry Editor

Open Registry Editor

  1. Press Windows + R
  2. Type: regedit
  3. Press Enter
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

Create/Modify These Values

Double-click on each value and set:

  • MaxIdleTime: 0
  • MaxDisconnectionTime: 0
  • MaxConnectionTime: 0
  • Type: DWORD (32-bit)

Note: If these values don't exist, create them:

  1. Right-click in the right pane
  2. Select NewDWORD (32-bit) Value
  3. Name it accordingly
  4. Set the value to 0

Close Registry Editor

Step 3: Disable Screen Saver

  1. Press Windows + R
  2. Type: control desk.cpl,,@screensaver
  3. Press Enter
  4. Set Screen saver to None
  5. Uncheck On resume, display logon screen
  6. Click OK

Step 4: Disable Fast Startup

  1. Press Windows + R
  2. Type: powercfg.cpl
  3. Press Enter
  4. Click on Choose what the power buttons do (left sidebar)
  5. Click on Change settings that are currently unavailable
  6. Uncheck Turn on fast startup (recommended)
  7. Click Save changes

Step 5: Set High Performance Power Plan

  1. Press Windows + R
  2. Type: powercfg.cpl
  3. Press Enter
  4. Select High performance (if not visible, click Show additional plans)
  5. If High Performance is not available, open PowerShell as Administrator and type:
   powercfg -duplicatescheme 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

Verification

Check Power Plan

  1. Press Windows + R
  2. Type: powercfg.cpl
  3. Press Enter
  4. Verify that High performance is selected

Check Sleep Settings

  1. Open Power Options
  2. Click Change plan settings on your active plan
  3. Verify all timeouts are set to Never

Check RDP Settings

  1. Press Windows + R
  2. Type: regedit
  3. Press Enter
  4. Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
  5. Verify that MaxIdleTime, MaxDisconnectionTime, and MaxConnectionTime are all set to 0

Mandatory Restart

For all changes to take effect, restart your server:

  1. Click on Start
  2. Click on Power
  3. Click on Restart

Or use Command Prompt:

shutdown /r /t 60

To cancel the restart:

shutdown /a

Troubleshooting

If Server Still Goes to Sleep

Check Windows Update Settings

  1. Press Windows + R
  2. Type: services.msc
  3. Press Enter
  4. Find Windows Update
  5. Double-click it
  6. Set Startup type to Manual
  7. Click Stop if the service is running
  8. Click OK

Disable Scheduled Tasks

  1. Press Windows + R
  2. Type: taskschd.msc
  3. Press Enter
  4. Navigate to: Task Scheduler LibraryMicrosoftWindowsUpdateOrchestrator
  5. Right-click on any sleep-related tasks
  6. Select Disable

Check Device Wake Settings

  1. Press Windows + X
  2. Select Device Manager
  3. Expand Network adapters
  4. Right-click on your network adapter
  5. Select Properties
  6. Go to Power Management tab
  7. Uncheck Allow this device to wake the computer
  8. Click OK

Additional Configuration (Optional)

Disable Hibernation Completely

  1. Open Command Prompt as Administrator
  2. Type:
   powercfg -h off
  1. Press Enter

Disable System Maintenance

  1. Press Windows + R
  2. Type: control /name Microsoft.ActionCenter
  3. Press Enter
  4. Click Maintenance
  5. Expand Automatic Maintenance
  6. Uncheck Allow scheduled maintenance to wake up my computer at the scheduled time

Conclusion

After following all these steps and restarting, your Windows VPS should never go to sleep again. The graphical interface method is ideal for users who prefer visual configuration over command-line tools.

If the problem persists, your hosting provider might be forcing sleep at the hypervisor level - contact their technical support in this case.

Quick Checklist

  • Power plan set to High Performance
  • All sleep timeouts set to Never
  • Screen saver disabled
  • Fast startup disabled
  • RDP registry values set to 0
  • Hibernation disabled
  • Server restarted
  • Configuration verified

Support

If you continue experiencing issues after following this guide:

  1. Verify each step was completed correctly
  2. Check Windows Event Viewer for sleep-related events
  3. Contact your VPS hosting provider's support team
  4. Consider using the PowerShell method for more comprehensive configuration

Join our Discord community server

For any questions, suggestions, or just to chat with the community, join us on Discord!

900+Members