Having problems with ports already used. Try this

There were numerous moments when I couldn’t start a docker project or a node/nuxt/vue instance because on the WSL some ports were already opened by other processes (usually same processes that I started but didn’t close).

Now I simply do the following:

sudo netstat -nlpt |grep 3000

… where “3000” is the port. This usually returns something like:

tcp6  0  0  :::3000  :::*  LISTEN  200129/node

… where “200129” is the process that is using the port. After I get the process id, I close it like so:

sudo kill -9 200129

Leave a Reply

Your email address will not be published. Required fields are marked *

No spam? * Time limit is exhausted. Please reload CAPTCHA.