TL;DR: How to find which program is using a port, and stop it
The fix only. No explanation, no diagnosis. Read the full article if any of this does not match what you are seeing.
- Windows, elevated PowerShell, find the PID that owns the port:
Get-NetTCPConnection -LocalPort 80 -State Listen | Select-Object OwningProcess
Get-Process -Id <PID>- Is it a service?
Get-CimInstance Win32_Service -Filter "ProcessId=<PID>" - Stop it:
Stop-Service -Name <name>, or for a plain programStop-Process -Id <PID> -Confirm. - Linux:
sudo ss -ltnp 'sport = :80', thensystemctl status <PID>, thensudo systemctl stop <unit>orkill <PID>. - Run the check again to confirm the port is free.
Do not kill PID 4, svchost.exe, lsass.exe or anything you cannot name. A shared svchost.exe hosts several services.
No process listed? Check netsh interface ipv4 show excludedportrange protocol=tcp and netsh http show servicestate.