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:
- The power consumption
- the light is anoying in the night always giving an indication of the server's location
- 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