Click or drag to resize
Pdf Library for .NET

Deployment to AWS Elastic Beanstalk

AWS Elastic Beanstalk runs a web application on EC2 instances it manages. SelectPdf runs on both of its .NET platforms: Windows Server running IIS and Amazon Linux 2023 running .NET.

The source bundle

Elastic Beanstalk deploys a zip file, the source bundle, whose shape depends on the platform.

Windows Server / IIS. Publish the application for win-x64 - self-contained, so it does not depend on the .NET versions the platform installs - zip the publish folder as site.zip, and put it in the bundle next to an aws-windows-deployment-manifest.json that installs it as the root site:

{
  "manifestVersion": 1,
  "deployments": {
    "aspNetCoreWeb": [ {
      "name": "myapp",
      "parameters": {
        "appBundle": "site.zip",
        "iisPath": "/",
        "iisWebSite": "Default Web Site"
      }
    } ]
  }
}

Amazon Linux 2023. Publish the application (framework-dependent, for the ".NET 10" platform) with the fonts package, add a Procfile with the command that starts it - the platform's nginx forwards to port 5000 - and zip the folder:

web: dotnet MyApp.dll --urls http://0.0.0.0:5000

Create the zip with forward slashes in the paths (Linux reads a backslash as part of a file name): zip -r, or the sample's build-bundles.ps1 on Windows.

Step by step
  1. In the AWS console, open Elastic Beanstalk > Create application.

  2. Platform: .NET on Windows Server (Windows Server 2022, IIS 10.0) or .NET 10 running on 64bit Amazon Linux 2023.

  3. Application code: Upload your code, and choose the bundle.

  4. Presets: Single instance for a test, High availability for production.

  5. Service access: let the console create the service role and the EC2 instance profile if you have none.

  6. Instance type: at least 2 vCPU and 8 GB - for example m7i-flex.large, m7i.large or t3.large (on a free plan account, see Amazon Web Services).

  7. Create the environment, wait until its health is Ok, and open its domain.

With the CLI, upload the bundle to S3 and use aws elasticbeanstalk create-application-version and create-environment; the sample's README has the commands.

What to expect

Measured in October 2026 (eu-north-1, single m7i-flex.large instance): every conversion succeeded on both platforms, and the Windows output is identical to a conversion on a local Windows computer. The instance keeps the engine loaded, so selectpdf.com converts in about 1.1 seconds on Linux and 1.5 seconds on Windows; the first conversion after a deployment takes longer (about 8 seconds on Windows, 3 on Linux).

Sample

The official samples include this deployment, with a step-by-step README, in the cloud/aws-elastic-beanstalk folder of the edition's samples. Its build-bundles.ps1 and build-bundles.sh publish the web sample into both bundles.

See Also