Ubuntu includes a built-in automatic suspend feature designed to conserve power on battery-powered systems. This feature often activates after a set period of inactivity or when the laptop lid is closed, allowing the system to enter a low-power sleep mode. Although beneficial in many contexts, it can disrupt tasks that require continuous operation.
The automatic suspend mechanism reduces energy consumption by shifting the system into a minimal power state. While it prolongs battery life, it may interrupt essential processes such as network operations, file transfers, or lengthy computations that need uninterrupted performance.
Modifying power management settings and adjusting logind.conf parameters can override default suspend behavior. These changes help ensure continuous operation, particularly for servers, computational tasks, or remote access scenarios where any unplanned suspend state could cause disruptions.
How to disable Ubuntu from suspending the machine:
- Open the system settings window.
- Click on “Power” in the left-side menu.
- Turn off “Automatic Suspend” under “Power Saving Options.”
- Open the logind.conf file with your preferred text editor.
$ sudo vim /etc/systemd/logind.conf
- Uncomment the necessary lines to disable suspend actions.
HandleLidSwitch=ignore HandleLidSwitchExternalPower=ignore HandleLidSwitchDocked=ignore LidSwitchIgnoreInhibited=no
- Save the changes and close the text editor.
- Check the status of systemd-logind to confirm that your modifications loaded correctly.
$ systemctl status systemd-logind ● systemd-logind.service - Login Service Loaded: loaded (/lib/systemd/system/systemd-logind.service; static) Active: active (running) since ...
- Reboot the system to apply the changes.
This guide is tested on Ubuntu:
Version | Code Name |
---|---|
22.04 LTS | Jammy Jellyfish |
23.10 | Mantic Minotaur |
24.04 LTS | Noble Numbat |

Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.