Sometimes a port doesn't release properly resulting in servers starting on non-standard ports.

How do you release the port? Easy, use this:


lsof -i :portnumber

Grab the resulting PID and kill the process. Use -9 if you really have to.

Here's a "worked example":


$ lsof -i :1990
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 2857 david 39u IPv6 0x23ed6292526f5971 0t0 TCP *:stun-p1 (LISTEN)
$ kill -9 2857