> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Make Ubuntu Not Go in Suspend When Laptop Lid is Closed
- URL: https://itsfoss.com/laptop-lid-suspend-ubuntu/
- Published: 2022-08-31T16:01:36.000Z
- Updated: 2025-05-03T12:46:06.000Z
- Description: In a multi-monitor setup, you probably want the laptop lid closed but it should not suspend the system. Here's how to ensure that with Ubuntu.
- Author: Abhishek Prakash
- Tags: Ubuntu

If you use Ubuntu on a laptop, you might have noticed that the system is suspended when you close the lid.

That’s the expected behavior. It saves the battery as well as your work. You lift the lid, the system wakes up, and you can log in and continue your work.

That all sounds good except when you work with a multi-monitor setup. A few people, like me, prefer to have the laptop closed and only use the external monitor(s).

But if closing the laptop lid suspends the system, it creates a problem.

Let me show you how you can change this behavior.

## Don’t suspend when laptop lid is closed

Actually, I have noticed that the recent versions of Ubuntu are smarter in this sense. When the laptop is connected to a docking station and you close the lid, it doesn’t go in suspend mode.

That’s the normal expected behavior but it may not work all the time for reasons known to Ubuntu gods.

The good thing is that you can force change this behavior using both GUI and command line.

Let me share both methods.

### Method 1: Using GNOME Tweaks

If you are using the default GNOME desktop, you are in luck. [Install GNOME Tweaks tool in Ubuntu](https://itsfoss.com/gnome-tweak-tool/) from the software center or use this command:

```
sudo apt install gnome-tweaks
```

Once installed, start the Tweaks application. In the **General tab** from the sidebar, **toggle off the ‘Suspend when laptop lid is closed’ button**.

![change lid close behavior ubuntu](https://itsfoss.com/content/images/wordpress/2022/08/change-lid-close-behavior-ubuntu.png)

change lid close behavior ubuntu

That’s it. You should not need a restart for changes to take effect.

Now, let’s talk about the command line method.

### Method 2: Change login configuration (for advanced users)

If you look into the content of the file /etc/systemd/logind.conf, you’ll see three different types of default settings for the laptop lid closing.

- HandleLidSwitch: When the laptop is on battery power
- HandleLidSwitchExternalPower: When the laptop is plugged into a power outlet
- HandleLidSwitchDocked: When the laptop is connected to a docking station

![laptop lid settings ubuntu](https://itsfoss.com/content/images/wordpress/2022/08/laptop-lid-settings-ubuntu.png)

Default laptop lid closing settings

As you can see, the laptop will suspend if the lid is closed irrespective of whether it is connected to power or not. Lid closing is ignored for docking station connections.

If you want, you can change the value of those parameters to one of these as per your preference:

- lock: lock when lid is closed
- ignore: do nothing
- poweroff: shutdown
- hibernate: hibernate when lid is closed

I would suggest going with `ignore` if you don’t want your system do anything special when the laptop lid is closed.

You can either edit the `/etc/systemd/logind.conf` file and uncomment the said settings and change their value, or you create a new file in `/etc/systemd/logind.conf.d` directory. Create this directory if it doesn’t exist.

I am not going to give you the exact commands and for good reasons. If you are familiar with the command line, you should be already able to [edit files in the terminal](https://itsfoss.com/edit-files-linux/). 

If you are new to these things, I recommend [getting familiar with nano](https://itsfoss.com/nano-editor-guide/) or even [learning Vim](https://linuxhandbook.com/vim/?ref=itsfoss.com).

If you are uncomfortable with the command line, please stick with the earlier GUI method.

I hope this helps you. Let me know if you have any questions.