IRONSOFTWAREHOME

AWS Lambda IronPDF on Amazon Linux 2

Curtis Chau
Curtis Chau
Updated: August 2, 2026

AWS Lambda / Amazon Linux 2 (Install as admin/root using IronPdf.Linux)

This information is also shown on our website - AWS Lambda IronPDF Guide

AWS Instructions

  1. See AWS .NET 5 Lambda Support with Container Images

  2. Create and use the following Dockerfile:

    # Use the .NET 8 AWS Lambda runtime as the base image
    FROM public.ecr.aws/lambda/dotnet:8
    WORKDIR /var/task
    
    # Install the necessary dependencies for IronPDF
    RUN yum install -y pango.x86_64 \
                       libXcomposite.x86_64 \
                       libXcursor.x86_64 \
                       libXdamage.x86_64 \
                       libXext.x86_64 \
                       libXi.x86_64 \
                       libXtst.x86_64 \
                       cups-libs.x86_64 \
                       libXScrnSaver.x86_64 \
                       libXrandr.x86_64 \
                       GConf2.x86_64 \
                       alsa-lib.x86_64 \
                       atk.x86_64 \
                       gtk3.x86_64 \
                       ipa-gothic-fonts \
                       xorg-x11-fonts-100dpi \
                       xorg-x11-fonts-75dpi \
                       xorg-x11-utils \
                       xorg-x11-fonts-cyrillic \
                       xorg-x11-fonts-Type1 \
                       xorg-x11-fonts-misc \
                       glibc-devel.x86_64 \
                       at-spi2-atk.x86_64 \
                       mesa-libgbm.x86_64
    
    # This COPY command copies the .NET Lambda project's build artifacts from the host machine into the image.
    COPY "bin/Release/lambda-publish" .
    Text
  3. Add IronPdf.Linux package to your solution.

  4. Modify _FunctionHandler code - this example will create a PDF from a webpage (IronPDF) and save it to /tmp. In order to view this PDF, it must be uploaded to another service, such as S3. (Official AWS example available here - AWS S3 Basics)

    // Define the function handler for AWS Lambda
    public Casing FunctionHandler(string input, ILambdaContext context)
    {
        try
        {
            // Start logging the function process with input details
            context.Logger.LogLine($"START FunctionHandler RequestId: {context.AwsRequestId} Input: {input}");
    
            var awsTmpPath = @"/tmp/"; // AWS temporary storage path
    
            // Optional: Enable debugging for IronPdf
            // IronPdf.Logging.Logger.EnableDebugging = true;
            // IronPdf.Logging.Logger.LogFilePath = awsTmpPath;
            // IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.All;
    
            // Set your license key for IronPDF
            IronPdf.License.LicenseKey = "YOUR_LICENSE_KEY";
    
            // Configuration for IronPDF rendering
            IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled;
            IronPdf.Installation.DefaultRenderingEngine = IronPdf.Rendering.PdfRenderingEngine.Chrome;
            Environment.SetEnvironmentVariable("TEMP", awsTmpPath, EnvironmentVariableTarget.Process);
            Environment.SetEnvironmentVariable("TMP", awsTmpPath, EnvironmentVariableTarget.Process);
            IronPdf.Installation.TempFolderPath = awsTmpPath;
            IronPdf.Installation.CustomDeploymentDirectory = awsTmpPath;
            IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = true;
    
            context.Logger.LogLine($"Creating IronPdf.ChromePdfRenderer");
    
            // Create instance of ChromePdfRenderer and render PDF from URL
            var renderer = new IronPdf.ChromePdfRenderer();
            context.Logger.LogLine($"Rendering PDF");
            using var pdfDoc = renderer.RenderUrlAsPdf("https://ironpdf.com/");
            var guid = Guid.NewGuid();
            var fileName = $"/tmp/{input}_{guid}.pdf"; // Name for the PDF file
    
            // Save the rendered PDF document
            context.Logger.LogLine($"Saving PDF name : {fileName}");
            pdfDoc.SaveAs(fileName);
    
            // Here you can upload the saved PDF file to anywhere such as AWS S3.
            context.Logger.LogLine($"COMPLETE!");
        }
        catch (Exception e)
        {
            // Log errors if any occur
            context.Logger.LogLine($"[ERROR] FunctionHandler : {e.Message}");
        }
    
        // Return a new instance of Casing with lower and upper case input strings
        return new Casing(input?.ToLower(), input?.ToUpper());
    }
    
    // Casing record to hold lower and upper case strings
    public record Casing(string Lower, string Upper);
  5. Increase memory and timeout - IronPDF requires more time and memory than the default value of Lambda. This can be configured in aws-lambda-tools-defaults.json. Adjust these values to match your function's needs.

In this example, we set to 512 (MB) and 330 (seconds):

"function-memory-size": 512,
"function-timeout": 330,
JSON

The configuration can also be updated using the Lambda console - AWS Lambda Memory Configuration.

  1. Please follow the final part of the documentation to publish and try a Lambda function AWS .NET 5 Lambda Support with Container Images
  2. Lambda function can also be invoked using the Lambda console, AWS Lambda Console or invoked via Visual Studio by using the AWS Toolkit for Visual Studio.

If you receive a "GPU process isn't usable" message, installation may not have been run with admin privileges. Please try running the software again with admin/root privileges. Alternatively, add the following to your Dockerfile:

RUN chmod 755 "runtimes/linux-x64/native/IronCefSubprocess"
Text
Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 20,990,528Version:2026.9just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPdf"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

or download Windows Installer here.

  1. Download and unzip IronPDF to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPdf.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

OR
bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.9

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPdf"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.9

or download Windows Installer here.

  1. Download and unzip IronPDF to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPdf.dll"

Licenses from $999