Fix "Address Already in Use" / Port Already in Use
Address already in usebind: EADDRINUSEFailed to bind to portFAILED TO BINDThis 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.
"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 :25565
You'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 stop
Confirm 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.
Managed servers, no port wrangling
Our hosting manages ports and restarts cleanly through the panel — no stuck processes to chase.
Frequently asked questions
What does "address already in use" mean?
Another process is already listening on the port your server is trying to bind. It's almost always a previous instance of the same server that didn't shut down.
How do I find what's using a port on Linux?
Run ss -tlnp | grep PORT (or lsof -i :PORT). It shows the process and its PID. Then stop that process with kill, or kill -9 if it won't exit.
How do I free a port that's stuck?
Identify the PID holding it and stop that process. If a crashed process left the port in TIME_WAIT, just wait a minute and retry, or start your server on a different port.
Why does a Docker container say the port is already in use?
Either another container maps the same host port, or a non-Docker process already owns it. Check docker ps for container mappings and ss -tlnp for the real owner on the host.
My Pterodactyl server says the port is in use — what do I do?
This usually means the allocation (IP:port) assigned to that server clashes with another. Assign a free allocation to the server in the panel rather than trying to kill a process manually.
Can two different games ever safely share one port?
No — a single port can only be bound by one listening process at a time (per protocol). Give each server its own port and, if needed, its own IP.
Go deeper on this
Guides and explainers that pair with this fix — from our guides and blog.
How to Secure a Linux VPS
SSH keys, firewall, updates and least privilege — the day-one checklist.
ReadHow to Harden SSH
Key-only login, no root, and stopping brute-force attacks.
ReadIf Someone Gets Root on Your VPS
Contain, investigate, rotate credentials and rebuild cleanly.
ReadFamous Linux Vulnerabilities
Heartbleed to regreSSHion — what they did and the lesson.
ReadRelated articles
Fix SSH "Connection refused" / "Connection timed out"
SSH "connection refused" vs "timed out" — what each means and the exact steps to fix them.
Read fix Linux & VPSFix "Permission denied" on Linux (chmod & chown Explained)
"Permission denied" on a script or file? Understand chmod/chown and fix it the right way.
Read fix Linux & VPSHow to Check CPU, RAM & Disk Usage on a Linux Server
The essential commands to check CPU, RAM and disk on Linux — and find what's eating them.
Read fix