Setting up IronWord in Docker Containers
IronWord is fully supported in Docker containers for both Linux and Windows environments, making it ideal for deployment on Azure, AWS, or any .NET-ready host.
Why Use Docker?
Docker lets you package and run IronWord as a lightweight, self-contained container. This ensures consistent behavior across development, testing, and production - especially valuable when generating or manipulating Word documents programmatically.
IronWord supports .NET Framework 4.6.2+, .NET Standard 2.0+, and .NET 6, 7, 8, 9, 10, all of which work seamlessly in Docker on Linux and Windows.
Recommended Linux Docker Distributions
We recommend the following 64-bit Linux distros for smooth IronWord operation, matching the distros Microsoft currently ships official .NET 8 container images for:
- Ubuntu 24.04+ (Noble)
- Ubuntu 22.04 (Jammy)
- Debian 12+ (Bookworm)
- RHEL / UBI 8 or 9 (for RHEL-family deployments - see below; Microsoft doesn't publish official CentOS runtime images post .NET Core 3.1)
Use Microsoft's official Docker images with the .NET runtime and SDK to simplify setup and dependency management.
IronWord NuGet Package
IronWord is easily added to any .NET project through its NuGet package. Simply run the following command in the NuGet Package Manager Console, and it will add the library automatically:
Ubuntu Dockerfile Examples
Ubuntu22 + .NET8
FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
WORKDIR /src
COPY ["Example/Example.csproj", "Example/"]
RUN dotnet restore "Example/Example.csproj"
COPY . .
WORKDIR "/src/Example"
RUN dotnet build "Example.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Example.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Example.dll"]
Ubuntu24.04 + .NET8 (LTS)
FROM mcr.microsoft.com/dotnet/runtime:8.0-noble AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:8.0-noble AS build
WORKDIR /src
COPY ["Example/Example.csproj", "Example/"]
RUN dotnet restore "Example/Example.csproj"
COPY . .
WORKDIR "/src/Example"
RUN dotnet build "Example.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Example.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Example.dll"]
Debian Dockerfile Example
Debian12 + .NET8 (LTS)
FROM mcr.microsoft.com/dotnet/runtime:8.0-bookworm-slim AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS build
WORKDIR /src
COPY ["Example/Example.csproj", "Example/"]
RUN dotnet restore "Example/Example.csproj"
COPY . .
WORKDIR "/src/Example"
RUN dotnet build "Example.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Example.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Example.dll"]
RHEL / UBI Dockerfile Example
Microsoft doesn't publish official CentOS runtime images beyond .NET Core 3.1. For RHEL-family deployments, use Red Hat's own Universal Base Image (UBI) .NET containers instead - freely usable without a Red Hat subscription and kept current with supported .NET releases.
RHEL UBI8 + .NET8 (LTS)
FROM registry.access.redhat.com/ubi8/dotnet-80-runtime:8.0 AS base
WORKDIR /app
FROM registry.access.redhat.com/ubi8/dotnet-80:8.0 AS build
WORKDIR /src
COPY ["Example/Example.csproj", "Example/"]
RUN dotnet restore "Example/Example.csproj"
COPY . .
WORKDIR "/src/Example"
RUN dotnet build "Example.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Example.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Example.dll"]
Notes & Troubleshooting
- IronWord fully supports .NET Framework 4.6.2+, .NET Standard 2.0+, and .NET 6, 7, 8, 9, 10.
- Install fonts if needed (e.g., fonts-liberation, ttf-mscorefonts-installer) on Linux containers for proper rendering.
Frequently Asked Questions
What is IronWord and how does it work with Docker?
IronWord is a library that allows you to create and manipulate Word documents programmatically. It can be run inside a Docker container, providing consistent functionality across development, testing, and production environments.
Which .NET versions are supported by IronWord in Docker containers?
IronWord supports .NET Framework 4.6.2+, .NET Standard 2.0+, and .NET 6, 7, 8, 9, 10, all of which can be used in Docker on both Linux and Windows.
What Linux distributions are recommended for running IronWord in Docker?
For running IronWord smoothly in Docker, we recommend using Ubuntu 24.04+ (Noble), Ubuntu 22.04 (Jammy), Debian 12+ (Bookworm), or RHEL/UBI 8 or 9.
How can I add IronWord to my .NET project?
You can add IronWord to your .NET project easily through its NuGet package by running the appropriate command in the NuGet Package Manager Console.
Why should I consider using Docker for deploying IronWord?
Using Docker allows you to package IronWord as a lightweight, self-contained container, ensuring consistent behavior and simplifying deployment across various environments.
Can IronWord be deployed on cloud platforms using Docker?
Yes, IronWord can be deployed using Docker on cloud platforms such as Azure and AWS, as well as any .NET-ready host.
What is the Dockerfile example for setting up IronWord on Ubuntu 22.04 with .NET 8?
The Dockerfile involves using mcr.microsoft.com/dotnet/runtime:8.0-jammy and mcr.microsoft.com/dotnet/sdk:8.0-jammy images for setting up IronWord on Ubuntu 22.04 with .NET 8.
How can I handle fonts in IronWord Docker containers?
For proper Word document rendering, you can install fonts like fonts-liberation and ttf-mscorefonts-installer in your Linux Docker containers.
Is there official support for CentOS in Docker with IronWord?
Microsoft does not publish official CentOS runtime images beyond .NET Core 3.1. For RHEL-family deployments, use Red Hat's Universal Base Image (UBI) .NET containers.
What is the benefit of using Microsoft's official Docker images with IronWord?
Using Microsoft's official Docker images simplifies setup and dependency management by providing a reliable .NET runtime and SDK base for your applications.

Kye Stuart merges coding passion and writing skill at Iron Software. Educated at Yoobee College in software deployment, they now transform complex tech concepts into clear educational content. Kye values lifelong learning and embraces new tech challenges.