How to Stop Ubuntu from Automatically Suspending When Connected to AC Power

To meet modern European and international energy efficiency standards, recent releases of Ubuntu desktop (including Ubuntu 22.04 LTS and Ubuntu 24.04 LTS) enable aggressive automatic power management by default. Even when your laptop is plugged into mains wall electricity or your desktop tower is actively powered, Ubuntu automatically puts the computer into deep sleep (suspend mode) after 15 to 20 minutes of mouse and keyboard inactivity. While saving electricity is commendable, this automated suspension causes severe workflow interruptions. Long file downloads halt midway, overnight video rendering projects crash, large machine-learning training runs abort, and remote SSH or Plex media connections drop dead without warning. If you require your workstation to stay awake while connected to mains electricity, you can adjust your power rules. Here is how to stop Ubuntu from automatically suspending when connected to AC power.

Why Disable Automatic Suspend on AC Power in Ubuntu?

Allowing Ubuntu to remain continuously active when plugged in provides several distinct workstation advantages:

  • Uninterrupted Overnight Tasks: Keeps multi-gigabyte system backups, torrent downloads, disk defragmentation, and software compilations running without supervision.
  • Reliable Remote Access: Ensures home lab servers, headless workstations, and office PCs remain reachable over SSH, VNC, or Nextcloud at all hours.
  • Continuous Media Streaming: Prevents network drops when streaming movies or music from your Ubuntu machine to smart TVs or mobile devices.
  • Safe Screen Blanking Preserved: Disabling system suspension does not prevent your monitor from powering off to save screen hardware and electricity.

Method 1: Disable Automatic Suspend via Ubuntu Settings (GUI Method)

The simplest way to configure sleep behaviour on desktop systems is through the GNOME Settings app:

  1. Open Settings from your application menu or click the system tray icons in the top-right corner and select the gear icon.
  2. In the left sidebar, click on Power.
  3. Locate the Power Saving Options section.
  4. Click on Automatic Suspend.
  5. In the dialogue box that pops up:
    • On laptops, you will see two tabs or switches: On Battery Power and Plugged In. Toggle the switch for Plugged In to the Off position (or set its delay timer to Never).
    • On desktop tower PCs, simply toggle the main Automatic Suspend switch to Off.
  6. Click the close button to save your settings.

Your computer will now remain continuously powered on with all CPU processes and network interfaces active whenever connected to AC power.

Method 2: Disable Sleep on AC Power Using Terminal (gsettings Command)

If you manage your machine headlessly over SSH, work in a terminal environment, or want to automate setup scripts, use gsettings:

  1. Open your Terminal (Ctrl + Alt + T).
  2. Execute the following command to set the AC power sleep timeout to zero (disabled):
    gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
  3. Next, ensure the timeout counter is disabled:
    gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
  4. Verify the active setting by running:
    gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
    The terminal will output 'nothing', confirming that suspend is disabled.

Comparison: Default Ubuntu Power Settings vs Workstation Configuration

Trigger Condition Default Setting Workstation Setting System Behaviour
Plugged In (AC Power) Suspends after 15–20 mins Never / Nothing CPU, RAM, and network remain 100% active
On Battery (Laptops) Suspends after 15 mins Suspends after 15 mins Preserves portable battery life on the move
Screen Blanking Turns screen black after 5 mins Turns screen black after 5–10 mins Protects monitor panels without sleeping OS

How to Keep Display Blanking Active to Save Electricity

Disabling system sleep does not mean your monitor must remain brightly illuminated when you step away from your desk. Keep your display energy-efficient without halting background tasks:

  1. In Settings > Power, locate Screen Blank.
  2. Select an interval such as 5 minutes or 10 minutes.

When you walk away, the display panel enters low-power standby, while your processor, disks, and network continue executing your tasks at full speed.

Get the best tech tips delivered straight to your inbox.

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