Adding IronPdf to an Existing Docker Container
Want to create PDF files in C# ?
IronPDF for .NET Standard now fully supports Docker, including Azure Docker Containers for Linux and Windows.
Do you want to deploy IronPDF as a separate Docker container instead? https://ironpdf.com/how-to/ironpdfengine-docker/





Why use Docker on Azure?
Alongside excellent enterprise scalability, Docker Containers on Azure enjoyed more permissions than regular WebApps.
This allows rendering of SVG fonts, because system access to GDI+ graphics are enabled.
IronPDF and Linux Primer
If Docker with .NET is new to you, we recommend this excellent article on setting up Docker debugging and integration with Visual Studio projects. https://docs.microsoft.com/en-us/visualstudio/containers/edit-and-refresh?view=vs-2019
We also highly recommend you read our IronPdf Linux Setup and Compatibility Guide
Recommended Linux Docker Distributions
We recommend the latest 64 bit Linux OS's below for "easy configuration" of IronPDF.
- Ubuntu 22
- Ubuntu 20
- Ubuntu 18
- Debian 10 [Currently the Microsoft Azure Default Linux Distro]
- CentOS 8
- Amazon AWS Linux 2 Read the IronPdf AWS Lambda Setup Guide
We recommend using Microsoft's Official Docker Images . Other Linux distros are supported in part, but may require manual configuration using apt-get. See our "Linux Manual Setup" guide
Working Docker files for Ubuntu and Debian are included In this document:
IronPDF Linux Docker Installation Essentials
Use Linux Optimised NuGet Packages
We recommend using the IronPdf.Linux NuGet Package instead of the regular IronPdf Package to save disk space and avoid assets being downloaded when you start your Docker instance. Don't worry, it still works when developing on Windows or macOS - it is just Linux optimized.
PM> Install-Package IronPdf.Linux
Another solution is to simply add IronPdf.Native.Chrome.Linux on-top of the regular IronPdf NuGet package.
PM> Install-Package IronPdf.Native.Chrome.Linux
Avoid Automatic Dependency Installation
Many users report better results with Linux & Docker when LinuxAndDockerDependenciesAutoConfig
is set false. That is because the prerequisites are already installed by apt-get style package managers already in your Docker files.
IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = false;
Disable GPU Acceleration
Linux Docker containers often do not have access to a GPU. GPU acceleration is disabled by default. If you have enabled ChromeGpuModes.Enabled, we highly recommend you disable it for Docker deployments:
IronPdf.Installation.ChromeGpuMode=IronPdf.Engines.Chrome.ChromeGpuModes.Disabled;
"Ahead of Time" Initialization
Optionally, you may also wish to call the IronPdf.Installation.Initialize()
method to manually start IronPDF. The very first time a Docker instance uses IronPDF, it may take some time to download prerequisites. We can avoid that scenario, by calling this code when the instance is created:
IronPdf.Installation.Initialize();
Ubuntu Linux DockerFiles


Ubuntu 20 with .NET 6
Ubuntu 20 with .NET 5
Ubuntu 20 with .NET 3.1 LTS
Ubuntu 18 with .NET 3.1 LTS
Debian Linux DockerFiles


Debian 11 with .NET 6
Debian 11 with .NET 5
Debian 11 with .NET 3.1 LTS
Debian 10 with .NET 5
Debian 10 with .NET 3.1 LTS
Alpine Linux DockerFiles

You can use the IronSoftware Apline image from Docker Hub.
To add IronPdf support to your existing Docker containers, include these lines in your Dockerfile:
RUN apk update \
&& apk add gcompat chromium dotnet6-sdk
IronPDF Windows Docker Containers


Windows Docker Containers are becoming increasingly popular on Azure, as they give higher levels of performance and scalability, and give developers more permissions to configure instances.
IronPDF will actually perform more attractive text rendering within a Docker container (Windows or Linux) on Azure because of higher levels of access to graphics library and the virtual graphics card.
This article is a really great get-started guide. https://docs.microsoft.com/en-us/visualstudio/containers/overview?view=vs-2019
This is an example Windows container Dockerfile for .NET Core 3.1
Windows Server 2019 .NET 6.0
Pre-configured Windows containers that include all the necessary dependencies for running IronPdf.
Please note
FROM mcr.microsoft.com/dotnet/sdk:6.0-windowsservercore-ltsc2019 AS build
WORKDIR /src
COPY ["nuget.config", "."]
COPY ["ConsoleApp/ConsoleApp.csproj", "ConsoleApp/"]
RUN dotnet restore "ConsoleApp/ConsoleApp.csproj"
COPY . .
WORKDIR "/src/ConsoleApp"
RUN dotnet build "ConsoleApp.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "ConsoleApp.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM ironsoftwareofficial/windows:2019-net60
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ConsoleApp.dll"]
Visit the Docker repository to explore additional pre-configured images for running IronPdf.