How to Install New (or Nerd) Fonts on Linux (Ultimate Guide)

Linux TLDR
Last Updated:
Reading time: 5 minutes

A good font (also referred to as typography) is crucial in UI/UX design. However, individuals interested in desktop customization often enjoy having an amazing font of their choice on their system to make it stand out among others.

While users are provided with a variety of fonts to choose from for their system, if you want to install a new font from the internet, then the steps for Windows are quite easy, whereas for Linux, they are a little different.

In this article, Iโ€™ll guide you through various methods to install modern, new fonts on your Linux system for an enhanced desktop experience, including Nerd Fonts for your terminal emulator.

How to Install New Fonts on Linux

The Linux system includes numerous pre-installed fonts, giving users the option to choose from them. However, if your desired font is unavailable, you can typically download it in TrueType (TTF) or OpenType (OTF) file formats. So, letโ€™s begin withโ€ฆ

Downloading Fonts from the Internet

There are multiple sources from which you can download your favorite font for free; the most recommended ones are listed below.

For instance, Iโ€™ll download my favorite โ€œInterโ€ font from Google Fonts, as shown.

downloading new fonts from google fonts

Installing Single Fonts at a Time

The downloaded font file will typically be compressed in zip format, so navigate to the downloaded directory and extract the fonts (for me, itโ€™s โ€œInter.zipโ€œ) from your file manager.

uncompressing font file from desktop manager

Alternatively, you can also run the following unzip command to extract the font file:

$ unzip Inter.zip

Now, proceed to the extracted directory, where you will discover multiple files. Look for .ttf (TrueType Fonts) or .otf (OpenType Fonts) files.

locating font files

Upon finding either of them, open the file; this action will launch the font manager, where you need to click on the โ€œinstallโ€ button located in the top-right corner.

install new font

Wait for a moment until the green โ€œInstallโ€ button turns into a gray โ€œInstalledโ€ button.

new font installed

Alternatively, you can also install your new font from the command line in Linux by moving the .ttf or .otf files to the โ€œ~/.local/share/fonts/โ€ directory.

$ sudo cp *.ttf  ~/.local/share/fonts/

Output:

install new font from command-line

Once installed, you can choose your newly installed font in your favorite applications that offer font selection options, such as Gedit, GIMP, Pinta, etc.

using the new font

Installing Multiple Fonts at Once

Imagine having 50+ fonts to install. With a graphical method, it can become quite tedious, so in this case, you can use the command-line method to install all your desired fonts at once.

To demonstrate, here are a few fonts Iโ€™ve already downloaded from Google Fonts and extracted using the method previously demonstrated in this article.

directory with fonts

In the image above, you can observe that Iโ€™ve removed all unnecessary files except .ttf (retain .otf if it exists) and moved them to a single location.

To install all of them at once, you can either move all of these files to the โ€œ~/.local/share/fonts/โ€ directory from your file manager or use the following command:

$ sudo mv * ~/.local/share/fonts/

Output:

install multiple fonts at once

Installing New Fonts using Font Manager (GUI)

All the above-mentioned methods require multiple steps to install your favorite fonts on Linux; however, this tedious process can be simplified with a tool called a font manager.

The Font Manager is a popular open-source GUI application for managing fonts on your Linux system, allowing you to easily install single or multiple fonts at once or delete your existing ones.

To start, execute any one of the following commands to install the font manager on Linux:

#For Debian, Ubuntu, Linux Mint, etc.
$ sudo apt install font-manager

#For RHEL, Fedora, Alma Linux, etc.
$ sudo dnf copr enable jerrycasiano/FontManager
$ sudo dnf install font-manager

#For Arch, Manjaro, EndeavourOS, etc.
$ sudo pacman -S font-manager

Once the installation is complete, you can find it in your application menu and launch it from there.

font manager app

When you launch it for the first time, the home window interface will resemble the one below.

font manager

The application is quite self-explanatory, but Iโ€™ve highlighted the important options, so here is an explanation of each of them.

  1. List all installed fonts on your Linux system.
  2. Add and install local fonts.
  3. Remove selected fonts.
  4. List all Google Fonts from which you discover and install new fonts.

For instance, to install a new font from Google Fonts, simply click the highlighted โ€œGโ€ with โ€œ4โ€œ, locate your favorite font, and click on the โ€œDownload familyโ€ button to install.

install new font from font manager

If you wish to remove this tool from your system, simply execute one of the following commands based on your Linux system:

$ sudo apt remove font-manager                                                #For Debian, Ubuntu, Linux Mint, etc.
$ sudo dnf remove font-manager                                                #For RHEL, Fedora, Alma Linux, etc.
$ sudo pacman -R font-manager                                                 #For Arch, Manjaro, EndeavourOS, etc.

What are Nerd Fonts for Linux?

Nerd Fonts is a collection of patched fonts that includes a bunch of patched (glyphs) icons to make it compatible with a variety of command-line tools, programming, and scripting languages.

The glyphs (or icons) are chosen from popular fonts such as Font Awesome, Devicons, Font Logos, Material Design Icons, Powerline Symbols, Octicons, Weather Icons, and many others.

As of writing this article, there are currently 50+ nerd fonts, with popular ones like โ€œHackโ€œ, โ€œFira Codeโ€œ, โ€œDejaVuโ€œ, and โ€œDroidSansโ€ being considered the best and most ready-to-use fonts.

So, letโ€™s see how you can install new Nerd Fonts on your Linux system with multiple methods.

Installing Nerd Fonts on Linux

To do so, locate and download a new nerd font from the patched fonts directory, or use the following command to download my favorite โ€œDejaVuโ€ nerd font using the wget command.

$ wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/DejaVuSansMono.zip

To perform a user-specific installation, ensure that the โ€œ~/.local/share/fonts/โ€ directory exists. Next, unzip the compressed nerd font content into the fonts directory, and finally, refresh the font cache by executing the โ€œfc-cache -f -vโ€ command.

$ mkdir -p ~/.local/share/fonts/
$ unzip DejaVuSansMono.zip -d ~/.local/share/fonts/DejaVuSansMono
$ fc-cache -f -v

To perform a system-level installation, just decompress the Nerd Font content into the โ€œ/usr/share/fonts/โ€ directory, then refresh your font cache by executing the โ€œsudo fc-cache -f -vโ€ command.

$ sudo unzip DejaVuSansMono.zip -d /usr/share/fonts/DejaVuSansMono
$ sudo fc-cache -f -v

Once completed, use your new Nerd Font in your preferred application (for instance, gnome-terminal) by navigating to settings and selecting โ€œDejaVu Sans Monoโ€ as your new font.

install nerd font in gnome terminal

Installing Nerd Fonts using getNF

The previous method involved multiple steps that can be eliminated with the getNF command-line tool, an amazing tool that simplifies the process of installing new Nerd fonts.

To install, simply execute the following command on your Linux system:

$ curl -fsSL https://raw.githubusercontent.com/getnf/getnf/main/install.sh | bash

Make sure that โ€œ~/.local/binโ€ is included in your $PATH environment variable, or insert the following line into your default login shell profile, such as ~/.bashrc or ~/.bash_profile for Bash, to persist the changes.

export PATH="$HOME/.local/bin:$PATH"

Finally, execute the following command to launch the getNF command-line interface:

$ getnf

Output:

getNF command-line interface

To install your desired Nerd Font (assuming โ€œHackโ€œ), simply enter the specific number (in this case, โ€œ26โ€œ) in front of your desired Nerd Font.

installing nerd font using getnf

This allows you to effortlessly install your preferred Nerd font without the need to manually visit, download, unzip, install, and refresh the font cache each time you want to install a new Nerd font.

Final Word

I hope you find this article useful. If you have any questions or queries related to the article, feel free to ask them in the comment section.

Till then, peace!

Join The Conversation

Users are always welcome to leave comments about the articles, whether they are questions, comments, constructive criticism, old information, or notices of typos. Please keep in mind that all comments are moderated according to our comment policy.

3 thoughts on โ€œHow to Install New (or Nerd) Fonts on Linux (Ultimate Guide)โ€

  1. getNF is so cool. I often find installing nerd fonts a complex and challenging task, and it makes it totally easy. Thanks for the article, Linux TLDR!

    Reply