Network security

Minecraft Port Forwarding: How to Open Port 25565 Safely in 2026

Forwarding port 25565 lets friends outside your home join your Minecraft server. Here is the full setup for Java and Bedrock, plus the security steps most guides skip.

Cysoro Security TeamPublished · 9 min read
port: 25565protocol: TCPstatus: OPENW NETWORK SECURITY Minecraftport forward Open 25565 — safely.
Quick answer

Minecraft port forwarding means adding a router rule that sends incoming traffic on TCP port 25565 for Java Edition, or UDP port 19132 for Bedrock, to the computer running your server. You also need a fixed local IP for that computer, a firewall rule allowing the port, and a whitelist so only invited players can join.

Key takeaways

  • Java Edition uses TCP port 25565; Bedrock uses UDP port 19132 (and 19133 for IPv6).
  • Give the server computer a fixed local IP before you create the router rule, or the rule will break.
  • An open port is a public invitation — use a whitelist, strong operator controls and a separate server account.

Your Minecraft server works fine on your own computer, but your friends cannot join from their homes. That is almost always port forwarding: your router does not know which computer inside your house should receive the incoming game traffic, so it drops it.

What is Minecraft port forwarding?

Minecraft port forwarding is a rule on your router that sends incoming connections on your server's port to the computer running the server. Without it, players outside your home network cannot reach your world.

Think of your router as a reception desk. Your public IP address is the building's address, and the port number is the room number. Port forwarding tells reception: "Anyone asking for room 25565 goes to the computer in the back room." Without that instruction, visitors are turned away at the door.

A port is a number from 0 to 65535 that says which program a connection is for. Port 443 is HTTPS, and port 25565 is the default for a Minecraft Java server. Your router, your computer's firewall and the Minecraft server all have to agree on that number, or the connection fails.

Port forwarding only matters for players outside your home network. Friends on the same Wi-Fi can join using the server computer's local IP address, with no router change at all. That is the easiest way to test a new server before you open it to the internet.

Which port do I forward for Minecraft?

Forward TCP port 25565 for Java Edition, or UDP port 19132 for Bedrock Edition. Check server-port in server.properties first, because that setting decides the real port.

EditionPortProtocolWhere to check
Java Edition server25565TCPserver-port in server.properties
Bedrock Dedicated Server19132UDPserver-port in server.properties
Bedrock IPv619133UDPserver-portv6 in server.properties
Java RCON (optional)25575TCPOnly if you enable RCON; leave it off unless you need remote console
Java query (optional)25565UDPOnly if you enable query in server.properties

The protocol matters as much as the number. Java uses TCP, Bedrock uses UDP. Forwarding the right number with the wrong protocol is one of the most common mistakes, and it produces the same error as forwarding nothing at all.

Do not forward RCON port 25575 unless you actually use remote console, and never expose it without a strong password. RCON lets someone run server commands from the network, so an open RCON port with a weak password is a real risk. Leave enable-rcon set to false if you are unsure.

If you run a Java server with the Geyser bridge so Bedrock players can join, Geyser needs its own port, usually 19132, forwarded for both TCP and UDP. That port must be different from the Java port, 25565. Mojang's own Java server setup guide shows the same ports and firewall commands.

What do I need before I start?

You need a working Minecraft server, the server computer's local IP address, access to your router settings, and your public IP address. Get the server working locally first.

  1. Install the server. Download the official server software from Minecraft's server download page. The Java server is a free server.jar file; Bedrock uses the free Bedrock Dedicated Server package.
  2. Run it once. Start the server, accept the EULA by changing eula=false to eula=true in eula.txt, then start it again. Join it yourself first with localhost on the server computer.
  3. Find the local IP. On Windows, run ipconfig in Command Prompt and look for the IPv4 address, usually 192.168.1.x or 192.168.0.x. On macOS or Linux, use ifconfig or ip addr.
  4. Find your public IP. Search for your public IP or use our what is my IP tool. This is the address friends outside your home will use.
  5. Check your router access. You need the router admin password. It is often on a sticker on the router, or in your internet provider's app.

If you cannot log in to your router, check whether your provider manages it through an app instead of a web page. Many mesh systems and provider-supplied routers only offer port forwarding in the app, under Advanced, NAT or Firewall settings.

Test locally before you open anythingJoin the server from the server computer with localhost, then from a second device on the same Wi-Fi with the local IP. If either step fails, the problem is the server or the firewall, not port forwarding.

How do I forward port 25565 step by step?

Reserve the server computer's local IP in your router, add a rule forwarding TCP 25565 to that IP, allow the port in your computer's firewall, then test from outside your network.

Forwarding port 25565 in five steps1Fix the IPreserve the local IPin the router DHCP2Add the ruleTCP 25565 to that IPin port forwarding3Open firewallallow Java or the portin Windows Firewall4Start servercheck server-portis still 255655Test outsidea friend on anothernetwork joinsSkip step 1 and the rule breaks the next time the IP changes.
Five steps to forward port 25565 for a Java server. Illustration by Cysoro.

1. Give the server computer a fixed local IP

Routers hand out local IP addresses automatically, and they can change when a device restarts. If the server computer's IP changes, your port forwarding rule points at the wrong device and friends cannot join.

Fix this in the router's DHCP settings, often called Address Reservation or Static Lease. Find the server computer in the list of connected devices, note its MAC address, and reserve its current IP for it. From then on, that computer always gets the same local IP.

2. Add the port forwarding rule

Log in to your router, usually at 192.168.1.1 or 192.168.0.1 in a browser, and open the port forwarding page. It may be called Port Forwarding, Virtual Servers, NAT Forwarding or Port Sharing, depending on the brand.

Create a rule with these fields: service name Minecraft, external port 25565, internal port 25565, protocol TCP, and internal IP address the server computer's reserved local IP. Save the rule. Some routers need a restart before the rule takes effect.

For Bedrock, create the same kind of rule with UDP port 19132 instead. If your router has a single protocol option, choose UDP for Bedrock and TCP for Java. If it offers TCP and UDP together, only use that for Geyser, not for a plain Java server.

3. Allow the port in the computer firewall

Even with the router rule correct, your computer's own firewall can block the connection. On Windows, the first time you start the server you should see a Windows Defender Firewall prompt for Java. Accept it for private and public networks.

If you missed the prompt, add an inbound rule manually. In PowerShell as administrator, run: New-NetFirewallRule -DisplayName "Minecraft Java server" -Direction Inbound -Protocol TCP -LocalPort 25565 -Action Allow. On Ubuntu with ufw, run sudo ufw allow 25565/tcp. For Bedrock, allow UDP 19132 instead.

4. Start the server and test from outside

Start the server and check the console for errors. Then ask a friend on a different internet connection to join using your public IP and port, for example 203.0.113.10:25565. A friend on your own Wi-Fi should use the local IP instead.

You can also test the port with an online port checker, but only while the server is running. A closed result with the server stopped tells you nothing, because there is no program listening on that port.

Is Minecraft port forwarding safe?

Port forwarding is reasonably safe for a small private server with a whitelist, but it does expose one port to the whole internet. Scanners will find it within hours, so harden the server before you open it.

  • Turn on the whitelist. In server.properties, set white-list=true and enforce-whitelist=true, then add only the players you invite with whitelist add PlayerName in the console.
  • Limit operators. Only give op status to people you trust completely. An operator can change the world, ban players and run any server command.
  • Keep the server updated. Run the current server version and update Java when Mojang requires a newer version. Old server versions have known flaws.
  • Do not run as admin. Run the server from a normal user account, not an administrator account, and keep it in its own folder.
  • Back up the world. Copy the world folder regularly. A griefer, a bad plugin or a disk failure can destroy months of building in minutes.
  • Forward only what you need. Forward 25565 for Java or 19132 for Bedrock, and nothing else. Never forward RCON, SSH or remote desktop ports for a game server.

For a public server with strangers, a rented hosted server is safer than a home PC. The host handles DDoS protection, backups and patching, and your home IP address is never exposed. If you do host at home, never share your public IP in public listings or chats beyond the players you invite.

Our guide to securing your Wi-Fi covers the router basics that matter here too, including changing the default admin password and keeping firmware updated.

Why is my Minecraft port forwarding not working?

Work through the chain in order: server, local IP, router rule, firewall, then your internet provider. Most failures are in the first three steps.

  • Server not running or wrong port: check server.properties for server-port=25565 and check the console for errors. Join with localhost on the server computer first.
  • Local IP changed: run ipconfig again and compare it with the IP in your router rule. If it changed, set a DHCP reservation and update the rule.
  • Wrong protocol: Java needs TCP, Bedrock needs UDP. A rule with the wrong protocol will not work.
  • Firewall blocking Java: check Windows Defender Firewall for a Java rule, or add the inbound rule shown above.
  • Two routers (double NAT): if your provider's modem is also a router, you may need to forward the port on both devices, or put one in bridge mode.
  • CGNAT: if your provider uses carrier-grade NAT, your router has no public IP of its own and inbound port forwarding cannot work. Ask your provider for a public IP, or use a hosted server or a VPN.
  • Friends using the wrong address: friends outside your home need your public IP, not the 192.168 address. Players at home need the local IP.
Where is the connection breaking?Can you join with localhost? No: the server is not running or the port is wrongCan a second device on your Wi-Fi join? No: check the firewall and the local IPCan a friend outside join? No: check the router rule and the protocolStill nothing in the server log? Traffic never arrived: check double NAT or CGNATLog shows a rejection? Check the whitelist and the game version
Follow the chain from the server outward to find the fault. Illustration by Cysoro.

Check the server log after a failed join attempt. A connection that reaches the server but is rejected usually shows up in the log with a reason, such as a whitelist rejection or a version mismatch. No log entry at all means the traffic never reached the server, so the problem is the router, firewall or provider.

What are the alternatives to port forwarding?

If port forwarding does not work on your connection, or you do not want to open a port, you have three good alternatives. Each has a cost or a trade-off.

OptionHow it worksCostBest for
RealmsMojang hosts the world; friends join by inviteFrom $3.99/month for Bedrock RealmsConsole and mobile players, no setup
Rented serverA hosting company runs the server for youUsually a few dollars per monthPublic servers, mods, always online
Virtual LAN / VPNFriends join a private virtual networkFree tools exist; setup neededSmall private groups, CGNAT connections
LAN onlyFriends on the same Wi-Fi join directlyFreeSame-house play, testing

Realms is the simplest option and the only one that works easily on consoles, because a console cannot run a Bedrock Dedicated Server. A rented server is the best choice if you want mods, plugins or a world that stays online when your PC is off. A virtual LAN works well for a small group of friends, but every player needs the same VPN software installed.

For a full checklist of what else to secure at home, see our small business cybersecurity checklist, which covers backups and updates alongside network security.

The bottom line

Minecraft port forwarding is five steps: fix the server computer's local IP, forward TCP 25565 for Java or UDP 19132 for Bedrock, allow the port in the firewall, start the server, and test from outside your network.

Turn on the whitelist before you share your public IP, keep the server updated, and back up your world. If port forwarding will not work on your connection, Realms or a rented server will get your friends playing faster. Check your public IP with the what is my IP tool before you share it.

Frequently asked questions

What port do I forward for Minecraft?

Forward TCP port 25565 for a Minecraft Java Edition server. For a Bedrock Dedicated Server, forward UDP port 19132 for IPv4 and UDP port 19133 for IPv6. Check server-port in server.properties first, because a changed setting means a different port.

Is port forwarding for Minecraft safe?

It is safe enough for a small private server if you take precautions: whitelist only invited players, keep the server software updated, do not run it as an administrator account, and never forward ports you do not need. An open port is visible to internet scanners, so a public server needs more hardening.

Why can my friends not join my Minecraft server?

The most common causes are the wrong port or protocol, the server computer's local IP changing, the Windows Firewall blocking Java, the server not running, or your internet provider using CGNAT, which blocks inbound port forwarding. Test each step in order.

Do I need port forwarding to play Minecraft with friends?

No, not always. Friends on the same Wi-Fi can join over your local network without port forwarding. For friends elsewhere, you need port forwarding, a VPN such as a virtual LAN, or a hosted option such as Realms or a rented server.

What is the difference between Java and Bedrock port forwarding?

Java Edition servers listen on TCP port 25565. Bedrock Dedicated Servers listen on UDP port 19132 for IPv4 and UDP 19133 for IPv6. Java and Bedrock players cannot join each other's servers without a bridge such as Geyser.

Can I port forward Minecraft on a school or work network?

Usually not. School and work networks block port forwarding and inbound connections by design. Do not try to bypass those controls. Host the server on your home network or use a hosted server instead.

What is CGNAT and why does it break port forwarding?

CGNAT, or carrier-grade NAT, means your internet provider shares one public IP address between many customers. Your router does not have its own public IP, so inbound port forwarding rules never reach you. Ask your provider for a public IP or use a hosted server.

How do friends connect once port forwarding works?

They open Minecraft, go to Multiplayer, click Add Server, and enter your public IP address followed by a colon and the port, for example 203.0.113.10:25565. Players on your home network use the server computer's local IP instead.

Sources

  1. Minecraft — Download server for Java Edition
  2. Mojang — How to Setup a Minecraft Java Edition Server
  3. GeyserMC — Frequently asked questions
  4. Minecraft — Realms
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against Mojang's official server download and setup pages, the Geyser FAQ for Bedrock cross-play ports, and Mojang's Realms page for subscription prices.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free