How to Kill a Development Server

How to Kill a Development Server

Learn How To Kill A Development Server From The Command Line.

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 command:

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 command:

kill -9 71722 // Change to your PID number.

Did you like it? Why don't you try also...

Quickly Spin Up MongoDB With Docker Compose

Quickly Spin Up MongoDB With Docker Compose

Learn How to Install MongoDB Using Docker Compose

Is String a Palindrome?

Is String a Palindrome?

Learn How to Test if a String is a Palindrome in Go.

How to Convert GoLang Integer to String Conversion

How to Convert GoLang Integer to String Conversion

Learn how to convert integers to strings and how to convert strings to integers in GoLang