Minecraft Server Port Forwarding: Open Port 25565 on Any Router

Open port 25565 on your router so friends can join your Minecraft server. Works on any router, plus fixes for closed ports, double NAT, CGNAT, and a no-port-forwarding option.

Updated
12 minutes
Beginner
Contains affiliate links

What port forwarding does

Your router gives your whole home one public IP address. When a friend types that address into Minecraft, the connection arrives at the router, and the router has no idea which of your devices it is for, so it drops it. A port forwarding rule fixes that: it tells the router that anything arriving on port 25565 belongs to the computer running your server.

Minecraft Java Edition listens on TCP port 25565 by default. That is the only port you need to forward. Players on your own Wi-Fi never need it, they connect directly with the server's local address. The rule matters only for people outside your network.

The whole job takes about ten minutes. If it does not work on the first try, the troubleshooting section covers the five reasons it usually fails, and if your internet provider makes it impossible, the tunnel and VPN options work without any router access at all.

Before you start

  • A working server. Finish Step 7 of the setup tutorial first and confirm you can join it yourself with localhost.
  • The router's admin password. It is usually printed on a label on the router itself.
  • Access to the router that connects directly to the internet. If you have a separate modem and router, or a mesh system, see double NAT below.

Step 1: Give the server a static local IP

A forwarding rule points at one local address, such as 192.168.1.100. Routers hand out addresses automatically and can give your computer a different one after a reboot, which silently breaks the rule. Fix the address first so the rule stays valid.

The setup tutorial has the full per-OS steps in Step 4: Static IP Address. The alternative, often easier, is a DHCP reservation on the router: find your computer in the router's device list and tick "reserve" or "always use this IP". The result is the same and it needs no changes on the computer.

Step 2: Find your router's address

The router's admin page lives at its local address, called the default gateway. Find it on the server machine:

Open Command Prompt and run ipconfig

ipconfig

Look under your active adapter for Default Gateway. That is the router. Also note IPv4 Address: that is the server's local IP for the rule.

Common gateway addresses are 192.168.1.1, 192.168.0.1, 10.0.0.1, and 192.168.1.254. Type the address into a browser exactly as it appears, for example http://192.168.1.1.

Step 3: Log in to the router

Enter the admin username and password. If you never changed them, they are on the router's label. If the label password does not work, whoever set up the router changed it. Most routers have a reset button that restores the label password, but that also wipes the Wi-Fi name and password, so treat it as a last resort.

Some providers, and mesh systems like Eero and Google Wifi, use a phone app instead of a web page. The rule is the same, it is just found under the app's advanced or network settings.

Step 4: Create the port forwarding rule

Every router names the page differently. Look for one of these, usually under Advanced, NAT, Security, or Gaming:

  • Port Forwarding (Netgear, many ISP routers)
  • Virtual Server or NAT Forwarding (TP-Link, ASUS, D-Link)
  • Applications & Gaming (Linksys)
  • Port Mapping (Huawei, some fibre routers)

Add a new rule with these values. The field names vary, the values do not:

FieldValue
Name or descriptionMinecraft
ProtocolTCP (choosing "Both" or "TCP/UDP" is fine)
External or WAN port25565
Internal or LAN port25565
Internal IP or deviceThe server's static local IP from Step 1
EnabledYes

If the form asks for a port range, put 25565 in both the start and end boxes. Save or apply the rule. Some routers restart to apply it, which takes a minute.

Do not use DMZ

Routers offer a "DMZ" option that forwards every port to one device. It works, but it exposes every service on that computer to the internet. Forward the single port instead.

Step 5: Allow the port through the firewall

The router now sends connections to your computer, and the computer's own firewall can still refuse them. On Windows, the first time the server starts you normally get a prompt to allow "OpenJDK Platform binary" on private and public networks. Allow both. If you dismissed it, or on macOS and Linux, follow Step 6 of the setup tutorial, which has the exact clicks and the ufw command.

Step 6: Test the port

Start the server and wait for the console to print Done. The port only shows as open while something is listening on it, so a test with the server stopped always fails.

Then open a port checker such as canyouseeme.org or yougetsignal.com, enter 25565, and check. These sites connect from the internet, which is the only test that proves the rule works. Your own phone on Wi-Fi is not an outside test; switch it to mobile data first if you want to try joining from it.

A public server status page such as mcsrvstat.us goes one step further and shows the server's name and player count, which confirms Minecraft itself is answering, not just the port.

Step 7: Share your address

Players outside your network connect with your public IP, which you can find by searching "what is my IP". Give them that address. If you changed server-port in server.properties, they add it after a colon, for example 203.0.113.10:25566.

Most home connections get a public IP that changes every so often, which means the address you shared stops working without warning. A free dynamic DNS service such as Duck DNS or No-IP gives you a hostname like myserver.duckdns.org that follows your IP. Many routers can update it for you under a "DDNS" setting.

Port still closed? The five usual causes

1. The server was not running during the test

A closed port and a port with nothing listening look identical from outside. Start the server, wait for "Done", then test again.

2. The rule points at the wrong local IP

Run ipconfig or hostname -I again and compare with the rule. If they differ, the computer's address changed, which is what Step 1 prevents.

3. The computer's firewall is blocking Java

Temporarily turn the firewall off and test. If the port opens, turn it back on and add the rule from Step 5 properly.

4. Double NAT: two routers in a row

If your provider's modem is also a router and you plugged your own router into it, the connection passes through two routers and each one drops it. Tell-tale sign: the WAN or internet address shown in your router's status page starts with 192.168, 10., or 172.16 to 172.31. Fix it by putting the modem into bridge mode, or by creating the same forwarding rule on the modem too, pointed at your router's WAN address.

5. CGNAT: your provider shares one public IP between customers

Common on mobile broadband, satellite, and some fibre providers. Tell-tale sign: the WAN address on your router starts with 100.64 through 100.127, or it differs from what "what is my IP" shows. No forwarding rule can work through CGNAT. Some providers will give you a real public IP if you ask, sometimes for a small fee. Otherwise use a tunnel, below.

Skip port forwarding: tunnels and VPNs

Two approaches work with no router access at all. Both add a little latency, and both are the normal answer for dorms, shared houses, mobile internet, and CGNAT.

Tunnel: playit.gg

playit.gg runs a small program on the server machine that opens an outbound connection to their network and gives you a public address such as something.playit.gg. Players use that address like any other. It supports Minecraft Java Edition on the free tier, and there is a Paper plugin that does the same job from inside the server. Generic HTTP tunnels such as ngrok's free tier or Cloudflare Tunnel do not carry Minecraft traffic, so stick to a tunnel that lists Minecraft support.

Mesh VPN: ZeroTier, Tailscale, Radmin, Hamachi

A mesh VPN makes every player's computer behave as if it were on your home network. You and each player install the same app and join one network, then they connect to the server's VPN address as if it were a LAN game. It is private by design, since only people in the network can even see the server, and it is the best fit for a small friends-only server. The cost is that every player has to install and run the app.

Hosting

A rented server has a public address from the start and needs none of this. It is the right answer for a server that should stay online when your computer is off.

Keeping an open port safe

  • Keep online-mode=true so only real Minecraft accounts can join.
  • Turn on the whitelist (white-list=true) and add players with whitelist add name. Automated scanners find open 25565 ports within hours.
  • Update the server jar when a new version fixes exploits. Paper releases security fixes quickly.
  • Forward only 25565. Leave RCON (25575) and the query port closed unless you know you need them.
  • Share your public IP with people you trust. It identifies your home connection.

Frequently asked questions

Is Minecraft port 25565 TCP or UDP?

Java Edition uses TCP on port 25565. Forwarding TCP only is enough. Choosing "Both" or "TCP/UDP" on the router does no harm. Bedrock Edition is different: it uses UDP on port 19132.

Is port forwarding a Minecraft server safe?

Reasonably, if the server is kept updated, online-mode stays true, and you use a whitelist. Forward only port 25565 and never put the server machine in the router's DMZ. Anyone who learns your public IP can see that a Minecraft server is there, so share it with people you trust.

Why does the port checker say the port is closed?

Nine times out of ten the server was not running during the test, the rule points at the wrong internal IP, or the firewall on the server machine is blocking Java. If all three are fine, you are probably behind double NAT or CGNAT.

Can I use a port other than 25565?

Yes. Set server-port in server.properties to any free port, forward that port instead, and players connect with your-ip:port. Some hosts change the port to avoid automated scans.

What if I cannot access the router, for example in a dorm or on mobile internet?

Use a tunnel such as playit.gg or a mesh VPN such as ZeroTier or Tailscale. Both work without touching any router settings.

Do my friends need to port forward too?

No. Only the machine running the server needs a forwarded port. Players connect outward, which every router allows.