Skip to content

Instantly share code, notes, and snippets.

@esteedqueen
Created July 31, 2018 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esteedqueen/b8e255f064505c3d683fd856b787c3d3 to your computer and use it in GitHub Desktop.
Save esteedqueen/b8e255f064505c3d683fd856b787c3d3 to your computer and use it in GitHub Desktop.
How to handle address already in use error

You attempted to start up a server, only to be confronted with the following error:

Address already in use - bind(2) for "0.0.0.0" port 3000 (Errno::EADDRINUSE)

What do you do?

  1. Figure out what service is using that address port.

To see what's running on port 3000, run:

lsof -i tcp:3000

That should return a result that looks similar like this:

COMMAND    PID   USER     FD   TYPE        DEVICE         SIZE/OFF  NODE NAME
com.docke xx783 username   18u  IPv4 0xblahblahblahblah      0t0     TCP *:hbci (LISTEN)
  1. Kill the service
sudo kill -9 PID

OR:

If you don't want to kill the server, start the server on a new port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment