DEV Community

Kenneth Isaac
Kenneth Isaac

Posted on

5

How to stop Localhost server running on multiple ports.

I ran into a situation where I had multiple localhost ports. This is my fault as I failed to clearly close them.

So what do we do? A very simple way is to run the following command:

npx kill-port <port>

replace port with the port you want to close without the bracket.

Note that if you don't have the kill-port package installed, you would be prompted to install it.

There you go. Make sure you close your servers with Ctrl + C, unless stated otherwise.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more