So there I was, trying to set up a LAN world for my nephew on a Saturday afternoon, and Minecraft just refused to see the other computer. No error message, no explanation — just nothing. After about 20 minutes of head-scratching, I realized Windows Firewall was silently blocking the connection. Classic. If you're hitting a wall (pun intended) trying to connect to a Minecraft server or a LAN world, there's a solid chance your firewall is the culprit.
The "can't connect to server" problem in Minecraft usually shows up looking something like this:
io.netty.channel.AbstractChannel$AnnotatedConnectException:
Connection refused: no further information: <server-ip>:25565
Or for LAN worlds, you just see an empty list where other worlds should appear. No drama, no error — just a blank screen mocking you.
Why Does This Actually Happen?
Here's the thing — Windows Firewall, and even third-party antivirus software like Avast or Norton, will sometimes block Java or the Minecraft executable from making network calls. This happens especially after a Minecraft update, because the new executable is treated as an "unknown" program. The firewall sees a new file it doesn't recognize and just... blocks it. Same deal if you recently switched from Minecraft Java Edition to the Bedrock launcher or vice versa.
Port 25565 is the default Minecraft server port, and if that's not open, nothing's getting through. On LAN games, Minecraft picks a random port dynamically, which makes firewall rules even trickier to get right.
Fix 1: Allow Minecraft Through Windows Firewall (The GUI Way)
This is the first thing to try, and honestly it fixes it 80% of the time. Go to your Windows search bar and type Windows Defender Firewall, then click "Allow an app or feature through Windows Defender Firewall." Hit "Change settings" (you'll need admin rights), then scroll down and look for Java or Minecraft in the list.
If you see it there but the checkboxes for Private and Public aren't both ticked — tick them. If it's not there at all, click "Allow another app," browse to your Minecraft installation folder, and add the executable manually.
For Java Edition, the file you're looking for is usually here:
C:\Program Files\Eclipse Adoptium\jdk-17\bin\javaw.exe
The path can vary depending on which Java version you've got installed, so just dig around in Program Files if that exact path doesn't exist. For Bedrock/Windows 10 Edition, you're looking for the Minecraft app in the Microsoft Store apps list inside the firewall panel.
Fix 2: Open Port 25565 Using PowerShell
If the GUI method didn't cut it — or you're the type who just prefers getting things done in a terminal — you can manually open the Minecraft port using PowerShell. Run it as Administrator and paste these two commands:
New-NetFirewallRule -DisplayName "Minecraft Server Inbound" -Direction Inbound -Protocol TCP -LocalPort 25565 -Action Allow
New-NetFirewallRule -DisplayName "Minecraft Server Outbound" -Direction Outbound -Protocol TCP -LocalPort 25565 -Action Allow
That opens port 25565 for both incoming and outgoing TCP traffic. If you're running a local server and people are connecting over UDP too (some mods and plugins use it), just duplicate the commands and swap TCP for UDP.
To double-check the rules actually got created, run:
Get-NetFirewallRule -DisplayName "Minecraft*"
You should see both rules listed with "Enabled: True". If not, something went sideways and you may need to check your admin privileges.
Fix 3: Temporarily Disable the Firewall to Test (Don't Skip This Step)
I know, I know — this sounds reckless. But hear me out. If you're not sure whether it's actually the firewall causing your Minecraft connection issues, the fastest diagnostic is to temporarily disable it and test. If Minecraft works with the firewall off, you know for certain that's where the block is. If it still doesn't work, you're chasing the wrong problem entirely — could be your router, DNS, or the server itself being down.
To disable Windows Firewall temporarily via command line:
netsh advfirewall set allprofiles state off
Try connecting to your Minecraft server or LAN world. If it works, turn the firewall back on immediately:
netsh advfirewall set allprofiles state on
Then go apply Fix 1 or Fix 2 properly. Don't leave your firewall off — that's just asking for trouble.
(Side note: if you've got a third-party antivirus with its own firewall built in — looking at you, McAfee — you'll need to check that software's settings separately. Windows Firewall and your antivirus firewall are different things, and both can block Minecraft independently.)
Fallback Tip: Check Your Router's Port Forwarding
If none of the above fixes work and you're trying to connect to a server hosted outside your local network, the issue might not be your PC's firewall at all — it might be your router. For people hosting a Minecraft server at home and sharing it with friends online, you need to forward port 25565 through your router to your local machine's IP address.
Every router interface is a little different, but the general path is something like Advanced Settings → Port Forwarding → Add Rule. Set the external and internal port to 25565, protocol TCP, and point it at your PC's local IP (find that with ipconfig in Command Prompt — look for IPv4 Address).
ipconfig
Your friends will connect using your public IP, which you can find at a site like whatismyip.com. This is a whole separate rabbit hole, but worth knowing if you're running your own Minecraft server and the firewall stuff checked out fine.
In my experience, the Windows Firewall blocking javaw.exe after an update is the single most common reason people suddenly can't connect — even when they could connect just fine the day before. Hope this saves you the Saturday afternoon I lost to it.
Related: How to Fix "Failed to Connect to Server" in Minecraft (2024)
๋๊ธ
๋๊ธ ์ฐ๊ธฐ