Make Custom Fonts Available in Collabora CODE Docker

To make a custom font render in Collabora Online CODE running in Docker, keep the font files on the host and mount the same directory into both the container’s system font directory and its document systemplate. The systemplate supplies files to isolated document processes; mounting fonts only into /usr/share/fonts can make a family appear in the font menu without making it render in the document. This guide uses Docker Compose and the current CODE image path /opt/cool/systemplate; verify the path if you use another image line.

A file manager open to a collabora-fonts folder containing regular and bold TTF files
Keep the licensed font files together in a host directory that Docker can read.

Choose a font source you can maintain

A read-only bind mount is usually the simplest option for one Docker host. It preserves the font files when the CODE container is recreated or upgraded, and you can review exactly which files the container can read. Use font files you are authorized to install and redistribute to the server. Do not copy an entire desktop system’s font directory unless you have checked its licenses and need those files.

Use uncompressed font files in formats supported by your environment, commonly TrueType (.ttf) or OpenType (.otf). Include the styles your documents need, such as regular, bold, italic, and bold italic. Keep family names and file names clear, and make sure the container user can read every directory and file. A font that contains only one style may cause Collabora to substitute another face when a document requests bold or italic.

First create a dedicated host directory and copy the authorized files into it:

sudo mkdir -p /srv/collabora/fonts
sudo cp BrandSans-Regular.ttf BrandSans-Bold.ttf /srv/collabora/fonts/
sudo chmod -R a+rX /srv/collabora/fonts

Replace the example filenames with your actual font files. The read permission matters because the CODE process runs as an unprivileged account in current images. Keep the directory path stable; the Compose bind mounts will refer to it.

Mount fonts into both the host font tree and systemplate

In your existing collabora service in docker-compose.yml, add these volume entries. Preserve your existing image, ports, domain allowlist, SSL settings, secrets, and restart policy; the snippet below shows only the font mounts.

A Docker Compose YAML snippet mounting one host font folder read-only into the system font and systemplate font directories
Add both read-only mounts under the existing CODE service’s volumes section.
services:
  collabora:
    volumes:
      - /srv/collabora/fonts:/usr/share/fonts/truetype/more:ro
      - /srv/collabora/fonts:/opt/cool/systemplate/usr/share/fonts/truetype/more:ro

The first target makes the fonts available to the container’s regular font discovery. The second target places them inside the template used to prepare isolated document environments. Collabora’s SDK manual documents this two-location volume pattern for Docker. Do not mount over the whole /usr/share/fonts or systemplate directory: that can hide fonts already supplied by the image.

The systemplate path is version-sensitive. The current CODE 26.04 image metadata identifies /opt/cool/systemplate as its system template path, and Collabora’s current documentation uses that location. If you run an older image or a vendor-specific build, inspect that image’s documentation or startup configuration before editing the target path.

Recreate the container and confirm font discovery

After saving the Compose file and placing the font files on the host, recreate the CODE service so Docker applies the bind mounts:

A terminal showing Docker Compose recreating the Collabora service and running fc-list to inspect available fonts
Recreate the service, then use fc-list to see whether Fontconfig detects the font family.
docker compose up -d --force-recreate collabora
docker compose exec -T collabora fc-list

In the output, look for the font family name or the mounted file path. To narrow the list, pipe it through grep with the family name reported by the font itself, for example:

docker compose exec -T collabora fc-list | grep -i "Brand Sans"

If the command reports no match, check the host path, file permissions, mount indentation, and container logs. You can inspect the effective mounts with docker inspect on the running container, or use docker compose config to catch YAML indentation mistakes. Running docker compose down is not normally needed just to apply the volume change; recreating the service is sufficient.

Verify that the font renders inside an actual document

Collabora Online with a custom font family selected in the toolbar and sample text visible on the document page
Check both the font picker and the rendered text in a document after reopening it.

Open a test document through the normal Nextcloud or WOPI integration, select a short sample of text, and choose the custom family from the font picker. Type a new line in that font, save, close, and reopen the file. Check regular and bold text, and compare line breaks or page layout with the source document. A family appearing in the menu is only a discovery check; visible text after reopening is the useful rendering check.

  • Font appears in the menu but text disappears or falls back: confirm the second mount targets the systemplate font directory and that it contains the same files.
  • Font is missing from the menu: confirm the files are valid and readable, then inspect fc-list output and the container startup logs.
  • Font works until an image update: verify both mounts remain in Compose and that your host directory is not inside a temporary container path.
  • Only some characters render: the selected font may not contain those glyphs. Add a font with the required script coverage or use a suitable fallback.

A bind mount keeps fonts independent from the CODE image, but it does not guarantee identical layout on every client or in every document. Font substitution, missing glyphs, different font versions, and document-specific formatting can still change line wrapping. For additional configuration details, use Collabora’s font installation documentation, its CODE Docker image guide, and the Collabora Online SDK manual. The manual’s Docker example and current image documentation should be checked again when you change CODE versions.

Leave a Comment

Clear Nextcloud’s File Locking Warning with Redis

Enable reliable Nextcloud file locking, choose the right Redis or Valkey backend, and verify the warning clears without risking concurrent file changes.

What It Takes to Target an A+ Nextcloud Security Rating

What It Takes to Target an A+ Nextcloud Security Rating

Fix common Nextcloud scan findings with current updates, HTTPS and HSTS, precise reverse-proxy trust, and checks against the public server.

Automate Consistent Nextcloud Backups with Restic and Cron

Automate Consistent Nextcloud Backups with Restic and Cron

Back up Nextcloud’s files and MariaDB together, schedule encrypted Restic snapshots with cron, and verify recovery without risking the live server.

Enable Nextcloud Server-Side Encryption with Measured Impact

Configure Nextcloud SSE for the storage that needs it, protect encryption keys, and measure transfer and CPU impact before encrypting existing files.

Add Elasticsearch Full-Text Search to Nextcloud

Connect Nextcloud’s file search to Elasticsearch, index document contents, and choose a setup that fits your server and security needs.

Set a Reliable Expiration Policy for Nextcloud Deleted Files

Set a Reliable Expiration Policy for Nextcloud Deleted Files

Configure Nextcloud to remove deleted files after a defined retention period, schedule background jobs reliably, and avoid commands that purge every user’s trash.

Clear Nextcloud’s Missing Database Indexes Warning

Clear Nextcloud’s Missing Database Indexes Warning

Run Nextcloud’s OCC repair safely, preview the database changes, and check why the warning might remain.

Raise Nextcloud’s Web Upload Limit Past 2 GB

Raise Nextcloud’s Web Upload Limit Past 2 GB

Allow larger Nextcloud browser uploads by aligning PHP, Nginx or Apache, temporary storage, and timeout settings—and verify which limit is blocking the file.

Clear Nextcloud’s PHP Memory Warning at the Web Server

Set the PHP memory limit Nextcloud actually uses, restart the right service, and confirm the 512 MB setting in Admin Overview.

Connect an S3-Compatible Bucket to Nextcloud External Storage

Mount a compatible object-storage bucket in Nextcloud using its S3 backend, with the right endpoint, credentials, access scope, and verification steps.