Find process using port (example: 3000)
Identify which process is using the port:This command returns the Process ID (PID) of the process using port 3000.
Kill process
Terminate the process using its PID:The
-9 flag forces the process to terminate immediately.Alternative methods
Using netstat
Using ss command
Using fuser
Common port conflicts
Development servers
- Port 3000 - React development server
- Port 8080 - Common web server port
- Port 5000 - Flask development server
- Port 8000 - Django development server
Database ports
- Port 5432 - PostgreSQL
- Port 3306 - MySQL
- Port 27017 - MongoDB
Safety tips
Check what you’re killing
Use graceful shutdown first
Check for multiple processes
Troubleshooting
Permission denied
Port still in use
Next Steps
Now you can:- Free up ports for development
- Troubleshoot port conflicts
- Manage running services
- Restart applications cleanly