How to Disable Automatic Suspend (Sleep Mode) in Ubuntu

The Dropped Connection

By default, Ubuntu Linux is configured for energy efficiency. If you walk away from your computer for 20 minutes, the operating system will automatically enter a deep “Suspend” state (sleep mode). While this is fantastic for conserving battery life on a laptop, it is a catastrophic feature if you are using Ubuntu as a dedicated server. When the machine suspends, it shuts down its network interfaces. Any active SSH sessions will immediately disconnect, ongoing file transfers will fail, and your locally hosted web server will go completely offline. If you want a machine to run continuously 24/7, you must permanently disable the automatic sleep timer.

How to Turn Off Automatic Suspend

You can revoke the operating system’s permission to go to sleep via the main power settings.

  1. Click the System Menu in the top-right corner of the Ubuntu desktop (where the battery and network icons are).
  2. Click on Settings (the gear icon).
  3. In the left-hand sidebar, click on Power.
  4. Look under the “Power Saving Options” section.
  5. Click on Automatic Suspend.
  6. A small pop-up window will appear. Toggle the switch for Plugged In to the Off position.
  7. If you are configuring a laptop that you intend to use as a server while on battery, toggle the On Battery Power switch to Off as well.
  8. Close the pop-up window.

The Always-On Server

The change takes effect immediately. You can now walk away from the machine forever, and the motherboard will remain fully energized. To save electricity, you should still configure the Blank Screen setting (located in the same Power menu) to turn off the physical monitor after 5 minutes, as turning off the display does not interrupt the CPU or the network connection.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.