What is Kestrel?


It is a cross-platform web server that is included by default in ASP.NET Core project templates. It is a good practice to use Kestrel with a reverse proxy server like IIS.

Kestrel is implemented by ConfigureWebHostDefaults method in Program.cs file.

public class Program
{
    public static void Main(string[] args)
    {
        CreateHostBuilder(args).Build().Run();
    }

    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            // Use Kestrel as the web server
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseStartup<Startup>();
            });
}