Turn off display automatically on Ubuntu 18.04 server with text boot

Open /etc/default/grub in any text editor (e.g. sudo nano, sudo vi etc.)

Add consoleblank=0 to GRUB_CMDLINE_LINUX_DEFAULT= as parameter.

e.g.

If it is GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" change to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash consoleblank=0"

If it is GRUB_CMDLINE_LINUX_DEFAULT="text" change to GRUB_CMDLINE_LINUX_DEFAULT="text consoleblank=0"

Finally, do sudo update-grub then reboot.

Note: If you already boot from text mode, chance is you will have GRUB_CMDLINE_LINUX_DEFAULT=”text”

What does this change do?

Without consoleblank=0 after the server boot into text mode, after timeout, the screen will go blank with screen powered on (Dimmed screen), adding consoleblank=0 at the end of GRUB_CMDLINE_LINUX_DEFAULT=, will actually turn off the display after timeout instead of dim the display.

Alternatively, if you are running server on a laptop, the easiest way is to close the lid and still keep the server running, refer to this post: How to: Keep Ubuntu Server running on laptop with lid closed