It seems like you are using an ad blocker. To enhance your experience and support our website, please consider:

  1. Signing in to disable ads on our site.
  2. Sign up if you don't have an account yet.
  3. Or, disable your ad blocker by doing this:
    • Click on the ad blocker icon in your browser's toolbar.
    • Select "Pause on this site" or a similar option for INITAcademy.org.

Disable Suspend on Lid Close for Lenovo thinkpad T450p running Ubunntu Server

By zooboole
Published | Updated | 5

Recently I installed my web server at home to allow me some freedom on my basic websites. For that, I have installed ubuntu server 20.04 on a a Lenovo thinkpad T450p. The server runs well, I have my websites well configured and everything is OK. But the issue is that the screens stay on all the time. If i close the lid, the server hibernates and the sites go down. I had issues with the screen being always one:

  1. The power consumption
  2. the light is anoying in the night always giving an indication of the server's location
  3. It doesn't look Pro

For weeks I kept on asking myself if there was a way to close it, have the screen turned off and still have the server running, and when I open the screen can come back on?

With bit of Googling and AI i found out that it's actually a simple thing. By default, the system is configured to suspend when the lid closes; we just have to change that. Here is how to do it:

Edit the logind configuration file

sudo nano /etc/systemd/logind.conf

Find these lines (they may be commented with #):

#HandleLidSwitch=suspend
#HandleLidSwitchDocked=ignore

Change them to:

HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
HandleLidSwitchExternalPower=ignore

Restart the service

sudo systemctl restart systemd-logind

Or simply reboot the server altogether

sudo reboot

Last updated 2026-03-02 UTC

0 Comment

Sign in to join the discussion

No discussion yet.