How to Check Process Using Port on Windows and Linux

When an application will not start, a web service seems unavailable, or two programs conflict, you may need to check process using port. A network port is a numbered endpoint that helps software receive traffic. Finding the process behind it can explain what is happening, but the result is only the beginning of a safe diagnosis.

Administrator reviewing commands to check process using port on Windows and Linux

This guide covers practical commands for Windows and Linux. It also explains how to read their output, distinguish a listening service from an active connection, and avoid stopping an important business system by mistake.

What a port check can tell you

A port check connects three useful facts: an address, a port number, and a process identifier. The process identifier, or PID, is the operating system’s number for a running program. You can use that number to identify the application and, sometimes, the service that launched it.

For example, a service may listen on 0.0.0.0:443. This usually means it accepts IPv4 connections on port 443 through the computer’s network interfaces. A service listening on 127.0.0.1:443 accepts local connections only. The difference matters when a website, reverse proxy, or monitoring system cannot connect from another machine.

Ports do not identify applications by themselves. Port 443 often carries HTTPS, but any suitable program can use it. Likewise, an unfamiliar port is not automatically malicious. Confirm the process, its executable path, its owner, and whether the service belongs on that system.

Before you check process using port

Start with the symptom and record the port. An error may mention a port directly, or application documentation may specify it. If the issue affects a business service, note when it started and whether the problem affects local users, remote users, or both.

If you need to check process using port on a production host, record the current state before changing anything.

  • Confirm whether you are checking TCP, UDP, or both.
  • Record the server name and operating system.
  • Use an administrator or root shell only when the command requires it.
  • Avoid killing a process until you know what depends on it.
  • Keep a copy of command output before changing configuration.

Also check whether a firewall, NAT rule, or DNS record contributes to the symptom. A process can listen correctly while a firewall blocks access. For broader symptoms, see our guide to business network instability.

Windows commands for finding the process

Use netstat to find the PID

Open Windows Terminal or Command Prompt. To list listening TCP ports with process IDs, run:

netstat -ano | findstr LISTENING

To focus on one port, replace 8080 with the port you need:

netstat -ano | findstr :8080

The output commonly contains the protocol, local address, foreign address, state, and PID. A line such as 0.0.0.0:8080 with state LISTENING means a program is waiting for TCP connections on all IPv4 interfaces. The final number is the PID.

For UDP, there is no TCP listening state. Instead, look for a local address and PID:

netstat -ano -p udp | findstr :8080

Map the PID to an application

Once you have the PID, use Tasklist:

tasklist /FI "PID eq 1234"

Replace 1234 with the actual PID. The result shows the image name and memory use. If several services share a host process such as svchost.exe, the image name alone may not identify the service.

For more detail, run:

tasklist /svc /FI "PID eq 1234"

PowerShell provides another option:

Get-Process -Id 1234

To inspect the executable path, use an elevated PowerShell session:

Get-CimInstance Win32_Process -Filter "ProcessId = 1234" | Select-Object ProcessId,Name,ExecutablePath,CommandLine

Command-line details can reveal whether the program runs as a web server, database, agent, or custom application. Treat that information as sensitive. Do not paste full command lines into public forums if they contain tokens, paths, or credentials.

Linux commands for finding the process

Use ss for current sockets

On modern Linux systems, ss is a practical first choice. To show listening TCP sockets and the associated process, run:

sudo ss -ltnp

The options mean listening, TCP, numeric addresses, and process information. To check a specific TCP port:

sudo ss -ltnp 'sport = :8080'

For UDP:

sudo ss -lunp 'sport = :8080'

Output may include a process name and PID, such as users:(("nginx",pid=1450,fd=6)). That tells you the process currently owns the socket. If process details do not appear, run the command with sudo. Some containers, namespaces, or restricted environments can still make the result incomplete.

For a reference to the available filters and fields, consult the Linux ss manual.

Use lsof when you need file and process context

Many Linux distributions include lsof, which lists open files. Network sockets appear as files to the operating system:

sudo lsof -nP -iTCP:8080 -sTCP:LISTEN

For UDP, use:

sudo lsof -nP -iUDP:8080

The command can show the command name, PID, user, file descriptor, protocol, and address. The -nP options prevent name and port lookups, which usually makes output faster and easier to compare.

If lsof is unavailable, try:

sudo fuser -v 8080/tcp

Do not use a forceful fuser termination option as a first response. First identify the process and understand its role.

How to interpret the result

When you check process using port, focus on four questions. First, is the protocol correct? A TCP listener does not prove that a UDP-based application works. Second, which address does the process bind to? Localhost, one interface, and all interfaces produce different exposure and connectivity results.

Third, does the PID match the expected application? If a database port belongs to a web server, investigate before changing anything. Fourth, is the process managed by a service manager? A service may restart automatically after you stop it, which can hide the real problem.

FindingWhat it may meanSafe next question
No listenerThe service is stopped, failed, misconfigured, or using another port.Check service status and logs.
Expected process listeningThe application owns the port, but access may still be blocked.Check bind address, firewall, and application logs.
Unexpected processA port conflict or unapproved software may exist.Verify its path, owner, package, and purpose.
Listener on localhost onlyLocal applications can connect, but remote clients cannot.Confirm the intended bind address and security design.
Several established connectionsClients are actively communicating with the process.Review remote addresses and timing before changes.

Safe next steps after you identify the process

Identification should lead to verification, not an immediate termination. Check the application’s service status, configuration, logs, and recent changes. On Linux systems using systemd, commands such as these can help:

sudo systemctl status example.service
sudo journalctl -u example.service --since "30 minutes ago"

Replace the service name with the verified unit. Do not assume the process name and service name match. The systemctl manual explains the available service-management options.

On Windows, open Services, identify the service associated with the PID, and review its startup type and recovery actions. Event Viewer may contain application or system errors. PowerShell can also show service details:

Get-CimInstance Win32_Service | Where-Object {$_.ProcessId -eq 1234} | Select-Object Name,DisplayName,State,StartMode,PathName

Before stopping anything, ask whether the process supports phones, websites, databases, remote access, authentication, or other shared systems. A port conflict may be the visible symptom of a larger configuration mistake. Schedule disruptive work when users can tolerate an interruption, and preserve logs first.

When the process is not the whole problem

A successful port check does not prove that clients can reach the service. The program may listen only on an internal address. A host firewall may reject traffic. A network firewall may lack the required rule. NAT may forward the port to the wrong device, or DNS may point users elsewhere.

Test from the same network and from the affected remote location. On Windows, PowerShell includes:

Test-NetConnection server.example -Port 8080

On Linux, a basic TCP test may use:

nc -vz server.example 8080

These tests show whether a connection succeeds from that test location. They do not validate authentication, application behavior, or security. Avoid scanning systems you do not own or manage.

If the issue involves several devices or services, our network troubleshooting service page explains the broader diagnostic scope. Server owners can also review the available server support options.

Common mistakes to avoid

  • Assuming the port number proves the service: verify the process and executable path.
  • Stopping an unfamiliar PID: confirm ownership and dependencies first.
  • Checking only TCP: inspect UDP when the application uses it.
  • Ignoring IPv6: a service may listen on :: while your IPv4 check looks empty.
  • Changing the firewall first: establish that the service is listening and that exposure is necessary.
  • Forgetting containers: host and container port views may differ.

When to request help

Use this process for a focused check, but pause before making changes to production systems. Professional assistance makes sense when the PID belongs to a shared service, the port conflict returns, logs are unclear, or the system supports customer-facing operations. Tech Rescue Ops LLC can help inspect the process, service configuration, firewall path, and recovery plan in a controlled order.

If you need to check process using port during a recurring outage, preserve the output before restarting anything. That record can help separate a one-time conflict from a service, firewall, or deployment problem.

Scroll to Top