Minecraft "Connection Refused" Error: Every Cause and How to Fix It

Minecraft says Connection refused: getsockopt or no further information? Here is what the error means, how it differs from Connection timed out, and the eight causes in order of likelihood.

Updated
9 minutes
Beginner
Contains affiliate links

What the error means

The full message looks like one of these:

io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: getsockopt
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information

Connection refused means your game reached a computer at the address you typed, and that computer actively said no: nothing was listening on that port. The two endings mean the same thing. getsockopt is what current Java prints on Windows, no further information is what older Java printed. Neither adds any detail, so ignore that part.

Because the connection was refused rather than ignored, you know two useful things: the address points at a real machine, and that machine is reachable. The problem is on the machine itself, or in what sits between the router and the server program.

Refused vs timed out: read this before fixing anything

Minecraft has a second, similar message, and it points at different causes. Check which one you have.

MessageWhat happenedLook at
Connection refusedA machine answered and rejected the portServer not running, wrong port, server firewall, rule pointing at the wrong device
Connection timed outNothing answered at allWrong public IP, missing port forwarding rule, router firewall, CGNAT, server offline
Unknown hostThe name could not be looked upTypo in a hostname, or a dynamic DNS name that has not updated

Timed out from outside your network is nearly always port forwarding. The port forwarding guide covers it, including the double NAT and CGNAT cases where forwarding cannot work. The rest of this page is about refused.

The 60-second checklist

  1. Is the server console showing Done? If it is still loading, or has crashed, wait or restart.
  2. On the server machine, join with localhost. If that fails, the server itself is the problem, not the network.
  3. Check server-port in server.properties matches the port you are connecting to. Default is 25565.
  4. On the same Wi-Fi, join with the server's local IP (from ipconfig or hostname -I). If that fails but localhost works, it is the server's firewall.
  5. From outside, test with a port checker. If it says closed, it is forwarding or the firewall.

Each step narrows it down. Where it fails tells you which cause below to read.

The eight causes, most likely first

1. The server is not running, or is still starting

The most common cause by a wide margin. The server refuses connections until it prints Done (x.xxxs)! For help, type "help". A 26.x world coming from 1.21 spends extra time converting on first start. A crashed server also refuses; scroll up in the console for an error, and see the out of memory guide if the error mentions heap space.

2. Wrong port

If server-port was changed, every player must append it: 203.0.113.10:25566. If you use a hosting provider, the port is often not 25565 at all and is shown in the control panel. Check for a typo in the address too; a wrong IP that happens to belong to a real machine gives refused rather than timed out.

3. The server machine's firewall is blocking Java

The classic sign is that localhost works and the local IP does not. Windows Defender shows a prompt for "OpenJDK Platform binary" on first start; if it was dismissed or denied, Java is blocked. Allow it on both private and public networks, or add a rule for TCP 25565. macOS and Linux steps are in Step 6 of the setup tutorial.

4. The forwarding rule points at the wrong device

The router forwarded the connection to a computer that is not running the server, which refused it. This happens when the server machine's local IP changed after a reboot. Give it a static IP or a DHCP reservation and update the rule. Details in the port forwarding guide.

5. server-ip is set in server.properties

server-ip should be empty. If someone put the public IP or a specific address in it, the server binds only to that address and refuses everything else. Clear it and restart.

server.propertiesbash
server-ip=

6. Another program is using port 25565

A second copy of the server, or an old one that never fully closed, holds the port. The new server logs FAILED TO BIND TO PORT and Address already in use and stops. Close the other process, or reboot. On Windows, check Task Manager for extra java processes.

7. Windows marked the network as Public

Windows applies stricter firewall rules on networks marked Public. If the server machine's connection is Public, connections from the LAN are dropped even when the Java rule looks right. Open Settings → Network & internet, click the active connection, and set the network profile to Private.

8. Antivirus, VPN, or a hosting provider's firewall

Third-party antivirus often has its own firewall that ignores Windows rules. A VPN on either end can route traffic where the server is not listening. On a rented VPS, the provider's firewall (Oracle, AWS, Hetzner, and others) blocks 25565 by default until you add a rule in their control panel, separate from ufw on the machine.

Other connection messages and what they mean

MessageMeaning
Outdated server! I'm still on 26.1Connection worked. The client is newer than the server. Update the server or have the player pick the matching version in the launcher.
Outdated client! Please use 26.2Connection worked. The player needs to update the game.
Failed to verify username!Connection worked, login check failed. See the verify username guide.
You are not white-listed on this server!Connection worked. Add the player with whitelist add name.
Internal Exception: java.io.IOExceptionThe connection dropped mid-session. Usually the server crashed or a network blip. Check the server console.
Timed out after joiningThe server stopped responding for 30 seconds while you were in. Server lag or a watchdog crash, not a connection problem.

Rule of thumb

If the message names a Minecraft version, a username, or a whitelist, the network is fine and the fix is in the server settings. If it names a socket, a port, or a timeout, the fix is in the network.

Frequently asked questions

What does "Connection refused: getsockopt" mean in Minecraft?

The client reached a machine at the address you typed, but nothing on that machine accepted the connection on that port. Usually the server is not running, is still starting, or is listening on a different port than the one you used. getsockopt is just the name of the system call that reported it; older Java printed "no further information" instead.

Why can I connect with localhost but my friend gets connection refused?

localhost never leaves your computer, so it skips the router and firewall entirely. Your friend's connection goes through both. Work through port forwarding and the firewall, then test from outside your network with a port checker.

Is connection refused a client problem or a server problem?

Almost always the server side: not running, wrong port, firewall, or forwarding. The client is at fault only when the address is mistyped or a VPN or antivirus on the client blocks Minecraft.

Why does it work on my Wi-Fi but not from outside?

Inside the network you connect to the server's local IP directly. From outside, the router has to forward port 25565 to it. If that rule is missing or points at the wrong device, outside connections are refused or time out.

Does connection refused mean I was banned?

No. A ban produces a specific message, "You are banned from this server", after the connection succeeds. Refused means the connection itself never got through.

Can a version mismatch cause connection refused?

No. A version mismatch connects successfully and then shows "Outdated server" or "Outdated client" with the versions. Refused happens before any Minecraft data is exchanged.