How to Completely Disable the ‘console-setup’ Service in Ubuntu Server

The console-setup.service in Ubuntu Server is responsible for configuring the font and keyboard layout on the virtual console (the raw TTY interface you see if you plug a monitor directly into the server). During boot, this service runs to ensure that localized characters display correctly and that non-US keyboard maps are applied to the physical terminal. However, the vast majority of Ubuntu Servers operate completely headless in a rack or as virtual machines in the cloud, accessed exclusively via SSH. In these headless environments, spending CPU cycles and boot time configuring a virtual framebuffer console that no human will ever look at is an unnecessary initialization step.

This guide explains how to completely disable the console-setup service in Ubuntu Server to streamline the boot process for purely headless environments.

Stop and Mask the Console Setup Service

To ensure the systemd initialization sequence bypasses the font and keyboard map configuration, we must disable the service and mask it to prevent any indirect dependencies from triggering it during boot.

  1. Log into your Ubuntu Server via SSH using an account with sudo privileges.
  2. First, ensure the service is stopped (though it typically exits after boot, this clears its state):
    sudo systemctl stop console-setup.service
  3. Next, disable the service to prevent it from being called during the normal multi-user target boot sequence:
    sudo systemctl disable console-setup.service
  4. To guarantee that no other init script can accidentally invoke it, mask the service entirely:
    sudo systemctl mask console-setup.service

Verify the Boot Optimization

By masking the service, you have effectively symlinked its unit file to /dev/null. The server will now skip the process of loading custom fonts and keyboard layouts to the physical TTY framebuffer, falling back to the kernel’s default (usually a basic VGA font and US keyboard layout), which is perfectly fine since you only interact with the machine via SSH.

To verify the lockdown is successful, run the following command to check the status of the daemon:

systemctl status console-setup.service

The output will clearly state that the service is masked. You have successfully eliminated a redundant initialization step, slightly optimizing the boot time of your headless server deployment.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.