So you've spent two hours setting up your Minecraft server, you send the IP to your friend, and they immediately message back: "it's not working." You try connecting yourself from another device and you see this:
java.net.ConnectException: Connection refused: no further information
Fantastic. Nothing like a vague Java exception to ruin your Saturday afternoon. I've helped probably a dozen people debug Minecraft server connection issues over the years, and honestly the fix is almost always one of three things — firewall blocking the port, the server binding to the wrong IP, or port forwarding being set up wrong on the router. Let's go through each one.
Why This Actually Happens
Minecraft's default server port is 25565. When a client tries to connect, it's essentially knocking on that door. A "Connection refused" error means the knock never got answered — either something blocked it along the way, or nobody's home on that port at all.
The server might be running fine locally (you can connect via localhost just fine), but the moment someone tries from outside your network, it dies. That's almost always a firewall or port forwarding problem. If even you can't connect locally, then the server itself isn't binding correctly — different problem, different fix.
Fix 1: Open the Port in Your Firewall
This is the one people skip because they assume their firewall is fine. It's usually not. On Windows, the built-in firewall will silently block incoming connections without telling you anything useful.
Open PowerShell as Administrator and run this:
netsh advfirewall firewall add rule name="Minecraft Server" dir=in action=allow protocol=TCP localport=25565
On Linux (Ubuntu/Debian with UFW), it's even simpler:
sudo ufw allow 25565/tcp
sudo ufw reload
After that, check your firewall status to confirm:
sudo ufw status verbose
You should see port 25565 listed as allowed. If you're running a third-party antivirus with its own firewall (looking at you, older versions of McAfee), you'll need to add an exception there too. I've wasted a solid hour before realizing the OS firewall was fine but the AV was the actual culprit.
Fix 2: Check What IP Your Server Is Binding To
Open your server.properties file — it's in the root of your server directory. Look for this line:
server-ip=
Here's the thing though — if that field is set to something like 127.0.0.1, your server is only listening on localhost. Nobody from outside can reach it. Leave that field completely blank and let the server bind to all available interfaces:
server-ip=
server-port=25565
Save the file and restart your server. In my experience, this is a super common mistake when people copy server configs from tutorials that were written for local-only testing setups. The blank value tells Java to bind to 0.0.0.0, which means it'll accept connections on any network interface.
You can verify the server is actually listening on the right port by running this while the server is up:
# Windows (PowerShell)
netstat -ano | findstr :25565
# Linux/macOS
ss -tlnp | grep 25565
If you see 0.0.0.0:25565 in the output, you're good. If you see 127.0.0.1:25565, go fix that server-ip field.
Fix 3: Set Up Port Forwarding on Your Router
This is the big one for people hosting at home. Your router is a gatekeeper — incoming traffic on port 25565 from the internet has no idea which device on your local network to go to unless you tell the router explicitly.
The steps vary by router brand, but the general process is:
- Log into your router admin panel (usually
192.168.1.1or192.168.0.1in your browser) - Find the "Port Forwarding" section — sometimes buried under "Advanced" or "NAT"
- Create a new rule: external port
25565, internal IP = your server machine's local IP, internal port25565, protocol TCP
To find your server machine's local IP on Windows, run:
ipconfig
Look for the IPv4 address on your active adapter — something like 192.168.1.105. Use that as the internal IP in your port forwarding rule.
One thing I always tell people: set a static local IP for the server machine, or the DHCP lease will eventually change and your port forwarding rule will point at the wrong device. You can usually do this in your router's DHCP reservation settings — just bind the MAC address of the server machine to a fixed IP.
After setting up port forwarding, test from outside your network. Don't test from the same network — most home routers don't support hairpin NAT, so connecting to your own public IP from inside your LAN won't work the way you'd expect. Use your phone on mobile data or a site like YouGetSignal's port checker to confirm port 25565 is actually open.
Fallback: Try a Different Server Port
If you've done all of the above and you're still hitting Minecraft server connection errors — some ISPs actually block inbound traffic on port 25565. Yeah, it's annoying. The workaround is to run your server on a different port, like 25566 or even something in the 19000-20000 range, and forward that instead.
In server.properties:
server-port=25566
Players would then connect using yourip:25566 instead of just the IP. Not ideal, but it works. Remember to update your firewall rules and router forwarding to match the new port.
Also — if you're on a VPS or cloud server (AWS, DigitalOcean, etc.), don't forget those platforms have their own security groups or firewall rules at the infrastructure level. Opening the port on the OS firewall isn't enough if the cloud provider's inbound rules are still blocking it. Add a TCP rule for port 25565 in your cloud dashboard too.
Hope this saves you a few hours of hair-pulling. Nine times out of ten it's one of these three things, and once you know where to look it's actually a pretty quick fix.
Related: How to Fix "Failed to Connect to Server" in Minecraft (Actually Works in 2025)
๋๊ธ
๋๊ธ ์ฐ๊ธฐ