Free your blocked ports on Linux

Free your blocked ports on Linux

Subscribe to my newsletter and never miss my upcoming articles

Listen to this article

You closed all your code editors and terminals but your ports are still blocked.

The only solution you would have in your mind as a beginner is, to restart the computer. That would definitely fix this.

But what if there is a better way?

What if I can check where my port is being used and close that application, rather than restarting the computer?

For example, my blocked port is 3005 and I would like to see which application is still using it. I would simply run this in my terminal-

lsof -i :3005

This would give an output with a table of all the programs using this port 3005. Notice the PID column there and note down its value. In my case, it was 6595.

Now run the following command to kill the process and free the port from this evil app-

kill 6595

Now run your project on that port and live happily ever after.


Closing Notes

This is not a very frequent problem but can be frustrating for beginners and developers who are not proficient in Linux.

Share this


🙋‍♂️ Hello there,

My name is Pankaj, and I am the author of Slashism. I hope that you learn something useful today.

If you like my content and want to stay updated then subscribe to my newsletter in the header.

You can also follow me on Twitter and say hello.

If you would like to request a particular article/topic covered or would want to discuss something, then please start a discussion here on Github Discussions

⭐ Keep learning, keep growing ⭐

Proudly part of