How to Add Custom Fonts to ONLYOFFICE Document Server

To make a custom typeface available in ONLYOFFICE Docs, install its font files on the machine or container running Document Server, regenerate the server's font list, and check the result in an editor and an exported document. The exact file-persistence step depends on whether your server is installed directly on Linux or runs in Docker.

A successful change means the font appears by its family name in the editor's font picker and displays as expected in a test document. Seeing a name in the menu is a useful first check, but it does not prove every style, language, or export path works. Check regular and bold text, any needed character sets, and a PDF or print preview before using the font for production documents.

What changes when you install a font?

ONLYOFFICE Docs uses fonts available to the Document Server host and builds font metadata for its editors. The vendor's installation guides list TrueType and OpenType families, including .ttf, .otf, .ttc, and related formats, as well as WOFF formats. Supported file types do not guarantee that every font file or font feature will behave identically; test the specific font and document you plan to use.

The server-side font installation lets connected editors use the font through Document Server. It does not install the typeface on every user's computer or on other document-processing servers. If a downloaded or separately opened file is viewed in software that lacks the font, that software may substitute another typeface. ONLYOFFICE also notes that documents can be displayed with a closest substitute when the server does not have a font used in the document, which can change line breaks or page layout.

Use font files you are authorized to deploy on a server. Keep the files and their license terms with your deployment records, especially if the font has restrictions on server use, redistribution, or embedding in documents.

Choose the right installation method

  • Linux package installation: copy the font files into the system font directory on the Document Server machine, then run ONLYOFFICE's font-generation script. This is appropriate when you manage the host directly.
  • Docker container: mount a persistent host directory into the container's font directory, or copy fonts into a running container for a short-lived test. Regenerate the font metadata inside the container. A bind mount survives container recreation; a one-time copy into the container generally does not.
  • Managed or integrated deployment: if another platform or an installation tool manages the Document Server container, apply the persistent mount through that deployment's configuration. Editing a running container alone may be lost during an update or replacement.

ONLYOFFICE's currently published font guides show the same main flow for Community Edition on Linux and Docker, and publish a separate Linux guide for Enterprise Edition. Paths, permissions, and container orchestration can vary with your version and installation method, so use your deployment's existing configuration rather than replacing it with a sample from another environment.

Add fonts on a Linux installation

1. Prepare and install the font files

Obtain the required family files, including the real bold and italic variants if the family provides them. Keep a regular family together in a clearly named directory. For example, an administrator might place a font family under /usr/share/fonts/, the system location used in ONLYOFFICE's Linux instructions:

sudo mkdir -p /usr/share/fonts/custom/brand-sans
sudo cp BrandSans-*.ttf /usr/share/fonts/custom/brand-sans/

Replace the example filenames with files you actually have. Avoid renaming font files as a way to change their family name; editors use metadata stored inside each font file. Make sure the Document Server processes can read the files. If you manage fonts through a package or configuration-management system, use that process so the files remain present after maintenance.

2. Regenerate the ONLYOFFICE font list

Run the vendor's font-generation script after installing the files:

sudo /usr/bin/documentserver-generate-allfonts.sh

Allow the script to finish and review its output for errors. This step updates the font data used by Document Server; simply copying a font file to the host may not make it appear in an already running editor. Do not remove existing server fonts as part of this procedure. The vendor warns that deleting system fonts can affect document layout and display.

Add fonts to a Docker deployment

1. Make the font directory persistent

For a deployment managed with Docker Compose, add a bind mount to the existing Document Server service. Create a host directory for the files, then map it to the container's custom-font directory. ONLYOFFICE's Docker image declares /usr/share/fonts/truetype/custom as a volume, and its Docker font instructions also allow copying fonts under /usr/share/fonts/.

services:
  onlyoffice-documentserver:
    image: onlyoffice/documentserver:<your-pinned-version>
    volumes:
      - /srv/onlyoffice/fonts:/usr/share/fonts/truetype/custom

This is a snippet to merge into your current Compose file, not a complete replacement configuration. Keep your existing image version, networks, environment variables, data volumes, secrets, and service name. Prepare the font files on the host at /srv/onlyoffice/fonts and ensure the container can read them.

Applying a changed Compose file may recreate the Document Server container and interrupt active editing sessions. Check your deployment procedure, make a backup of the Compose configuration, and schedule the change appropriately. If the container is managed by an appliance or integration, use its supported configuration method instead of editing a generated Compose file.

2. Recreate or restart, then generate font metadata

Apply the mount using the normal Compose workflow for your deployment. Then run the font-generation script inside the actual Document Server container. For a container named onlyoffice-documentserver, the command is:

docker exec onlyoffice-documentserver   /usr/bin/documentserver-generate-allfonts.sh

Use the container name or ID shown by docker ps. If you only want to check a font before making the setup persistent, the vendor documents copying font files into a running container with docker cp, followed by running the same script inside it. Treat that as a test: files copied into a container may disappear when the container is replaced.

Verify the font in an editor and in output

  1. Open a document in an editor connected to this Document Server and open the font picker. Search for the font's family name as recorded in its metadata.
  2. Create a short test document with ordinary text, bold text, and characters from the language scripts you need. Confirm that the correct weight is selected rather than a synthetic or substituted style.
  3. Save, reopen, and export or print-preview the test document. Compare line breaks, page count, spacing, and glyph coverage with the expected result.
  4. Repeat the check in the document editor or application your users actually use. A font available in the server does not guarantee that an unrelated local application or another server has it.

For older installations, browser-side cached font metadata can delay what users see. ONLYOFFICE's published guides say that for version 8.1.3 or earlier, clear the browser cache and reopen the page after adding fonts; for later versions, this step is not required. First verify the server-side files and generated metadata, then use that cache advice only when it matches your version.

If the font is missing or the layout changes

  • The font is absent from the picker: confirm that the file is in the font directory on the Document Server host or inside the correct container, is readable, and has a supported file type. Run the font-generation script again and read its output. In Docker, check the mount from inside the container; a host path alone does not prove the volume is attached to the active service.
  • The family name looks different: check the font's embedded family metadata. A filename such as BrandSans-Bold.ttf may be installed correctly while the menu shows the family name defined inside the font.
  • The font appears but text is wrong: test whether the font includes the required characters and actual style files. A font can appear in the picker but lack a glyph or weight used by the document.
  • Documents reflow after the change: compare the exact font family and style used before and after. If the original font is missing on another machine or export service, a substitute can change layout. Install the licensed font wherever rendering occurs, or use a document-safe alternative and review the pages again.
  • The font disappears after an update: check whether the installation was made only inside a disposable container. Move the files to a persistent host directory and attach it through the deployment configuration before recreating the service.

Adding custom fonts is most useful when the same family is needed in shared documents and controlled exports. It has limits: server installation does not grant font usage rights, add missing glyphs to a font, or guarantee pixel-identical rendering in software that uses a different font set. Keep the custom font directory under version control or configuration management, document the Document Server version, and rerun the verification checks after upgrades.

Official references

Leave a Comment

How to Create and Send a Meeting Invite in Outlook

How to Create and Send a Meeting Invite in Outlook

Create an Outlook meeting invite, add required or optional attendees, choose a time, add Teams details, set recurrence, and check replies in new or classic Outlook.

How to Add a Character Limit to Cells in Excel

How to Add a Character Limit to Cells in Excel

Use Excel's Data Validation settings to set a maximum, minimum, exact length, or character range, then add clear prompts and error alerts.

How to Fix the “We Can’t Schedule the Meeting” Error in Outlook

How to Fix the “We Can’t Schedule the Meeting” Error in Outlook

Fix the Outlook “We can’t schedule the meeting” error by checking account support, refreshing Teams sign-in, and repairing the Classic Outlook add-in.

How to Change the Language in Office 365 (Microsoft 365)

How to Change the Language in Office 365 (Microsoft 365)

Change Office 365 menus, spelling and grammar settings, or keyboard input in desktop apps and Microsoft 365 for the web.

How to Auto-Forward Emails in Outlook 365

How to Auto-Forward Emails in Outlook 365

Learn how to auto-forward all or selected emails in Outlook 365 using Forwarding settings or Rules, plus how to stop forwarding and fix blocked external forwards.

How to Use Microsoft Editor in Word for Microsoft 365

How to Use Microsoft Editor in Word for Microsoft 365

Use Microsoft Editor in Word for Microsoft 365 to check spelling, grammar, clarity, and conciseness, review suggestions, and tune proofing settings.

How to Add an RSS Feed to Outlook 365 in Classic Outlook

How to Add an RSS Feed to Outlook 365 in Classic Outlook

Learn how to add an RSS feed to Outlook 365 in classic Outlook for Windows, find the correct feed URL, manage subscriptions, and fix common RSS issues.

How to Go to a Page in Word for Microsoft 365

How to Go to a Page in Word for Microsoft 365

Jump straight to any page in Word for Microsoft 365 with Ctrl+G or F5, relative page numbers, or the Navigation pane, with Windows and Mac shortcuts.

How to Add Contacts to Outlook on Web, Windows, and Mobile

How to Add Contacts to Outlook on Web, Windows, and Mobile

Learn how to add contacts to Outlook on the web, new Outlook, classic Outlook, and mobile, plus how contact syncing and CSV imports work.

How to Change the Microsoft Word Background Color or Add an Image

How to Change the Microsoft Word Background Color or Add an Image

Change a Word page color, add a picture background, remove either, and enable background printing on Windows or Mac with clear, current steps.