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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more