// crash guide
Minecraft server crash: port already in use
Your server asked the operating system for its network port and was told no, because something else already has it. Usually that something is another Minecraft server, often an old copy of this one that never fully shut down. Your mods and your world are fine.
What the error looks like
The server loads all your mods, then stops before the world loads. Near the end of the console you'll see this (Linux, which is what most hosts run):
[Server thread/INFO]: Starting Minecraft server on *:25565
[Server thread/INFO]: Using epoll channel type
[Server thread/WARN]: **** FAILED TO BIND TO PORT!
[Server thread/WARN]: The exception was: io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
[Server thread/WARN]: Perhaps a server is already running on that port?
On Windows, the second line says Using default channel type instead, and the exception line reads:
[Server thread/WARN]: The exception was: java.net.BindException: Address already in use: bind
Forge and NeoForge also print a logger name on each line, like [Server thread/WARN] [minecraft/DedicatedServer]: **** FAILED TO BIND TO PORT!. Other loaders may format the start of the line a little differently. The message itself is the same on Forge, NeoForge, Fabric and Quilt, because it comes from Minecraft's own server code, not from the mod loader.
Find it in logs/latest.log in the server folder. On newer versions the server may also write a file in crash-reports/ that only says java.lang.IllegalStateException: Failed to initialize server. That report doesn't mention the port, so search latest.log for "FAILED TO BIND".
The words after the exception name tell you which problem you have:
| The exception says | What it means |
|---|---|
| Address already in use | Another program is already listening on that port. |
| Cannot assign requested address | server-ip in server.properties is an address this machine doesn't have. |
| Permission denied | On Linux, the port is below 1024, and those normally need root. On Windows, it can mean Windows has reserved that port for itself. Either way, pick another port. |
What it means
Only one program at a time can listen on a given port. When Minecraft starts, it asks for its port (25565 unless you changed server-port). If the operating system refuses, Minecraft gives up and shuts down. The port is opened before the world loads, so your world wasn't touched.
The usual causes, most likely first:
- An old copy is still running. It crashed but the Java process didn't exit, or you started a second copy: in another terminal, or by hand while a systemd service or restart script was already running it.
- Another program has the port. A second Minecraft server on the same machine, or a Velocity or BungeeCord proxy that you set to 25565.
server-ipis filled in with an address this machine doesn't have, such as your home's public IP or an old local IP. That gives "Cannot assign requested address".server-portis a low number like 80 or 443 on Linux. That gives "Permission denied".
One clue about the old copy: on Minecraft 1.16 and newer, a second copy started from the same folder usually stops earlier, with session.lock: already locked (possibly by other Minecraft instance?), because both copies want the same world. So on those versions, FAILED TO BIND often points to a server in a different folder, such as the old install you kept when you updated the pack. On 1.12.2 and older, the same folder can give this error too.
Common in these packs: none in particular, because Minecraft opens the port itself. Big packs make the most common cause more likely: a server running All the Mods 10 or FTB StoneBlock 4 can take a while to save and exit, and starting it again before the old process is gone gives this error.
How to fix it
- Stop it fully, wait, start once. Type
stopin the console and wait until the process has really exited. A big modded world can take a while to save. Wait about 30 seconds more, then start the server one time.- Pelican panel: click Stop and wait for the status to show offline. If it hangs, use Kill, which skips the save. Then Start.
- Find what's holding the port on your own PC or VPS. Use your port if it isn't 25565.
- Linux:
sudo ss -ltnp | grep 25565orsudo lsof -nP -iTCP:25565 -sTCP:LISTEN. Both show the program and its PID. - Windows:
netstat -ano | findstr :25565. The last column is the PID.tasklist /FI "PID eq 1234"names it. - If it's
java, find out which server it is. On Linux,ls -l /proc/1234/cwdshows the folder it was started from, andps -fp 1234shows its command line. On Windows, open Task Manager > Details and turn on the "Command line" column.
- Linux:
- Stop that program cleanly. If it's an old copy of your server, go back to its console (
screen -r,tmux attach) and typestopso it saves. If a systemd service runs it, stop the service withsudo systemctl stop <service>, or it may come straight back. Force-kill only as a last resort:kill 1234, thenkill -9 1234(Windows:taskkill /PID 1234 /F). A forced kill skips the save. - Or give this server another port. If the other program should keep running, set
server-port=25566inserver.properties. Each server on a machine needs its own port. Players then join withyour.address:25566. If you host at home, forward the new port on your router too. - Clear
server-ip. Leave it empty (server-ip=) so the server listens on every address the machine has.0.0.0.0does the same, so leave that alone if your panel set it. At home, don't put your public IP there: that address belongs to your router, not your PC. The router forwards the port to your PC, so the server never needs to know it. - Check the start command for
--port. A--portargument overridesserver-port. Look in your start script, such asrun.sh/run.baton Forge and NeoForge 1.17 and newer. On a Pelican panel, check the Startup tab. - On a hosted panel, match the assigned port. Your server can only use the port the host gave it, which the panel shows with the server's address.
server-portmust match it. Some panels write it intoserver.propertieson every start. If yours doesn't, change it in the file manager. If it matches and the error comes back after a full stop, contact your host.
This error isn't caused by your Java version, JVM flags or memory settings, so you don't need to change them.
Loader notes
- All four loaders: the port is opened by Minecraft itself, so the message and the fix are the same on Forge, NeoForge, Fabric and Quilt.
- Telling servers apart: a leftover server's command line usually names its loader. Look for
forge,neoforged,fabricorquiltin it. If two servers use the same loader, the folder is the surer test:/proc/<PID>/cwdon Linux, or the jar path in the "Command line" column on Windows.
When a mod logs the BindException instead
Some mods open their own port: Simple Voice Chat (UDP 24454 by default, set in config/voicechat/voicechat-server.properties), BlueMap's web map (8100) and Dynmap (8123). If that port is taken, the mod's error usually includes BindException or "Address already in use", so the crash log analyzer may flag it. The game server usually keeps running. Change the mod's port or stop the other program. On a hosted panel, that port must be an extra port assigned to your server.
RCON works the same way. If rcon.port is taken, for example because it's set to the same number as server-port, the log says "Unable to initialise RCON" and the server carries on without it.
How to check it's fixed
- The console shows
Starting Minecraft server on *:25565(with your port) and no FAILED TO BIND lines after it, thenPreparing level "world", thenDone (…s)! For help, type "help". - Run the
ssornetstatcommand from step 2 again. You should see one listener, and its PID should be your new server. - Join from Minecraft. If you changed the port, add it to the address.
- Do a restart test: type
stop, confirm the port is free, then start again. If the port is taken right after a clean stop, something keeps relaunching the server.
Paste your log into the free crash log analyzer. It checks your log against known errors, including this one, and tells you what to change.
Related crash guides
Modded hosting is relaunching.
A DSN server gets its port from the panel, and you get a live console, a file manager and SFTP for fixes like this one, plus support from the owner by email. We're moving DSN Servers to new hardware, and ordering is closed until then. Join the launch list and we'll email you when servers open.