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.

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:

Install-Package IronWord

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 why use it in a Docker container?

IronWord is a library for working with Word documents in .NET applications. Using it in a Docker container allows for consistent behavior across development, testing, and production environments on both Linux and Windows.

Which Linux distributions are recommended for running IronWord in Docker?

IronWord runs smoothly on 64-bit Linux distributions such as Ubuntu 24.04+ (Noble), Ubuntu 22.04 (Jammy), Debian 12+ (Bookworm), and RHEL/UBI 8 or 9.

How do I add IronWord to a .NET project using NuGet?

IronWord can be added to a .NET project by running the installation command in the NuGet Package Manager Console, which automatically includes the library in your project.

What is the benefit of using Microsoft's official Docker images for IronWord?

Using Microsoft's official Docker images with the .NET runtime and SDK simplifies setup and dependency management, ensuring a seamless integration with IronWord.

What are some example Dockerfiles for setting up IronWord on Ubuntu?

The page provides a Dockerfile example for Ubuntu 24.04 with .NET 8, detailing steps from setting up the base image to running the application.

How can I set up IronWord on Debian using Docker?

An example Dockerfile for Debian 12 with .NET 8 is provided, which includes steps to build and deploy the IronWord application within a Docker container.

Is it necessary to install additional fonts for IronWord on Linux containers?

Yes, installing fonts such as fonts-liberation or ttf-mscorefonts-installer may be needed on Linux containers for proper document rendering when using IronWord.

Does IronWord support all versions of .NET?

IronWord supports .NET 6, 7, 8, 9, and 10, .NET Standard 2.0+, and .NET Framework 4.6.2+, making it versatile for various .NET application versions.

What are the steps for deploying an IronWord application on RHEL/UBI?

The page outlines a Dockerfile for RHEL UBI 8, which uses Red Hat's own .NET 8 runtime and SDK container images, installs necessary fonts, and sets up the environment to run IronWord applications — no official CentOS runtime image is available post .NET Core 3.1.

Why choose Docker for deploying IronWord applications?

Docker ensures that IronWord applications have a lightweight and self-contained environment, providing consistent performance across different stages of application development and deployment.

Kye Stuart
Technical Writer

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.

Outside work, they enjoy PC gaming, streaming on Twitch, and ...

Read More
Ready to Get Started?
Nuget Downloads 47,795 | Version: 2026.7 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast? PM > Install-Package IronWord
run a sample watch your data become a Word doc.