How to fix “Failed to bind to port” on a Minecraft server

If the server cannot connect the port when it starts up, another process may be listening on that port or an IP that does not belong to the machine may have been written in the configuration.

Step by step

  1. Note the port listed in the log. Call the Java listener with ss -ltnp on Linux, Get-NetTCPConnection -LocalPort 25565 -State Listen in Windows PowerShell.

  2. If you have started the same server twice, first shut down the running instance properly from the console. Random termination without knowing what the process is.

  3. If two servers will work together, give each a different port. If you typed a public IP that does not exist on the machine in the server-ip field, correct the binding setting.

  4. Restart the server and see if the expected port is listened to. If the port has changed, also update your modem, firewall or proxy rules.

Keep in mind

Also check the UDP listeners for Geyser and Bedrock, just looking at the Java TCP list may not be enough.

Source and tools