Connection refused means your game reached the address you typed and was turned away, because nothing there was accepting connections on that port. It is one of the more specific errors Minecraft shows, so it is usually quick to fix. Start by checking the server below: it tells you whether the problem is the server or your side.
What "Connection refused" means
Joining a Java Edition server starts with a TCP connection to its address and port (25565 unless the address says otherwise). If a machine is reachable at that address but no program is listening on that port, its operating system turns the connection away at once. Minecraft shows this as Failed to connect to the server, with the reason underneath:
Connection refused: getsockopt
Connection refused: no further information
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further informationThese are all the same error. Older Java versions end the message with no further information; the newer Java that current Minecraft runs on ends it with getsockopt, which is the name of the system call that reported the refusal. Minecraft 1.16 and older also print the Java class name, io.netty.channel.AbstractChannel$AnnotatedConnectException, in front, and the game's log file always does. On macOS and Linux the wording can differ again, but any message with Connection refused in it means the same thing.
Why Minecraft says connection refused
- The server is not running. It is stopped, has crashed, or is in the middle of a restart. This is the most common cause, and nothing on your side can fix it.
- Wrong port. The server listens on a different port from the one you are using. An address like
play.example.net:25570needs the:25570; without a port, Java Edition uses 25565 unless the domain has an SRV record pointing elsewhere. - An old or wrong address. The IP you have now belongs to a different machine. Home connections get a new public IP from time to time and hosts move servers between machines, so an address that worked last month may not work now.
- A Bedrock address in Java Edition. Bedrock servers use UDP port 19132. Java connects over TCP, and a Bedrock-only server has nothing listening for TCP there, so the connection is usually refused.
- Using localhost from another computer.
localhostand127.0.0.1always mean "this computer", so they only work on the machine that runs the server. - The server listens on one address only. When
server-ipis set in server.properties, the server accepts connections to that address and refuses them on the machine's other addresses. - A firewall set to reject. Most firewalls silently drop blocked connections, which gives a timeout instead, but some are set to reject them, which looks exactly like a refusal.
Fixes when you are joining someone else's server
Check the server first
Enter the address in the check at the top of this page. If we are refused too, the problem is on the server's side: wait a few minutes, or let its owner know. Many servers post restarts and outages on their Discord.
Copy the address again, port included
Take it from the server's website, Discord or listing rather than typing it. Keep anything after a colon:
play.example.netandplay.example.net:25570can be two different servers.Update the saved server
An entry in your server list keeps whatever address it was saved with. Select it, choose Edit, and paste the current address.
Flush your DNS
If the server moved to a new IP, your computer may still be using the old one. On Windows, run
ipconfig /flushdnsin Command Prompt, then restart Minecraft.Rule out VPNs and security software
A VPN, proxy or security suite sits between the game and the internet. Turn it off briefly and try again, to rule it out.
Check the edition
This message comes from Java Edition. If the server is Bedrock only, join it from Bedrock with its port: see how to join a server on Bedrock.
Fixes when it is your server
Make sure it has finished starting
Watch the console. A Java server is ready once it prints a line like
Done (12.345s)! For help, type "help". If it stopped instead, the end oflogs/latest.logsays why.Check which port it listens on
Early in the console output the server prints
Starting Minecraft server on *:25565. That number is the port players need, set byserver-portin server.properties. A*means it listens on every address.Leave server-ip empty
If that line shows an IP instead of
*,server-ipis set, and the server refuses connections to any other address. Leave it blank unless you know you need it, then restart.Test locally, then from outside
On the server computer, join with
localhost. If that works, put your public IP or domain into the check above, which connects from outside your network like your players do. Working locally but refused from outside means the router or a firewall is in the way.Check the port forward
For a server at home, the router rule must point at the server computer's current local IP, on the port it listens on, with protocol TCP. A rule pointing at an old local IP sends players to a device with no server on it. See how to port forward a Minecraft server.
Use the address your host gives you
On a rented server, copy the IP and port from the host's control panel. Hosts often run several servers on one IP with different ports, so the port is part of the address.
Hosting through e4mc or a tunnel service? The address belongs to the relay, so work through the e4mc troubleshooting list or the tunnel and private network fixes. For every other error message, see Minecraft can't connect to server.
Connection refused questions
What does "Connection refused: getsockopt" mean in Minecraft?
Your game reached the address, but nothing there accepted a connection on that port, so it was turned away. Usually the server is offline, restarting or on a different port. getsockopt is only the name of the system call that reported the error, not the cause.
What does "no further information" mean?
Nothing extra. Older Java versions add "no further information" when the system gives no more detail than "Connection refused". Newer Java prints "getsockopt" in the same place. The error and its fixes are identical.
Is connection refused my fault or the server's?
Usually the server's: it is offline or not listening on that port. Check it with the checker at the top of this page. If it answers there, the problem is the address or port you are using, or something on your side of the connection.
How do I fix io.netty.channel.AbstractChannel$AnnotatedConnectException?
That is the Java class name of the connection error, printed in front of the message on Minecraft 1.16 and older and in the game log. The words after it are what matter: "Connection refused" is covered on this page, and "Connection timed out" in our connection timed out guide.
Why can I join my own server but my friends get connection refused?
You are probably joining with localhost or a local IP, which never leaves your computer or home network. Friends connect to your public IP, so the router has to forward the port to your server computer. Check your public IP with the checker above, then follow the port forwarding guide.
Does connection refused mean I am banned?
No. A banned player can still connect, and is then disconnected with a message such as "You are banned from this server". A refusal happens before the game and the server exchange any Minecraft data.
Will reinstalling Minecraft or Java fix connection refused?
No. The refusal comes from the machine at the other end, before the game sends it anything. A different Java version only changes the wording of the message, from "no further information" to "getsockopt".