ASP.NET Core Kestrel System.IO.IOException: Failed to bind to address (Address already in use)

Another process is already listening on port 5000/5001.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: ASP.NET Core Kestrel System.IO.IOException Platform: DotNet
Common Root Causes:
  • Another process is already listening on port 5000/5001.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Bind Kestrel to an unused loopback port via `ASPNETCORE_URLS=http://127.0.0.1:5050`.
Safe Diagnostic Command:
ss -tulpn | grep 5000
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

Another process is already listening on port 5000/5001. Recommended diagnostic: `ss -tulpn | grep 5000`. Remediation: Bind Kestrel to an unused loopback port via `ASPNETCORE_URLS=http://127.0.0.1:5050`.

Worked Examples

  • Run `ss -tulpn | grep 5000` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-dotnet-kestrel-address-in-use · Independently verified: 2026-11-25

Related Resources