Skip to content

How to kill a port in mac, Linux or windows? – Solved

Ayyaz Zafar1 min read

How to kill a port in mac, Linux or windows? – Solved

There are several approaches to kill a port. I found a command that is very simple and easy to remember that works in any operating system.

All you need is to have npm installed on your computer.

If npm is installed on your computer already then just run following command:

Terminal
npx kill-port 3000

If you want to kill multiple ports then you can use following commands:

Terminal
npx kill-port 3000 3001 3002

Latest tutorials

All 754 →

Get new tutorials by email

One email when something new is published. Unsubscribe anytime.

Written by Ayyaz Zafar, full-stack developer for 15+ years. Work with me