Installing a custom font in Linux makes the typeface available to desktop applications, browsers, editors, and document tools without embedding the font into every file. That keeps branding, templates, and design work consistent across the apps you actually use.
Most current Linux desktops expose fonts through fontconfig, which scans configured font directories, builds caches, and presents the available families to GTK, Qt, LibreOffice, browsers, and other software. For a normal desktop login, the default per-user font library is $XDG_DATA_HOME/fonts, which resolves to ~/.local/share/fonts unless that environment variable has been changed.
Per-user installation is the safest default because it does not require sudo and it only affects one account. If every local user needs the font, use a dedicated directory under /usr/local/share/fonts instead of dropping administrator-managed files into /usr/share/fonts, then rebuild the cache with sudo fc-cache. In both cases, applications that were already open may need to be restarted before the new family appears in their font menu.
Methods to install custom fonts in Linux:
Steps to install custom fonts locally:
Installing a font locally keeps the change inside the current user's home directory. Use this when only one desktop account needs the font or when you do not want to change the shared system font set.
- Create the per-user font directory if it does not already exist.
$ mkdir -p ~/.local/share/fonts
- Copy the new .ttf or .otf files into the per-user font directory.
$ install -m 0644 ~/Downloads/GuideSans-Regular.ttf ~/.local/share/fonts/
The sample file name is only an example. Copy every file from the same font family, such as regular, bold, italic, and bold italic variants, if you want those styles to appear correctly in applications.
- Rebuild the per-user fontconfig cache so the new files are indexed for the current account.
$ fc-cache -f -v ~/.local/share/fonts Font directories: /home/user/.local/share/fonts /home/user/.local/share/fonts: caching, new cache contents: 1 fonts, 0 dirs fc-cache: succeeded
The cache command is successful when it ends with fc-cache: succeeded and there are no read-permission errors for the copied files.
- Query the copied file path to confirm that fontconfig indexed the new font file.
$ fc-list | grep 'GuideSans-Regular.ttf' /home/user/.local/share/fonts/GuideSans-Regular.ttf: DejaVu Sans:style=Book
The path on the left proves that fontconfig found the copied file. The family name on the right comes from the font's internal metadata, so it may not match the filename exactly.
- Reopen the application that should use the font and choose the new family from its font list.
Many desktop applications read the font list only at launch. If the font does not appear immediately, close the application completely and open it again.
Steps to install custom fonts system-wide:
A system-wide install puts the font in a shared directory that fontconfig scans for every local account. Use this when the font should be available to multiple users, shared desktop sessions, or services that generate documents with a specific typeface.
- Create a dedicated directory under /usr/local/share/fonts for the custom family.
$ sudo install -d /usr/local/share/fonts/custom
Use /usr/local/share/fonts for administrator-added fonts so package-managed files under /usr/share/fonts stay separate.
- Copy the font files into the shared font directory with world-readable permissions.
$ sudo install -m 0644 ~/Downloads/GuideSans-Regular.ttf /usr/local/share/fonts/custom/
Applications can skip the font if the copied files are not readable by other users, so avoid restrictive modes such as 600 on shared font files.
- Rebuild the system font cache for the shared directory.
$ sudo fc-cache -f -v /usr/local/share/fonts/custom Font directories: /usr/local/share/fonts/custom /usr/local/share/fonts/custom: caching, new cache contents: 1 fonts, 0 dirs fc-cache: succeeded
Rebuilding only the shared directory keeps the cache refresh focused on the files you just added.
- Query the shared file path to confirm that fontconfig indexed the new system-wide font.
$ fc-list | grep '/usr/local/share/fonts/custom/GuideSans-Regular.ttf' /usr/local/share/fonts/custom/GuideSans-Regular.ttf: DejaVu Sans:style=Book
- Reopen the application or sign out of the desktop session if another user still does not see the new font.
Long-running sessions and sandboxed applications can keep an old font list until they restart.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
