Which port Minecraft uses
| Edition | Default port | Protocol |
|---|---|---|
| Java Edition | 25565 | TCP |
| Bedrock Edition | 19132 | UDP |
server-port in server.properties, forward that number instead.Port forwarding, step by step
Find your PC's local IP and your router's address
On Windows, open a terminal and run
ipconfig: the IPv4 Address is your PC (something like 192.168.1.20) and the Default Gateway is your router.Keep that local IP fixed
In the router, reserve that address for your PC (often called DHCP reservation or static lease). Otherwise the rule breaks the day your PC gets a different address.
Open the router's settings
Type the gateway address into your browser and log in. The default username and password are often on a sticker on the router.
Add the forwarding rule
Look for Port Forwarding, Virtual Server or NAT. Forward port 25565 over TCP (or 19132 over UDP for Bedrock) to your PC's local IP, and save.
Let the server through the firewall
The first time the server starts, Windows asks whether Java can use the network: allow it. If you dismissed that prompt, add an inbound rule for the port.
Share your public IP
Search “what is my IP” to see it. Friends join with that address; the port is only needed if it isn't 25565.
Test it from outside your network
Test from a phone on mobile data, or ask a friend to join. Many routers don't let you reach your own public IP from inside the house (it's called NAT loopback), so “it doesn't work from my PC” doesn't always mean the forward is wrong. At home, you join with the local IP or localhost.
When it still doesn't work
- CGNAT. Compare the WAN or internet address your router shows with your public IP. If they differ (the router often shows something starting with 100.64 to 100.127), your provider shares one public IP between customers and no forwarding rule can reach you. Ask your provider for a public IP, or use a tunnel.
- Two routers. If your provider's modem is also a router, the forward has to go through both, or the modem has to be put in bridge mode.
- Your public IP changes. Most home connections get a new one now and then. A dynamic DNS name follows it, so friends don't need the new number.
- The server isn't listening. Make sure it has finished starting and that
server-portmatches the port you forwarded.
Ways to skip port forwarding
A tunnel service such as playit.gg relays your players through its own network to the server on your PC: you don't touch the router, and your home IP stays private. It has a free tier, and its premium plans start at $3 a month, according to its site. The other way is not to host at home at all: on a hosted server the port is already open, and you don't need to forward anything.
If you remember one thing
Forward TCP 25565 (or UDP 19132 for Bedrock) to a fixed local IP and test from outside your network. If your provider uses CGNAT, no rule will work: use a tunnel or a hosted server, where there's nothing to open.
Questions people ask
25565 over TCP for Java Edition and 19132 over UDP for Bedrock, unless you changed server-port in server.properties.
The most common reasons are a local IP that changed, the firewall blocking Java, CGNAT on your connection, or two routers in a row.
It exposes only the port you forward, but it shares your home IP with everyone who joins. Keep the server updated and use a whitelist for private servers.
No. A hosted server is already reachable from the internet; you just share the address shown in the panel.
About this article: It comes from what I have learned running EnduranceNodes, and it is published here first. We sell Minecraft hosting, so everything I say about us can be checked on this site, and I point out where we are not the best fit.