Grunt error “port 9000 is already in use” [solved]

When trying to run “grunt server” to start up the front-end you may come across port already in use errors. Like this one:

Port-error-9000

Grunt uses these ports to setup various features such as live reload, documentation, testing etc… It may be that your previous Grunt server was running on those ports and unexpectedly exited but those ports are still in use. You will need to kill those processes in order to start a new Grunt server up. To find process ids that are running type:

netstat -a | egrep 'Proto|LISTEN'

Grunt error port 9000 is already in use

If you want a full list of all process ids using a specific port type:

lsof -n | grep TCP | grep LISTEN | grep 9000

Php5-fpm

In this example we can see actually that php-fp is using port 9000. Let’s kill them.

sudo kill $(sudo lsof -t -i:9000)

Up_and_running_again

We’re up and running again!