Adding IronPDF to an Existing Docker Container
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? Learn more about IronPdfEngine.





Why use Docker on Azure?
Alongside excellent enterprise scalability, Docker Containers on Azure enjoy more permissions than regular WebApps. This allows rendering of SVG fonts because system access to GDI+ graphics is 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.
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 11
- 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.
Install-Package IronPdf.Linux
Another solution is to simply add IronPdf.Native.Chrome.Linux on top of the regular IronPdf NuGet package.
Install-Package IronPdf.Native.Chrome.Linux
Avoid Automatic Dependency Installation
Many users report better results with Linux & Docker when LinuxAndDockerDependenciesAutoConfig
is set to false. This is because the prerequisites are already installed by apt-get
style package managers in your Docker files.
// Disable automatic configuration of Linux and Docker dependencies
IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = false;
// Disable automatic configuration of Linux and Docker dependencies
IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = false;
' Disable automatic configuration of Linux and Docker dependencies
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:
// Disable GPU acceleration for Docker environments
IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled;
// Disable GPU acceleration for Docker environments
IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled;
' Disable GPU acceleration for Docker environments
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:
// Initializing IronPDF to avoid delay due to downloading prerequisites.
IronPdf.Installation.Initialize();
// Initializing IronPDF to avoid delay due to downloading prerequisites.
IronPdf.Installation.Initialize();
' Initializing IronPDF to avoid delay due to downloading prerequisites.
IronPdf.Installation.Initialize()
Ubuntu Linux DockerFiles


Ubuntu 22 with .NET 8
Please change the user from 'app' to 'root'. This will ensure that sufficient permissions are granted to the library. With this change, it will not be necessary to set 'rwx' for the IronCefSubprocess.
Ubuntu 22 with .NET 7
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 12 with .NET 8
Debian 11 with .NET 7
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
Running IronPDF on Alpine Linux is not supported. We wish we could but we can't. Frankly, we like Alpine and hope this project continues and grows. As of 2023, Alpine still uses outdated "musl" C language libraries that do not allow chromium developers to fully support this OS yet.
Using Alpine Docker with IronPdfEngine in .NET 6
IronPdf provides a container image containing all IronPdf functionalities. This enables projects running on Alpine to access IronPdf functionalities by connecting to the IronPdfEngine container.
Step 1: Pull and Run IronPdf Engine Docker Image
Execute the following commands in your terminal to pull and run the IronPdf Engine Docker image:
# Pull the IronPDF Engine Docker Image
docker pull ironsoftwareofficial/ironpdfengine
# Pull the IronPDF Engine Docker Image
docker pull ironsoftwareofficial/ironpdfengine
# Run the IronPDF Engine Docker container
docker run -d -p 33350:33350 ironsoftwareofficial/ironpdfengine
# Run the IronPDF Engine Docker container
docker run -d -p 33350:33350 ironsoftwareofficial/ironpdfengine
Step 2: Set Up Console App
Create a new console application targeting .NET 6. Install the IronPdf.Slim NuGet package using the NuGet Package Manager.
IronPDF Windows Docker Containers


Windows Docker Containers are becoming increasingly popular on Azure, as they offer 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 due to higher levels of access to graphics library and the virtual graphics card.
The article 'Visual Studio Container Tools for Docker' is a really great get-started guide.
This is an example Windows container Dockerfile for .NET Core 3.1
Windows Server 2019 .NET 6.0
Pre-configured Windows containers include all the necessary dependencies for running IronPdf.
Please note
# Base image for building .NET applications
FROM mcr.microsoft.com/dotnet/sdk:6.0-windowsservercore-ltsc2019 AS build
WORKDIR /src
# Copy and restore the nuget config and project files
COPY ["nuget.config", "."]
COPY ["ConsoleApp/ConsoleApp.csproj", "ConsoleApp/"]
RUN dotnet restore "ConsoleApp/ConsoleApp.csproj"
# Copy the source code and build the application
COPY . .
WORKDIR "/src/ConsoleApp"
RUN dotnet build "ConsoleApp.csproj" -c Release -o /app/build
# Publish the built application
FROM build AS publish
RUN dotnet publish "ConsoleApp.csproj" -c Release -o /app/publish /p:UseAppHost=false
# Runtime image for running built .NET applications
FROM ironsoftwareofficial/windows:2019-net60
WORKDIR /app
COPY --from=publish /app/publish .
# EntryPoint for the application
ENTRYPOINT ["dotnet", "ConsoleApp.dll"]
Visit the Docker repository to explore additional pre-configured images for running IronPdf.
Frequently Asked Questions
How is a .NET library used with Docker?
IronPDF is a .NET library for PDF generation and manipulation. It can be used with Docker to run in containers on various platforms, including Azure, Linux, and Windows, offering scalability and enhanced permissions.
Why use Docker containers on Azure?
Docker containers on Azure provide excellent enterprise scalability and more permissions than regular WebApps, allowing for advanced features like SVG font rendering through enabled GDI+ graphics access.
Which Linux distributions are recommended for use in Docker?
Recommended distributions include Ubuntu 18/20/22, Debian 10/11, CentOS 8, and Amazon AWS Linux 2. These are suggested for easy configuration with IronPDF.
How can I optimize installation for Linux Docker containers?
Use the IronPdf.Linux NuGet package, disable automatic dependency installation, and disable GPU acceleration to optimize IronPDF for Linux Docker containers.
Is compatibility with Alpine Linux possible?
IronPDF does not support Alpine Linux natively due to outdated 'musl' libraries. However, you can use an IronPdfEngine Docker container to access IronPDF functionalities on Alpine.
How do I disable GPU acceleration in a .NET library for Docker?
GPU acceleration can be disabled by setting IronPdf.Installation.ChromeGpuMode to IronPdf.Engines.Chrome.ChromeGpuModes.Disabled in your setup.
What is the advantage of pre-configured Windows Docker containers?
Pre-configured Windows Docker containers come with all necessary dependencies for running IronPDF and provide high performance and scalability on Azure.
Can a .NET library be used with .NET applications in Docker?
Yes, IronPDF can be integrated with .NET applications in Docker containers for both Linux and Windows environments, enabling PDF functionalities within microservices.
What setup is recommended in a Docker environment?
It's recommended to use the Linux-optimized IronPdf.Linux package, disable automatic dependency configurations, and optionally initialize IronPDF ahead of time to avoid delays in Docker.
How can I run a .NET library in a Windows Server 2019 .NET 6.0 Docker container?
Use a pre-configured Dockerfile that includes all necessary dependencies and setups for running IronPDF on Windows Server 2019 with .NET 6.0.