Payments are experiencing issues due to temporary restrictions in Russia. If your payment does not go through, please submit a support request.Our support team is available 24/7 — we are always here to help with hosting and server issues.We are now accepting requests for dedicated server rental and colocation services in our data center.Reminder: we recommend enabling backups for additional data protection.A new VPS/VDS lineup with NVMe storage and improved performance is now available.Maintenance work on some servers has been completed. All services are operating normally.
Article3 min readViews1

How to Find Which Process Is Listening on a Port in Linux

Check TCP and UDP via ss, analyze the binding address, and distinguish a local listening socket from service availability from the internet.

Hardware network ports and connected cable
In this article

An application reports that a port is in use, or a service is running but cannot be connected to. Start with local sockets. This check reveals whether a listener exists on the server and which address it is bound to. It does not replace checks for routing, firewalls, or external accessibility.

Get the list of listeners

The commands are intended for Linux with iproute2. For TCP, run:

ss -ltnp

For UDP, use a separate query:

ss -lunp

The parameter -l limits the list of listening sockets, -n preserves numeric addresses and ports, and -p adds process details. A regular user may not have information about other users' processes. This does not mean the socket belongs to no one.

Read the binding address

A service bound to a loopback address is intended for local connections. Binding to all interfaces has a different meaning but does not automatically make the port accessible through an external firewall or cloud rules. Distinguish between IPv4 and IPv6 separately.

For example, an application listens on a local port behind a reverse proxy. Such a setup can be entirely correct: the client does not need to connect directly to the application. The error would be changing the binding to external solely to fix a single failed test.

Check the specific port

If the issue involves HTTPS, you can shorten the TCP output with a filter:

ss -ltnp 'sport = :443'

The number 443 is provided as an example. For your own service, use its actual port. The filter shows the local socket; it does not verify the certificate, HTTP response, or the application's readiness to handle a request.

If no listener is found, check the configuration and service logs. If an unexpected process is detected, first determine its purpose. The same port may be part of a shared architecture, and stopping the process could affect multiple sites.

Consider containers and network namespaces

The output relates to the network namespace where the command is executed. An application running inside a container and port publishing on the host are different layers. The absence of a process in the expected location does not prove the absence of the service across the entire system.

Do not start a new listener for a "test" if the port is already required by a production application. First, map the chain: external address, access rules, host port, proxy or container, application port. At each step, the owner of the configuration must be clear.

What a useful result looks like

Save the protocol, local address, port, process, and observation time. Then compare them with the expected connection scheme. After fixing the issue, check both the local socket and a standard request from the appropriate side of the network. Success at one level does not guarantee success at others: an open TCP port does not necessarily mean a working site, and unavailability from the internet does not always indicate a stopped process.

UDP does not have the same connection establishment as TCP. The presence of a local UDP socket must be compared with the application protocol and the actual response, not just verified by attempting a TCP connection to the same port number. An empty TCP response in this case is expected.

Discussion 0

Share your experience and ask questions. Comments without links appear after editorial review.

No comments yet. Start the discussion.