How to Fix java.io.IOException: Failed to Bind to Port in Minecraft
Fix the 'Failed to bind to port' IOException when starting a Minecraft server. Covers port conflicts, firewall issues, and binding to specific addresses.
How to Fix java.io.IOException: Failed to Bind to Port in Minecraft
The Error
java.io.IOException: Failed to bind to port
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:...)
**** FAILED TO BIND TO PORT!
The exception was: java.net.BindException: Address already in use
Perhaps a server is already running on that port?
This error appears when your Minecraft server tries to open port 25565 (or whichever port you configured) but another process is already using that port, or the operating system is blocking the bind.
Quick Fix
Check if another Minecraft server (or any other program) is already running on the same port. On Linux, run sudo lsof -i :25565. On Windows, run netstat -ano | findstr :25565. Kill the conflicting process, then start your server again.
Step-by-Step Diagnosis
- Identify the conflicting process. On Linux:
sudo ss -tlnp | grep 25565. On Windows:netstat -ano | findstr :25565. Note the process ID (PID) using the port. - Kill the conflicting process. On Linux:
kill -9 <PID>. On Windows:taskkill /PID <PID> /F. If the PID belongs to a previous Minecraft server instance that did not shut down cleanly, this resolves the issue immediately. - Check server.properties. Verify
server-port=25565is correct. If you need to run multiple servers on one machine, give each a different port (25565, 25566, 25567, etc.). - Check server-ip field. If
server-ip=is set to a specific IP address inserver.properties, make sure that IP actually exists on the machine. An incorrectserver-ipcauses a bind failure. Leave it blank to bind to all interfaces (0.0.0.0). - Wait for port release. After killing a process, the OS may hold the port in TIME_WAIT state for up to 60 seconds. Wait a minute and try again, or add
-Djava.net.preferIPv4Stack=trueto your JVM arguments. - Check firewall rules. On Linux, check
iptables -Lorufw status. Make sure port 25565 is allowed. On Windows, check Windows Defender Firewall inbound rules for Java.
Common Causes
- Previous server instance still running. If you closed the server terminal without typing
stop, the Java process may still be alive in the background. Always shut down servers properly with thestopcommand. - Another application using the port. Web servers, game servers, or development tools sometimes use port 25565. Check all running processes.
- Docker or container conflict. If you run Minecraft in Docker, make sure the host port mapping does not conflict with a bare-metal server or another container.
- Incorrect server-ip value. Setting
server-ip=127.0.0.1restricts the server to localhost only. Players on other machines cannot connect. Set it to the machine's public or LAN IP, or leave it empty. - Non-root user on privileged port. Ports below 1024 require root on Linux. If you set
server-port=80, the server will fail to bind unless run as root (which is not recommended). Use the default port 25565.
Running Multiple Servers
To run multiple Minecraft servers on one machine, assign each a unique port in server.properties. Players connect with yourip:25566 for the second server, etc. If you use a Velocity or BungeeCord proxy, only the proxy needs to bind to 25565.
FAQ
Can I change the default Minecraft port?
Yes. Edit server-port in server.properties. Players must include the port when connecting: play.example.com:25566. SRV DNS records can hide custom ports behind a clean domain name.
Why does the error come back after a restart?
If a previous instance is set to auto-start (via systemd, cron, or a panel), it grabs the port before your manual start. Check your systemd services or panel schedules.
Does this error affect my world data?
No. The server fails to start, so no world data is read or modified. Your world files are safe.
Need a server that handles all this? Astroworld Hosting, NVMe SSDs, Pterodactyl panel, DDoS protection on every plan.