Quick answer
Minecraft Java Edition uses TCP port 25565. When friends outside your home can't join, the cause is almost always one of these: the port isn't forwarded (or points at the wrong PC), the firewall is blocking Java, your internet provider uses CGNAT so forwarding can't work, server-ip is filled in in server.properties, friends typed the wrong address, or the game versions don't match.
Ports
25565TCP: Game port (server-portin server.properties)19132UDP: Only if you run Geyser so Bedrock players can join
How to fix it, step by step
- Make sure the server has finished starting. Wait for
Done (x.xxxs)! For help, type "help"in the console. The server won't start at all withouteula=truein eula.txt. - Test in the right order. Join
localhoston the server PC, then the server's LAN IP (for example192.168.1.50) from another device at home, then the public IP from a phone on mobile data. Joining your own public IP from inside your home often fails even when everything works, because many routers don't support hairpin NAT (NAT loopback). - Leave server-ip blank. In server.properties,
server-ip=should be empty. A value there makes the server listen only on that address, which causes "Failed to bind" or "Connection refused". - Forward TCP 25565 to a reserved local IP. Reserve the server PC's local IP in your router (DHCP reservation), then forward TCP 25565 to it. If you changed
server-port, forward that port instead and have friends typeIP:port. - Allow Java through the firewall. Allow java.exe / javaw.exe ("OpenJDK Platform binary") in Windows Firewall on both Private and Public networks.
- Check for CGNAT. Compare the WAN/Internet IP on your router's status page with the IP a "what is my IP" site shows. If they differ, or the WAN IP starts with 100.64 to 100.127, port forwarding can't work. See the CGNAT guide.
- Share the public IP and match versions. Friends join with your public IP (plus
:portif it isn't 25565). Client and server must be on the same Minecraft version. ViaVersion/ViaBackwards (Paper/Spigot only) let other versions join; modded servers need the same loader and mods on both sides.
What the error message means
Connection timed out: no further information: traffic is being dropped. No port forward, a firewall, a wrong address or CGNAT.Connection refused: nothing is listening. The server is off or still loading, the port is wrong,server-ipis set, or the forward points at the wrong PC.java.net.UnknownHostException: the domain doesn't resolve. Check the spelling, the DNS record, and wait for DNS to update. A custom port on a domain needs an SRV record (_minecraft._tcp.<name>).You are not white-listed on this server!: runwhitelist add <name>in the console, or turn the whitelist off.Outdated server!/Outdated client!: versions don't match. Pick the server's version in the launcher, or update the server (back up first).Failed to verify username!/Invalid session: restart the launcher and log out and back in. Behind Velocity/BungeeCord, set the backend server toonline-mode=false.FAILED TO BIND TO PORT(in the server console): another copy of the server is already running, orserver-ipisn't an address on this machine.
Bedrock players on a Java server
Bedrock players can join a Java server through GeyserMC. Forward Geyser's port as UDP (19132 by default). Bedrock players enter the Java server's IP and the Geyser port in the separate port field; Bedrock can't read SRV records. Realms can't do Java and Bedrock crossplay.
Modded servers
Everyone needs the same Minecraft version, the same loader (Fabric, Forge or NeoForge) and the same required mods. Client-only mods (Sodium, Iris, OptiFine, minimaps, shaders) crash the server and must be removed from it.
Test it from the outside
Your own Wi-Fi can't tell you whether friends can reach the server. The free Server Doctor check contacts your server once from the internet, the way the game does, and tells you the most likely cause. The same check runs in Discord with /fix.
No PC to host 24/7?
Your PC has to stay on whenever friends want to play, and behind CGNAT port forwarding can't work at all. A hosted server avoids both: Aternos is free (with queues and auto-stop), and paid Minecraft hosts give you an address that works without touching your router.
Related guides
- Minecraft Bedrock: "Unable to connect to world"
- Palworld friends can't join your dedicated server?
- Valheim server not showing up, or friends can't join?
- Hytale friends can't connect to your server?
- Behind CGNAT? Host a game server without port forwarding.
- All guides
Sources: hythost.com/guides/minecraft-server-port-forwarding · coalstack.net/docs/errors · tarohosting.com/en/blog/minecraft-server-connection-errors-explained · geysermc.org/wiki/geyser/fixing-unable-to-connect-to-world/ · playit.gg/ · minecraft.wiki/w/Tutorial:Setting_up_a_Bedrock_Edition_server