# Turn off the screen of your laptop on ubuntu server

**URL:** https://eijil.com/t/turn-off-the-screen-of-your-laptop-on-ubuntu-server/392
**Category:** 其它
**Created:** [November 21, 2022, 12:30pm UTC](https://eijil.com/t/turn-off-the-screen-of-your-laptop-on-ubuntu-server/392 "2022-11-21T12:30:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Tristan](https://eijil.com/user_avatar/eijil.com/tristan/32/986_2.png) [@Tristan](https://eijil.com/u/Tristan)
#### Post date: [November 21, 2022, 12:30pm UTC](https://eijil.com/t/turn-off-the-screen-of-your-laptop-on-ubuntu-server/392/1 "2022-11-21T12:30:38Z")

</div>

It makes sense to turn off the screen of your laptop if you’re running your server on it.

Following steps work on Ubuntu 22.04

> <https://askubuntu.com/questions/1244358/ubuntu-20-04-server-turn-off-screen-until-i-press-a-key>

[https://dannyda.com/2019/06/19/turn-off-display-automatically-on-ubuntu-18-04-server-with-text-boot/](https://dannyda.com/2019/06/19/turn-off-display-automatically-on-ubuntu-18-04-server-with-text-boot/)

Create a file:

```bash
sudo nano /etc/systemd/system/enable-console-blanking.service

```

And put this into the file:

```auto
[Unit]
Description=Enable virtual console blanking

[Service]
Type=oneshot
Environment=TERM=linux
StandardOutput=tty
TTYPath=/dev/console
ExecStart=/usr/bin/setterm -blank 1

[Install]
WantedBy=multi-user.target

```

Then change the file rights and enable the service:

```bash
sudo chmod 664 /etc/systemd/system/enable-console-blanking.service
sudo systemctl enable enable-console-blanking.service

```

Open **`/etc/default/grub`**  
Add **`consoleblank=0`** to **`GRUB_CMDLINE_LINUX_DEFAULT=`** as parameter.  
do `sudo update-grub` then reboot

And reboot the server.
