Kestrel is the lightweight, cross platform web server that is built into every dot NET Core application and can run standalone on Windows, Linux, or macOS, while IIS, or Internet Information Services, is a full featured Windows only web server commonly used as a reverse proxy in front of Kestrel in production to provide additional features like process management, advanced logging, and Windows integration. In most modern production deployments, Kestrel handles the actual application requests while IIS or another reverse proxy such as Nginx forwards traffic to it.
// Program.cs uses Kestrel by default
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.Run();
Real-world example
A company hosts its dot NET Core application on a Windows server using IIS as a reverse proxy in front of Kestrel, gaining IIS features like automatic process recycling while still benefiting from Kestrel's fast request handling.
Middleware & Request Pipeline;What are .NET Core Hosting Models?