Skip to content
English
  • There are no suggestions because the search field is empty.

[Public] How can I get IronPDF working in a .NET 9 Docker container on Linux?

To run IronPDF in a .NET 9 Docker container on Linux, make sure the required native dependencies are installed.

IronPDF can run smoothly in a .NET 9 runtime image on Linux, but it requires specific native Linux packages that support Chrome-based rendering. Depending on your base image, the package names may vary slightly.

Recommended Base Images for .Net 9

IronPDF with .Net9 is confirmed to work with:

  • Debian 12 (bookworm)

  • Ubuntu 24.04 (noble)

Each requires installing the necessary dependencies with apt.

Debian Linux DockerFile

Docker V1 related to Debian Linux DockerFiles
Debian V1 related to Debian Linux DockerFiles

Debian 12 with .NET 9

# base image (Debian 12)
FROM mcr.microsoft.com/dotnet/sdk:9.0
USER root
WORKDIR /app
# install necessary packages
RUN apt update \
    && apt install -y sudo libc6 libc6-dev libgtk2.0-0 libnss3 \
    libatk-bridge2.0-0 libx11-xcb1 libxcb-dri3-0 libdrm-common \
    libgbm1 libasound2 libappindicator3-1 libxrender1 \
    libfontconfig1 libxshmfence1 libgdiplus libva-dev
# restore NuGet packages
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Example/Example.csproj", "Example/"]
RUN dotnet restore "./Example/./Example.csproj"
# build project
COPY . .
WORKDIR "/src/Example"
RUN dotnet build "./Example.csproj" -c $BUILD_CONFIGURATION -o /app/build
# publish project
RUN dotnet publish "./Example.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
WORKDIR /app/publish
# run app
ENTRYPOINT ["dotnet", "Example.dll"]

Ubuntu Linux DockerFile

Docker V1 related to Ubuntu Linux DockerFiles
Ubuntu V1 related to Ubuntu Linux DockerFiles

Ubuntu 24 with .NET 9

In Ubuntu 24.04, libasound2 has been replaced by libasound2t64. Use this adjusted Dockerfile:

# base image (Ubuntu 24)
FROM mcr.microsoft.com/dotnet/runtime:9.0-noble
USER root
WORKDIR /app
# install necessary packages
RUN apt update \
    && apt install -y sudo libc6 libc6-dev libgtk2.0-0 libnss3 \
    libatk-bridge2.0-0 libx11-xcb1 libxcb-dri3-0 libdrm-common \
    libgbm1 libasound2t64 libappindicator3-1 libxrender1 \
    libfontconfig1 libxshmfence1 libgdiplus libva-dev
# restore NuGet packages
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Example/Example.csproj", "Example/"]
RUN dotnet restore "./Example/./Example.csproj"
# build project
COPY . .
WORKDIR "/src/Example"
RUN dotnet build "./Example.csproj" -c $BUILD_CONFIGURATION -o /app/build
# publish project
RUN dotnet publish "./Example.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
WORKDIR /app/publish
# run app
ENTRYPOINT ["dotnet", "Example.dll"]

Notes

  • These packages provide the minimum system-level dependencies required by IronPDF’s Chrome rendering engine.

  • If you're seeing native errors or crashes, check the output of:

ldd -v libcef.so to verify that all dependencies are resolved.