Error: couldn't connect to server 127.0.0.1:27017

Make sure MongoDB server is running and listening the port 27017 using netstat command

~ netstat -an | grep 27017

tcp4       0      0  *.27017                 *.*                    LISTEN
1 Like