Nov 18, 2026
A Java Minecraft server uses TCP port 25565 and a Bedrock server uses UDP port 19132. Port forwarding is a rule in your router that sends incoming connections on that port to the computer running the server. Without it, friends outside your home cannot connect, even if everything works for you.
Which ports Minecraft uses
- Java Edition. TCP 25565 by default.
- Bedrock Edition. UDP 19132 by default, and 19133 for IPv6.
- Java server with Geyser. TCP 25565 for Java players and UDP 19132 for Bedrock players.
You can change the port with server-port in server.properties for Java, or in server.properties of Bedrock Dedicated Server. With a non-default Java port, players add it after the address with a colon, such as play.example.com:25570.
Before you start
- The server is running and you can join it yourself with
localhost. If not, follow how to host a Minecraft server on your PC first. - You know the local IP address of the PC. On Windows, type
ipconfigin Command Prompt and read IPv4 Address. On macOS, open the network settings. On Linux, useip addr. - You can log in to your router. The address and password are often printed on a sticker on the router.
Port forwarding step by step
- Reserve the local IP. In the router, find DHCP settings and reserve the current IP for your PC. Otherwise the PC can get a different address after a restart and the rule stops working.
- Open the port forwarding page. Routers call it Port Forwarding, Virtual Server, NAT or Applications. It is often under Advanced settings.
- Add a rule for Java. External port 25565, internal port 25565, protocol TCP, target the local IP of your PC.
- Add a rule for Bedrock if needed. Port 19132 with protocol UDP.
- Save and restart the router if it asks.
- Allow Java in the firewall. On Windows, allow Java through Windows Defender Firewall when it asks, or create an inbound rule for the port.
- Find your public IP. Search for what is my IP, or read it in the router status page. Give this address to your friends.
How to test it
Ask a friend outside your home to join, or test it yourself on a phone with Wi-Fi turned off, using mobile data. You can also enter your public IP on our server status page. If it shows the server as online with your description, the port is open.
Joining your own public IP from inside your home may fail on some routers even when everything is correct. Always test from outside.
When port forwarding does not work
- CGNAT. Many internet providers, especially mobile and some fibre providers, share one public IP among many customers. If the WAN address in your router differs from the public IP you see on the web, you are behind CGNAT and port forwarding cannot work. Ask your provider for a public IP address, or use a tunnel.
- Double NAT. A provider modem and your own router both act as routers. Forward the port on both, or set the modem to bridge mode.
- Wrong local IP. The PC got a new address. Check it again and fix the rule, then reserve the IP.
- Firewall or antivirus. Allow Java, or the Bedrock server program, through it.
- Wrong protocol. Java needs TCP, Bedrock needs UDP.
Alternatives to port forwarding
A tunnelling service such as playit.gg gives your server a public address without opening any port, and it also works behind CGNAT. Your home IP stays hidden, which is a bonus for public servers.
The other option is a hosted server, which has a public address from the first minute and keeps running when your PC is off. Our guide how to choose Minecraft server hosting explains what to look for.
Using a domain instead of an IP
A domain is easier to remember and survives IP changes. Point an A record, such as play.yourdomain.com, to your public IP. To hide a non-default Java port, add an SRV record named _minecraft._tcp that points to the port, and players can join without typing it. Bedrock does not support SRV records, so Bedrock players always enter the port.
Stay safe
- Forward only the ports Minecraft needs. Never forward the RCON port 25575 to the internet.
- Keep
online-mode=trueand use a whitelist for private servers. - Keep the server software updated.
- Give operator rights only to people you trust.
Frequently asked questions
Is port forwarding safe?
Opening one port for a Minecraft server is reasonably safe if the server is up to date and runs in online mode. The main downside is that your home IP becomes known to everyone who joins. A tunnel avoids that.
Why can I join but my friends cannot?
You join through localhost or your local network, which does not need the router rule. Friends come from the internet, so the rule, the firewall and the public IP all have to be right.
Do I need port forwarding for LAN games?
No. Players on the same network join with the local IP address or through Open to LAN, without any router settings.
Which port do I forward for Bedrock?
UDP 19132, or the port set in your Bedrock server's settings.
When the server is reachable from outside, add it to MineList so new players can find it.