8 min read

Fix "FAILED TO BIND TO PORT!" When Starting a Minecraft Server

Failed to bind to port on your Minecraft server means the port is already taken. Find the process, free port 25565, or set a new server-port and fix server-ip.

Fix "FAILED TO BIND TO PORT!" When Starting a Minecraft Server

"FAILED TO BIND TO PORT!" means the port your Minecraft server wants to listen on is already taken by another program, so it gives up before it ever finishes starting, and the fix is almost always to free that port or move your server to a different one. Nothing is broken with your world or your jar. The server just tried to open a door that was already being held by someone else, and it refuses to fight over it.

What the message actually means

When a Java server boots, it grabs a network port so players can connect. The default is 25565 for Java Edition and 19132 for Bedrock. "Binding" is the server claiming that port for itself. Only one program can hold a given port at a time, so if something else already has 25565, your server prints the failure and shuts back down.

The full block in your console usually reads like this:

[Server thread/WARN]: **** FAILED TO BIND TO PORT!
The exception was: java.net.BindException: Address already in use

On Windows you might see a slightly different tail on that exception instead. "Cannot assign requested address" points at a bad server-ip value, and "Permission denied" shows up when you picked a port the operating system won't let you have. The heading is the same in every case, and so is the goal: figure out who has the port, then either take it back or pick another one.

Find what is holding the port

The usual culprit is a previous server instance that never fully shut down. You closed the window, or a restart script relaunched the server before the old process let go, and now two copies are fighting over 25565. Track down the process that already owns it.

On Windows, open Command Prompt and run:

netstat -ano | findstr :25565

That prints any line using the port, and the last number on the row is the PID (process ID). Open Task Manager, switch to the Details tab, find that PID, and end it. Or do it from the same terminal:

taskkill /PID 12345 /F

Swap 12345 for the real PID. On Linux, get the same information with either of these:

lsof -i :25565
ss -ltnp | grep 25565

Both show you the process name and PID sitting on the port. If it is a stray java process, kill 12345 clears it. If you run your server as a service, stop it properly with something like systemctl stop minecraft so the manager does not immediately restart it behind your back. Once the port is free, start your server again and the bind goes through.

If you would rather not hunt down a process at all, the faster move is to give your server a different port and leave the old one alone, which is the next section.

Fix it in server.properties

Two lines in server.properties control this, and both live near the top of the file.

The first is server-port. Change it to any free port above 1024 that nothing else is using:

server-port=25566

Save, restart, and the error is gone as long as that port really is open. Remember that players now need the new number in the address (more on that in the FAQ), and that you will need to port forward the new port if your server is public. If you are still setting the box up from scratch, the walkthrough in how to set up a Paper Minecraft server covers where all of this lives.

The second line is server-ip, and this one causes a surprising number of bind failures. It tells the server which network address to listen on, and it should almost always be blank:

server-ip=

Leave it empty and the server binds to every address the machine has, which is what you want. People get into trouble when they paste their public IP or their router's IP into that field. The machine does not actually own that address at the operating-system level, so the bind fails with "Cannot assign requested address." Blank it out, save, and restart. The only time you set server-ip on purpose is when a box has several network interfaces and you deliberately want to listen on just one of them, which is rare for a home or hobby server.

Two servers pointed at the same port

If you run more than one Minecraft server on the same machine, they each need their own server-port. This is easy to miss when you copy a working server folder to spin up a second one, because the copy inherits server-port=25565 from the original. Whichever server starts first grabs the port, and the second one hits the bind error the moment it boots.

Give every server its own number. Keep one on 25565, put the next on 25566, a third on 25567, and so on. Then forward each of those ports separately on your router if they need to be reachable from outside. A Bedrock server on the same box uses UDP 19132 by default and does not collide with a Java server on 25565, since they are different protocols on different ports, but two Bedrock servers still need distinct ports the same way.

Privileged ports on Linux

There is one more cause that only shows up on Linux and other Unix-like systems. Ports below 1024 are privileged, and a normal user account is not allowed to bind them. If you set server-port=80 or server-port=25 hoping to make the address shorter, an ordinary user gets "Permission denied" right under the bind failure even though nothing else is using the port.

Do not fix this by running the server as root, which is a bad habit for a process that faces the internet. Keep the server on a high port like 25565 and, if you truly need players to connect without typing a port, set up an SRV DNS record so the short address quietly points at the real one. The default 25565 is not privileged, so most people never run into this at all.

A note for shared and managed hosts

If you rent a server from a host rather than running it on your own machine, the port is assigned to you, and you should not override it. The panel shows the exact port your server is meant to use, and server-port in server.properties is expected to match that value. Change it to something the host did not allocate and you will either get the bind error or a server nobody can reach, because the host's firewall only routes the port it gave you. Leave server-port on the assigned number and server-ip blank, and let the panel handle the rest. If the server boots fine but still will not show up for players, that is a different problem, and a server showing offline on server lists walks through it.

FAQ

Does changing the port mean players have to type it in?

Yes. Once you move off the default, the server lives at ip:port, so a server that used to be play.example.com becomes play.example.com:25566. Players add that after the address in the multiplayer menu. If you want to keep the address clean, set an SRV record in your DNS that maps the hostname to the real port, and then people can leave the number off. There is more on how addresses and ports fit together in how to find a Minecraft server IP and port.

Why does it say bind failed right after a crash?

When a server crashes hard instead of shutting down cleanly, the operating system does not release the port instantly. It holds it in a TIME_WAIT state for a short window, usually under a minute, so any leftover packets can drain. Restart too quickly and the new process hits the still-locked port. Wait a moment, or check with lsof -i :25565 to confirm the old process is gone before relaunching. If crashes are a regular thing, why your Minecraft server keeps crashing is worth a read.

The port shows free but it still fails. What now?

Double-check server-ip first, since a stray address there causes "Cannot assign requested address" even when the port itself is wide open. If that line is blank and you are on Linux, confirm you are not below 1024. On a rented host, make sure server-port matches the number the panel assigned you rather than a value you picked.

Will a bad restart script cause this?

It can. If your automation relaunches the server before the previous process has released the port, the new one lands on a port that is still held for those few seconds. Add a short delay or a check that the old process has exited before starting the next one. Setting restarts up properly is covered in scheduling automatic restarts for a Minecraft server, and once the port is free your server binds and boots like normal.