Every developer at one time or another has had to manually kill a development server running on their local machine.
In this short tutorial, I will show you how to find and shut down a development server running on Linux or MacOS.
Find the Process the Server Is Running On
To track down the process the server is running on, we run this
lsof -i:8000 // Change the number to the port your looking for.
This will output something like:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sales-api 71722 harrison 3u IPv4 725894 0t0 TCP localhost:irdmi (LISTEN)
Kill the Development Server
To kill the development server run this
kill -9 71722 // Change to your PID number.