State of knowledge

May 2022

This article explains how you can find out which program or service occupies which port. This is often necessary, for example, to set up the web service or in the case of error messages regarding doubly assigned ports.

Procedure

  1. Run the "cmd" command.
  2. Type "netstat -ano" followed by ENTER.
    1. optionally, you can also use "|" (pipe) followed by the "find" command to define the result more precisely, e.g. to search for port "8080": netstat -ano | find "8080".
  3. Search for the port in the "Local Address" column and note down the corresponding "PID".
  4. Go to Processes/Services in the Task Manager (for processes, select "Show processes of all users").
  5. "Select View\Columns -> Enable PID (Process ID)".
  6. Now you can see which program or service uses which PID and you know what occupies the corresponding port.

Example

In the example you can see that the program "MetaServer.exe" listens to port 8080 for IPv4 and IPv6.

Example screenshots: Determine port assignment via cmd.exe "netstat -ano" and Windows Task Manager display details with PID

Further information

Release ports for estos products – which network interfaces are used? Skip to end of metadata