Close a port from the command line Find the process ID for the process occupying the port (e.g., port 3000 in the example below). lsof -i :3000 Kill that process. kill -9 <PID>