It is quite easy to change the text font type and its size if you have graphical desktop environment. How would you do that in an Ubuntu headless server that doesn't have a graphical environment? No worries! This brief guide describes how to change Linux console font and size. This can be useful for those who don't like the default font type/size or who prefer different fonts in general.
Change Linux Console Font Type And Size
Just in case you don't know yet, this is how a headless Ubuntu Linux server console looks like.
As far as I know, we can list the installed fonts, but there is no option to change the font type or its size from Linux console as we do in the Terminal emulators in GUI desktop.
But it doesn't mean that we can't change it. We still can change the console fonts.
If you're using Debian, Ubuntu and other DEB-based systems, you can use "console-setup" configuration file for setupcon which is used to configure font and keyboard layout for the console. The standard location of the console-setup configuration file is /etc/default/console- setup.
Now, run the following command to setup font for your Linux console.
$ sudo dpkg-reconfigure console-setup
Choose the encoding to use on your Linux console. Just leave the default values, choose OK and hit ENTER to continue.
Next choose the character set that should be supported by the console font from the list. By default, it was the the last option i.e. Guess optimal character set in my system. Just leave it as default and hit ENTER key.
Next choose the font for your console and hit ENTER key. Here, I am choosing "TerminusBold".
In this step, we choose the desired font size for our Linux console.
After a few seconds, the selected font with size will applied for your Linux console.
This is how console fonts looked like in my Ubuntu 18.04 LTS server before changing the font type and size.
This is after changing the font type and size.
As you can see, the text size is much bigger, better and the font type is different that default one.
You can also directly edit /etc/default/console-setup file and set the font type and size as you wish. As per the following example, my Linux console font type is "Terminus Bold" and font size is 32.
ACTIVE_CONSOLES="/dev/tty[1-6]" CHARMAP="UTF-8" CODESET="guess" FONTFACE="TerminusBold" FONTSIZE="16x32"
Display Console fonts
To show your console font, simply type:
This command will show a table of glyphs or letters of a font.
If your Linux distribution does not have "console-setup", you can get it from here.
On Linux distributions that uses Systemd, you can change the console font by editing "/etc/vconsole.conf" file.
Here is an example configuration for German keyboard.
$ vi /etc/vconsole.conf
Hope this helps.