Fix the error by checking the server address first, then the port, then the firewall. For Minecraft Java Edition, the default server port is 25565, while Bedrock commonly uses 19132 for IPv4 [source: Minecraft Wiki]. If one digit is wrong, Minecraft will sit there for a few seconds, then throw a vague connection error like it had no idea what happened.

TLDR: Most “Minecraft server failed to connect” errors come from a bad address, a closed port, or security software blocking Java. Try an address like play.example.net:25565, confirm the server is online, then test the port from outside your network. In a typical home server setup, expect about 80% of connection problems to be fixed by correcting port forwarding, firewall rules, or the exact IP format. If friends can’t join but you can, the issue is usually router or firewall related.

1. Confirm the Server Address Is Correct

Start with the boring part. It is also the part people get wrong the most. Minecraft needs the exact server address. That can be a domain, a public IP address, or a local IP address.

If the server uses the default Java port, you often do not need to type the port. If it uses a custom port, you must add it after a colon. For example, play.example.net:25580.

Honestly, it feels like Minecraft should explain this better. A missing colon or one extra space can waste ten minutes. Make sure there are no hidden spaces before or after the address, especially if you copied it from Discord or a website.

2. Check Whether the Server Is Actually Online

Before changing router settings, confirm the server is running. If you host it yourself, look at the server console. You should see a message like Done after startup. If it is still loading, frozen, or crashed, players cannot connect.

Also check the Minecraft version. A 1.20.4 client may not connect to a 1.21 server unless the server supports multiple versions through plugins. Modded servers are even stricter. If the server uses Fabric, Forge, NeoForge, or a custom modpack, every player usually needs the same loader and matching mod versions.

Ask one simple question: Can anyone connect?

3. Verify the Port Settings

For Java Edition, open your server folder and find server.properties. Look for this line:

server-port=25565

If you changed it, players must use the new port in the address. For example:

yourpublicip:25570

Do not set the port to something random without checking if another app is using it. Also avoid changing the port just because the server will not connect. That can make the problem harder to find.

For Bedrock Edition, check the Bedrock server properties file. Common defaults include:

If you host both Java and Bedrock servers on the same machine, keep their ports separate. Two services cannot use the same port on the same IP at the same time.

4. Fix Router Port Forwarding

If friends outside your house cannot join, port forwarding is the big suspect. Your router must send outside traffic to the computer running the Minecraft server.

In your router settings, create a port forwarding rule:

The catch is that your server computer’s local IP can change after a restart. If that happens, the router may forward traffic to the wrong device. Set a DHCP reservation in your router so the server always keeps the same local IP.

5. Allow Minecraft Through the Firewall

Firewalls block unknown traffic by design. That is good for safety. It is annoying when it blocks your own server.

On Windows, open Windows Security, then go to Firewall & network protection. Choose Allow an app through firewall. Make sure Java Platform SE Binary is allowed on private networks. If you host for friends, you may also need to allow it on public networks, but only if you understand the risk [source: Microsoft].

You can also add a manual inbound rule:

  1. Open Windows Defender Firewall with Advanced Security.
  2. Click Inbound Rules.
  3. Choose New Rule.
  4. Select Port.
  5. Enter 25565, or your custom server port.
  6. Allow the connection.
  7. Apply it to the needed network types.

If you use antivirus software with its own firewall, check that too. Some suites ignore Windows firewall rules and block Java anyway. Yes, it is irritating. You fix one firewall, then another one quietly says “no.”

6. Test From the Right Network

Testing from inside your own house can mislead you. Some routers do not support connecting to your public IP from the same network. This is called NAT loopback. If it is not supported, your server may look broken even when it works for everyone else.

Try these tests:

Quick Checklist

When Minecraft says it failed to connect, do not change five things at once. Test one layer at a time: address, server status, port, router, firewall, then version. That keeps the fix simple and saves you from chasing a problem you accidentally created.