Port X is already in use
The text describes how to fix the “Port 3000 is already in use” error. It provides commands to identify the process occupying port 3000, such as using `lsof` on Linux or a PowerShell command on Windows, and then instructs the user to terminate that process using the `kill` command.
generated by
gemma3:4b
If you’ve ever encountered the error message “Port 3000 is already in use” when trying to run a local server for your application, you know how frustrating it can be. This error occurs when another process on your machine is using port 3000, which is the default port used by many web servers. Whether you’re a beginner or an experienced developer, the techniques we’ll cover will help you quickly and easily resolve this common issue.
Table of Contents
Find the processes
sudo lsof -i :3000
It will give you the following result (given if any process is running on 3000 port)
COMMAND | PID | NODE | NAME |
---|---|---|---|
node | 56017 | TCP | localhost:hbci (LISTEN) |
Kill
kill -15 \<PID>
If the above step is still not killing the process, I recommend using -9
argument. It kills the process immediately.
For example:
kill -9 56017
Windows
Here’s a simple PowerShell command (run as Admin) that finds and kills all processes using port 3000:
Get-NetTCPConnection -LocalPort 3000 | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force}
Related snippets
- Can’t Redeem DOOM: The Dark Ages in NVIDIA App? Try This Quick Fix May 13, 2025 Trouble claiming DOOM: The Dark Ages in the NVIDIA app? Follow this quick network fix that solves the redemption glitch in minutes.
- Custom Scrollbar Selectors January 23, 2024 Customize scrollbar styles to perfectly match your unique aesthetic.