When you’re creating a NodeJs application, dotnet core, or other application that spins up a quick server, you may have an app server that is hosting the app. Occasionally the app server will hang and when you go to start up the app again it will respond that the address is already in use. The server/process will need to be terminated so you can get that port back and restart your server.

Failed to bind to address address already in use.

Here’s a quick reference to get a list of all the processes that are running on your machine with a given port, ex. 3000.

lsof -i :3000

This will respond back with a table of processes that are running and their given Process Identification (PID). To kill a given process, invoke the kill with -9 and the PID.

kill -9 <PID>

Photo by Artak Petrosyan on Unsplash