Mac OS X HOWTO: Kill PID occupying a port on macOS. lsof -t -i tcp:<port-number> | xargs kill Example lsof -t -i tcp:8080 | xargs kill