Run GroupDocs .NET Plugins in Docker on Linux
October 24, 2026 · 5 min read · GroupDocs Team
The GroupDocs .NET plugins run on Linux, so you can ship document conversion in a container next to the rest of your services. One thing needs care: fonts. A Word document or a presentation names its fonts but doesn’t contain them, and the official .NET images contain none at all. This how-to builds a container that converts DOCX to PDF and shows what each font setup does to the output.
We tested with GroupDocs.Conversion.LowCode 26.9.0 on the official mcr.microsoft.com/dotnet/runtime:8.0 image, which is based on Debian 12.
The App
Create a console app and add the package:
dotnet new console -n DocConvertercd DocConverterdotnet add package GroupDocs.Conversion.LowCodeThe app converts every Word document in its input folder to PDF in its output folder:
using System.IO;using GroupDocs.Conversion.LowCode;// Set your licenseLicense.Set("GroupDocs.Conversion.LowCode.lic");Directory.CreateDirectory("output");// Convert every Word document in the input folder to PDFforeach (var docx in Directory.GetFiles("input", "*.docx")){ var pdf = Path.Combine("output", Path.GetFileNameWithoutExtension(docx) + ".pdf"); new DocxToPdfConverter(docx).Convert(pdf);}open System.IOopen GroupDocs.Conversion.LowCode// Set your licenseLicense.Set("GroupDocs.Conversion.LowCode.lic")Directory.CreateDirectory("output") |> ignore// Convert every Word document in the input folder to PDFfor docx in Directory.GetFiles("input", "*.docx") do let pdf = Path.Combine("output", Path.GetFileNameWithoutExtension(docx) + ".pdf") (new DocxToPdfConverter(docx)).Convert(pdf)Imports System.IOImports GroupDocs.Conversion.LowCode' Set your licenseLicense.Set("GroupDocs.Conversion.LowCode.lic")Directory.CreateDirectory("output")' Convert every Word document in the input folder to PDFFor Each docx In Directory.GetFiles("input", "*.docx") Dim pdf = Path.Combine("output", Path.GetFileNameWithoutExtension(docx) & ".pdf") Dim converter As New DocxToPdfConverter(docx) converter.Convert(pdf)NextThe Dockerfile
Add a .dockerignore, so local build output doesn’t end up in the image:
bin/obj/input/output/Then the Dockerfile:
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS buildWORKDIR /srcCOPY DocConverter.csproj .RUN dotnet restore -r linux-x64COPY . .RUN dotnet publish -c Release -r linux-x64 --self-contained false --no-restore -o /appFROM mcr.microsoft.com/dotnet/runtime:8.0# fontconfig, Microsoft's core fonts (downloaded during installation, EULA accepted here),# and fonts that are metric-compatible with Calibri (Carlito) and Cambria (Caladea)RUN sed -i 's/^Components: main$/Components: main contrib/' /etc/apt/sources.list.d/debian.sources \ && echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections \ && apt-get update \ && apt-get install -y --no-install-recommends fontconfig ttf-mscorefonts-installer \ fonts-liberation fonts-crosextra-carlito fonts-crosextra-caladea fonts-dejavu-core \ && rm -rf /var/lib/apt/lists/*WORKDIR /workCOPY --from=build /app /appENTRYPOINT ["dotnet", "/app/DocConverter.dll"]The first stage publishes the app; the second runs it on the smaller runtime image. The RUN line in the middle is what makes the output look right:
- fontconfig is how the converter finds fonts on Linux. Without it, some conversions fail outright.
ttf-mscorefonts-installerinstalls Arial, Times New Roman, Courier New, Georgia, Verdana, and other fonts that Office documents use most. It lives in Debian’scontribcomponent, which thesedcommand enables, downloads the fonts while the image builds, and asks you to accept Microsoft’s license, which thedebconf-set-selectionsline does.- Liberation, Carlito, Caladea, and DejaVu stand in for fonts that are still missing, such as Calibri and Cambria, which Microsoft doesn’t distribute for Linux.
Build and Run
docker build -t doc-converter .docker run --rm \ -v "$PWD/input:/work/input" \ -v "$PWD/output:/work/output" \ -v "$PWD/GroupDocs.Conversion.LowCode.lic:/work/GroupDocs.Conversion.LowCode.lic:ro" \ doc-converterThe container reads the documents from your input folder and writes the PDFs to your output folder. The license is mounted at run time rather than copied into the image, so the image can live in a shared registry.
What Goes Wrong Without Fonts
We converted the same documents, a DOCX set in Arial and Times New Roman and a PPTX presentation, with four font setups:
| Packages in the runtime image | PPTX to PDF | DOCX to PDF |
|---|---|---|
| None | Fails with MissingDependencyException | Converts, in a substitute serif font; pages break differently |
fontconfig (which pulls in DejaVu) | Works | Every line in DejaVu Sans |
fontconfig fonts-liberation | Works | Every line in Liberation Mono, a monospace font |
| The Dockerfile above | Works | Arial and Times New Roman, as on Windows |
The third row is the surprise. Liberation Sans and Liberation Serif are metric-compatible with Arial and Times New Roman, and fontconfig maps them correctly, yet the Word converter doesn’t use them as substitutes. In our tests, whenever Times New Roman wasn’t installed, it replaced every missing font with the first installed font family in alphabetical order: Liberation Mono with the Liberation fonts, DejaVu Sans with DejaVu alone. With Times New Roman installed, missing fonts got sensible substitutes: a paragraph set in Calibri rendered in Liberation Sans. So install the real fonts your documents use, and Times New Roman above all.
The spreadsheet converter substitutes more gracefully: with Carlito installed, a workbook set in Calibri renders in Carlito.
Choose the Fallback Font
If you can’t install a document’s fonts, choose the font that replaces them with the DefaultFont load option. It affects only fonts that are missing; installed fonts are used as before:
using GroupDocs.Conversion.LowCode;var converter = new DocxToPdfConverter("input/report.docx", options => options.DefaultFont = "Liberation Sans");converter.Convert("output/report.pdf");For the most faithful output, copy the fonts your documents use from a licensed Windows machine into the image, for example to /usr/share/fonts/truetype/custom/, and run fc-cache -f after copying.
Make the Image Smaller
The packages contain native libraries for Windows, macOS, and Linux on several processor architectures. A plain dotnet publish copies all of them. Publishing for one runtime with -r linux-x64, as the Dockerfile above does, keeps only the libraries for that platform. In our test with both GroupDocs.Conversion.LowCode and GroupDocs.Merger.LowCode, this cut the application folder from 975 MB to 317 MB and the image from 1.8 GB to under 900 MB. With the conversion package alone, the image above is 668 MB. On ARM64 hosts, publish with -r linux-arm64 instead.
Merging in a Container
The same Dockerfile works for GroupDocs.Merger.LowCode. Merging doesn’t render text, so only its PPTX plugins (JoinPptx and SplitPptx) need fontconfig; in our test, JoinPdf merged PDF documents in an image without any fonts.
Checklist
- Install
fontconfig. - Install the fonts your documents use: Microsoft’s core fonts cover most Office documents, and Times New Roman matters most for Word documents.
- Add metric-compatible fonts, such as Carlito and Caladea, for the fonts you can’t install, or set
DefaultFont. - Publish for one runtime, such as
linux-x64. - Mount the license file at run time instead of copying it into the image.
Learn More
- System Requirements in the documentation
- Introducing GroupDocs.Conversion.LowCode: all ten converters
- Combine Word, Excel, and PowerPoint Files into One Archived PDF
Without a license, the converters process only the first three pages of each document, add an evaluation message, and convert up to 10 documents per process. To test your container without these limits, request a free temporary license. Questions? Ask on the Community Forum.