đ§SysAdmin âĸ Linux & Bash CLIVerified for Ubuntu 20.04/22.04/24.04, Debian 12, CentOS/RHELâąī¸ 15 secondsđ¯ Beginner
Find and Kill Process Running on Specific Port in Linux
Free up occupied ports (e.g., port 3000 or 8080) blocked by zombie node/python processes.
Alex ChenReviewed by Expert
Staff DevOps & Infrastructure Architect
đ3 min read
âĸđ430 words
âĸđ
Updated 2026-10-30
Verified Command (Single-Click Copy)
Updated: 2026-10-30bash
Press C to copy
sudo fuser -k 3000/tcpđ Prerequisites
State Changing / Caution- âpsmisc package installed
- âsudo privileges
đĄ Primary Use Cases
EADDRINUSE Port Collision in Local Dev:
Instantly kill orphan background web server processes.
# How It Works
`fuser -k` immediately sends a SIGKILL to any process bound to the specified TCP port number.
Expected Terminal Output
3000/tcp: 28491
[Process 28491 terminated]â ī¸
Gotcha & Common Pitfall
Check which process is running first before killing it blindly using `lsof -i :3000`.
âĄ
Performance & Complexity
Time ComplexityO(1)
Space (Memory)O(1)
Mutates OriginalYes (In-Place)
âšī¸ Terminates OS process immediately.
â
Environment & Version Support
Ubuntu / Debian
psmisc packageVerified
macOS (Darwin)
lsof + killVerified
Recommended Tool âĸ Hetzner Cloud
Reliable Cloud VPS from âŦ3.50/mo
Ultra-fast NVMe storage, unmetered bandwidth, and Root SSH access in EU & US data centers.
# Alternative Methods & Variations
Inspect first with lsof
See PID and process name before terminating.
bash
Press C to copy
sudo lsof -i :3000
kill -9 <PID>đ People Also Ask (Related Quick Answers)
How to see all listening ports in Linux?
sudo ss -tulpnHow to find process by name in Linux?
pgrep -l process_name?
Frequently Asked Questions about Find and Kill Process Running on Specific Port in Linux
What if fuser command not found on my system?âŧ
Install it via "sudo apt install psmisc" on Ubuntu/Debian or "sudo dnf install psmisc" on Fedora/RHEL.
How do I run this on macOS?âŧ
macOS does not have fuser by default. Use: "kill -9 $(lsof -t -i:3000)".
đŦWas this snippet helpful for your problem?
Thank you for your feedback! It helps improve this guide.
Tags:#linux#port#kill#networking#sysadmin