What I learned today

What I learned today

Personal blog about programming and all that stuff

18 Oct 2020

Find and Kill an Application Blocking a Port

Sometimes when you develop a web application you can run into the problem, that an application is blocking a specific port on your host. This article shows you how to identify that application.

I recently ran into a situation, where a web application I was working on, blocked a port on my machine. The application ran in background and blocked my desired port. I got the error message:

Error: Os { code: 48, kind: AddrInUse, message: "Address already in use" }

What to do

Find the application, that’s blocking the port (in my example port 8088):

sudo lsof -i :3000

Then kill this application:

kill -9 <PID>