This error means another process is already listening on the port your server wants. Usually it's a previous instance that didn't shut down. Here's how to find and clear it, including the Docker- and panel-specific cases.
Quick answer
"Address already in use" means another process already holds the port your server wants, usually an old instance that did not shut down. Find it with ss -tulpn | grep :PORT (or lsof -i :PORT), stop that process with kill PID, or give your server a different free port, then start it again.
"Address already in use", "bind: EADDRINUSE" and "failed to bind to port" are the same problem: something already holds the port. The fix is always these three steps:
- Find what's on the port:
ss -tlnp | grep PORT(gives you a PID). - Confirm that PID really is your old server — not a system service.
- Free it:
kill PID(orkill -9 PIDif it won't stop), then start your server.
Find what's using the port
On Linux, ss (or lsof) shows which process holds the port — say 25565:
ss -tlnp | grep 25565
# or
lsof -i :25565You'll get a PID (process ID) of whatever is bound to it.
Free the port
If it's a stuck old instance of your server, stop it cleanly first; if it won't die, force it:
kill 12345 # graceful, by PID
kill -9 12345 # force, if it won't stopConfirm the PID really is your game server before killing it. Killing a system service by mistake can take other things down.
Common real causes
- A previous server instance is still running (the usual cause).
- Two servers configured on the same port — change one.
- A crashed process left the port in a lingering TIME_WAIT state — wait a minute and retry.
- You're starting the server twice (e.g. a leftover screen/tmux session).
Or just change the port
If you genuinely want two servers, give the second one a different port in its config and update your firewall/forwarding to match.
Something already owns the port. Find the PID with ss/lsof, stop that process, then start your server.
Docker and panel-specific causes
- A Docker container maps a host port that's already used by another container or a bare-metal process —
docker psshows the mapping, andss -tlnpshows the actual owner. - On Pterodactyl/panel setups, this usually means the primary allocation (IP:port) is already assigned to another server. Free or reassign the allocation in the panel rather than hunting for a process — see fixing Pterodactyl server won't start.
- systemd socket activation can pre-bind a port before your service even starts, making it look "in use" by nothing obvious — check
systemctl list-sockets.
How to prevent it
- Always stop a server cleanly (console command, not just closing the window) so it releases its port.
- Document which service owns which port on a shared box, especially with multiple game servers.
- Use a process manager or panel that tracks state, so you can't accidentally start the same server twice.