Weblutions Documentation
Weblutions Main Site Contact Us Our Discord
Some pages are still pending proper formatting, if required refer to the legacy documentation website.
Knowledgebase IconKnowledgebase

Weblutions Documentation / Knowledgebase / Find a Processes Port on Ubuntu

Updated

Find a Processes Port on Ubuntu

By Josh M. 1 mins 5

Locating the port a process or application is running on can be a tricky task at times especially, if the application files, configuration, or setup can't be located. This can be useful if you need to end/stop a service running on a specific port. To do this follow the below instructions set in this guide.

The lsof Command

The usage of the lsof command per the below example is a great way to see what is running or using a specific port.

lsof -i tcp:3000

This command will return a list of processes running on this port on the system. The output may look like the below.

COMMAND   PID   USER   FD    TYPE   DEVICE   SIZE/OFF   NODE   NAME
Node ru   1124  root   28u   IPv6            19573      0t0    TCP *:3000 (LISTEN)

If you're looking to stop the process running on the port, the kill command can be utilised to perform such actions. For example to kill the process listed above on port 3000 the below command could be ran by using the PID.

kill 1124