How to Deploy a .NET Application on Windows VPS: Complete Tutorial for .NET 9 and 10

Deploying a .NET application to a Windows VPS remains one of the primary reasons organizations choose Windows over Linux hosting. Whether you are running a legacy .NET Framework 4.8 application or a modern .NET 9 or 10 web app, this guide covers the complete deployment workflow — from IIS configuration to application pool optimization and CI/CD integration.

What You Will Need

  • A Windows VPS with at least 4 GB RAM (Windows Server 2022 or 2025 recommended)
  • RDP access with Administrator privileges
  • Your .NET application compiled and ready for deployment
  • .NET Hosting Bundle or .NET Runtime installed on the server
  • Domain name (optional but recommended for production HTTPS)

If you do not have a Windows VPS yet, compare Windows VPS plans on our comparison table to find a provider that meets your deployment requirements.

Step 1: Install IIS with ASP.NET Support

Windows Server does not come with IIS enabled by default. Use Server Manager to add the Web Server (IIS) role with the following sub-components essential for .NET applications:

  • Common HTTP Features: Default Document, Directory Browsing, HTTP Errors, Static Content
  • Health and Diagnostics: HTTP Logging, Request Monitor, Tracing
  • Performance: Static Content Compression, Dynamic Content Compression
  • Security: Windows Authentication, URL Authorization, Request Filtering, IP and Domain Restrictions
  • Application Development: ASP.NET 4.8, .NET Extensibility, ISAPI Extensions, ISAPI Filters, WebSocket Protocol

Alternatively, install via PowerShell:

Install-WindowsFeature -Name Web-Server,Web-Asp-Net45,Web-WebSockets,Web-Mgmt-Console -IncludeManagementTools

Step 2: Install the .NET Runtime and Hosting Bundle

For .NET applications, you need the appropriate runtime and the ASP.NET Core Module (ANCM) for IIS. Microsoft distributes these together in a single installer.

For .NET 9 / 10 (Modern .NET)

Download and install the .NET Hosting Bundle from Microsoft’s official site. As of 2026, .NET 10 is the current LTS release with .NET 9 as the previous release. Both are fully supported. After installation, restart IIS:

net stop was /y
net start w3svc

For .NET Framework 4.8.1 (Legacy)

Windows Server 2022 and 2025 include .NET Framework 4.8.1 as an optional Windows Feature. Enable it via Server Manager or:

Install-WindowsFeature -Name NET-Framework-45-Features

Step 3: Prepare Your Application for Deployment

Publishing a .NET application for IIS deployment depends on the project type:

  • ASP.NET Core (Modern): Use dotnet publish -c Release -o ./publish to produce a self-contained or framework-dependent deployment. Self-contained deployments include the runtime, eliminating server-side runtime installation requirements.
  • ASP.NET Framework (Legacy): Use Visual Studio’s Publish wizard or MSBuild to produce a deployment package. Ensure System.Web references resolve against the server’s GAC.

For modern .NET applications, you can also publish directly to the server using Web Deploy (msdeploy) or via CI/CD pipelines — see Step 6.

Step 4: Create the IIS Website and Application Pool

In IIS Manager, configure the following:

  1. Create an Application Pool — For modern .NET apps, set .NET CLR version to “No Managed Code”. For .NET Framework apps, select “ASP.NET v4.0”. Set Identity to ApplicationPoolIdentity for least-privilege security.
  2. Configure the Application Pool — Set Idle Time-out to 0 (prevents recycling during inactivity). Enable 32-bit applications if your app targets x86. Set Queue Length to 1000 for high-traffic scenarios.
  3. Create a Website — Point the physical path to your published application folder. Assign the application pool you just created. Configure binding with hostname and port (80 for HTTP, 443 for HTTPS).
  4. Set folder permissions — Grant IIS AppPool\YourAppPoolName read/execute permissions on your application folder.

Step 5: Configure SSL/HTTPS (Production Requirement)

Every production .NET application should serve traffic over HTTPS. Windows Server makes this straightforward:

  1. Request a certificate — Use Let’s Encrypt (free) via the win-acme tool, or purchase a commercial certificate. Windows Server 2025 also supports the built-in ACME client for automated Let’s Encrypt renewals.
  2. Bind the certificate — In IIS Manager, add an HTTPS binding (port 443) and select your certificate.
  3. Force HTTPS redirect — Install the URL Rewrite module and add a rule that redirects HTTP to HTTPS. Or configure this in your application’s middleware.
  4. Enable HSTS — If using IIS URL Rewrite, add an outbound rule for the Strict-Transport-Security header.

Step 6: Automate Deployments with CI/CD (Optional but Recommended)

For teams deploying multiple times per week, manual RDP-based deployments become a bottleneck. Set up automated deployments:

  • Azure DevOps: Use the IIS Web App Deploy task with Web Deploy (msdeploy). Configure WinRM or an IIS deployment group for authentication.
  • GitHub Actions: Use the microsoft/iis-webapp-deploy action or run a PowerShell script over WinRM.
  • Web Deploy (msdeploy): Install Web Deploy 4.0 on the server, configure a deployment user, then publish from your CI pipeline using msdeploy commands.

Need a Windows VPS optimized for .NET hosting? Compare Windows VPS plans on our comparison table to find providers with pre-installed IIS and .NET runtimes.

Troubleshooting Common Deployment Issues

  • HTTP 500.19 error: The application pool identity lacks read permissions on the application folder. Grant IIS AppPool\YourPoolName read/execute access.
  • HTTP 502.5 or 500.30 error: The ASP.NET Core Module cannot start the process. Check the Windows Event Log under Applications > .NET Runtime for detailed error messages. Common causes: missing runtime, mismatched architecture, or port conflicts.
  • Static files return 404: The ASP.NET Core Module is not configured to serve static files. Ensure app.UseStaticFiles() is called in your startup pipeline.
  • Database connection failures: Verify SQL Server’s TCP/IP is enabled (SQL Server Configuration Manager) and firewall port 1433 is open if connecting remotely.

Conclusion

Deploying a .NET application on a Windows VPS involves configuring IIS with the correct modules, installing the appropriate .NET runtime, setting up application pools and permissions, and enabling HTTPS. Modern .NET 9 and 10 applications benefit from streamlined deployment via dotnet publish and CI/CD pipelines. By following these steps, you can have a production-ready .NET application running on a Windows VPS in under an hour.

Leave a Comment