Fix “Failed to connect to the server” in Minecraft
Minecraft shows a few different messages when it cannot reach a server, and they mean different things. Find yours first, then follow that section. Nothing here needs special tools.
Which error do you have?
| Message | What it usually means |
|---|---|
| Connection refused: no further information | The computer was reached, but nothing is listening on that port. The server is off, still starting, or the port is wrong. |
| Connection timed out: no further information | Your packets are going nowhere. A firewall or router is dropping them, the address is wrong, or the port is not forwarded. |
| Unknown host / Can’t resolve hostname | The name does not exist. Check it for typos, or the DNS record is missing. |
| Failed to connect to the server (nothing else) | A general failure. Look in the launcher log or the server console for the real reason. |
| Outdated client / Outdated server | You reached the server, but the versions differ. That is a version problem, not a network problem. |
| You are not white-listed, You are banned, Failed to verify username, Invalid session | You reached it and it said no. See the last section. |
“Connection refused”
- Is the server actually running? In the server console, wait for the line that says
Done. Joining before that gives refused. - Is the port right? Minecraft Java uses
25565by default. If your server uses another port, add it after a colon, likemyaddress:25570. The port is set asserver-portinserver.properties. - Wrong edition? Bedrock servers use port
19132and a different protocol. A Java client cannot join a Bedrock server, or the other way round. - Another program holds the port. If you started the server twice, the second one fails with a message about the port being in use.
“Connection timed out”
This is the one people hit when hosting from home. Work from the inside out:
- Join from the same computer using
localhost. If that works, the server is fine and the problem is the network. - Join from another computer on the same network using the host’s local address (like
192.168.1.20). If that works, the server accepts outside connections. - Join from outside using your public address. If only this step fails, the cause is your router or your internet provider.
For step 3 you need to forward TCP port 25565 on your router to the host computer’s local address, and that address should not change (give it a fixed address or a DHCP reservation). Then check that the host computer’s own firewall allows Java through.
Port forwarding can be impossible. Many home and mobile connections use carrier-grade NAT, which means you do not have your own public address. A sign of it: the address your router shows as its internet address is different from what a “what is my IP” website shows, or starts with 100.64 to 100.127. In that case forwarding will never work. You need a tunnel service, a rented server, or a host that runs the server for you.
A quick test that does not need Minecraft
From another computer, test whether the port opens:
- macOS or Linux:
nc -vz youraddress 25565 - Windows (PowerShell):
Test-NetConnection youraddress -Port 25565
“Succeeded” means the network path is fine and the problem is inside Minecraft. A timeout means the path is blocked.
“Unknown host”
Check the address for typos, spaces, and a stray http:// (Minecraft wants only the name). If you just bought or changed a domain, wait for DNS to update, which can take from minutes to a few hours.
When the server answers but says no
- You are not white-listed on this server: the owner turned the whitelist on and your name is not on it. Give them your exact Minecraft name.
- Failed to verify username / Invalid session: restart the Minecraft launcher and sign in again. If a server is in offline mode and your client is not (or the other way round), the names will not match.
- Outdated client or server: use the same Minecraft version as the server, which the owner can tell you.
If you would rather not run a server
If the hard part is the network, a hosted server skips it: there is no port forwarding because the server is not at your house. JetRift is a free Minecraft Java host we run: you make a server, send friends the address, and it starts when the first person joins. It is early, Java only, and has no mods. It does not help if you need a modpack.
More guides
“Can’t keep up! Is the server overloaded?” · Move a world to a new host · Free ways to host a server · Whitelist, op and ban players