Minecraft2026-11-09 · 7 min read

Minecraft Server "Address Already in Use" — The Real Fix

java.net.BindException means something already has your server's port — and "just change the port" is the wrong first move most of the time. Here's how to find out what's actually holding it, and fix the real cause instead of masking it.

Find out what's holding the port before doing anything else

Linux/macOS: lsof -i :25565. Windows: netstat -ano | findstr :25565. Whatever process name or PID comes back tells you which of the four causes below you're actually dealing with.

Nothing shows up at all, and the error appeared right after a crash? Skip to cause 3 — it's probably just the OS's cleanup delay.

1

A duplicate server process is still running

Symptom

Log shows `java.net.BindException: Address already in use` (sometimes `: bind`) right after `Starting minecraft server version...`. You're sure you only started it once — but maybe a start script, a crashed systemd unit, or a second terminal window already has it running.

Cause

By far the most common cause. A previous instance of the same server jar never actually exited — it crashed into a hung state, or a restart script launched a new process without confirming the old one was dead first — and it's still holding the port.

Fix

Find the process and kill it. On Linux/macOS: `lsof -i :25565` (or `sudo netstat -tulnp | grep 25565`) lists the PID holding the port; `kill <pid>` stops it (add `-9` if it ignores a normal kill). On Windows: `netstat -ano | findstr :25565` gives you the PID, then `taskkill /PID <pid> /F`. Never just launch a second instance on a different port as a workaround — the first one is still running, still eating RAM, and will keep colliding every time you restart.

2

Something else is already using that port

Symptom

Same BindException, but you've confirmed there's no other Minecraft process running at all — `lsof`/`netstat` shows a completely different program on that port.

Cause

Port 25565 isn't reserved for Minecraft at the OS level — any program can bind it first. Common culprits: a second game server (another Minecraft version, a different game entirely), a proxy like Velocity or BungeeCord also configured to listen on 25565, or — on a shared or home connection — a router/NAS service that happened to claim the same port.

Fix

Either stop the other program, or change `server-port` in `server.properties` to something free (anything above 1024 that isn't already claimed works; 25566, 25567 etc. are common conventions for a second instance). If you change the port, remember your router's port-forward rule (if self-hosting) and anyone connecting needs the new port appended to the address.

3

It only happens right after a crash or hard restart

Symptom

The server crashed or was killed abruptly. You immediately try to restart it and get BindException — but waiting a minute and trying again works fine.

Cause

This is the OS holding the socket in **TIME_WAIT** state after an unclean shutdown — not a real conflict, just the kernel's own cleanup delay (typically 30-120 seconds) before it considers the port fully free again, a TCP protection mechanism against stray packets from the dead connection.

Fix

Wait 1-2 minutes and try again — this resolves itself without any action. If your start script auto-restarts immediately after a crash and keeps hitting this, add a short delay (10-15 seconds) before the restart attempt. On Linux, setting `SO_REUSEADDR` at the application level avoids this entirely, but that's a server-software-level fix, not something you configure — Paper and recent vanilla server jars already do this correctly, so persistent TIME_WAIT issues usually point back to cause #1 instead.

4

Running in Docker and the container won't start

Symptom

`docker run` or `docker-compose up` fails with something like `Bind for 0.0.0.0:25565 failed: port is already allocated` — this is a Docker-level error, not a Java one, and happens before the Minecraft process even starts.

Cause

Either another container already has that host port mapped (`-p 25565:25565` used twice across different containers), or — confusingly — a previous container using the same port mapping wasn't fully removed, just stopped, and Docker still reserves the mapping.

Fix

List what's using the port with `docker ps -a` and check the PORTS column; a stopped-but-not-removed container still shows there. Remove it with `docker rm <container>`, or map to a different host port with `-p 25566:25565` (left side is the host port, right side stays 25565 inside the container — only the host side needs to change).

The rule that saves the most debugging time

Identify the process before you pick a fix. Changing server-port always "works" in the sense that the new port is free — but if the real cause was your own server already running under a different, forgotten PID, you've now got two live copies of the same world both writing to disk, which is how corrupted region files happen. Thirty seconds with lsof or netstat tells you which of the four causes above you're actually looking at.

FAQ

How do I find out exactly what's using port 25565?+

On Linux or macOS, run `lsof -i :25565` — it lists the process name and PID holding the port. On Windows, run `netstat -ano | findstr :25565` and cross-reference the PID shown against Task Manager's Details tab. In Docker, `docker ps -a` shows every container and its port mappings, including stopped ones that still reserve the mapping.

Can two Minecraft servers share the same port?+

No — a TCP port can only be bound by one process at a time on a given network interface. Two separate Minecraft server instances need two different ports (e.g. 25565 and 25566), each with its own port-forward rule if you're behind a router. A proxy like Velocity is the exception: it binds the single public-facing port and routes players to multiple backend servers running on their own internal ports.

Is it safe to just change server-port instead of finding what's holding 25565?+

It works, but it only treats the symptom. If the real cause is a duplicate or crashed instance of your own server still running (cause #1 above), changing the port just means you now have two copies of your server both trying to run — doubling RAM/CPU use and risking both writing to the same world files at once, which can corrupt save data. Always confirm what's holding the port before deciding whether to kill it or just move to a new one.

Why does this only happen after my server crashes, never on a clean stop?+

A clean stop (typing `/stop` in console, or a proper systemctl stop) closes the socket in an orderly way and the port is free almost immediately. A crash or a forced kill (`kill -9`, a power loss, an OOM-killer termination) doesn't get that chance — the OS has to notice the process is gone and release the port itself, which is where the TIME_WAIT delay in cause #3 comes from.

I freed the port but the server still won't start — now what?+

Once BindException stops appearing in the log, any further startup failure has a different, unrelated cause — check the next error in the log (a missing eula.txt acceptance, a corrupted world file, or a mod/plugin crash are the next most common blockers) rather than assuming it's still port-related.

Never debug a port conflict again

Every CoalHost server gets its own dedicated port, and our panel refuses to double-start an instance that's already running — no duplicate-process port fights. From €10.69/month.

View Minecraft Hosting →