When I want to invite my friends over the internet into my LAN world in Minecraft, I need to set my router to forward the port specified by Minecraft. As Mincraft picks a different port each time I open my world over LAN, I have to edit my router settings every time I want to start a multiplayer LAN session over the internet. Instead, I would like to set the router to the range of port numbers that Minecraft picks from.

What is the range of ports that Minecraft uses for LAN worlds?

So far, after four sessions, I have had ports between 49525 and 50852. I play the Java edition, if that makes any difference.


The port range must be coded into the Minecraft code. What file(s) would I look at to find it?

  • I mostly meet server with port 25565, but I think Minecraft reads ports of the host and finding the "minecraft" one – ishidex2 Dec 20 '19 at 18:43

I looked around and there doesn't seem to be an exact known range for the ports. I also noticed that different users usually have ports opened in different ranges (some report that their open port is always somewhere between 20000-25000, while you have it much higher).

You could open ports in a big range just to be sure, or, you could run a Minecraft server on your computer in which you can specify your own custom port which will always be used.

  • 1
    "You could open ports in a big range just to be sure"<-really bad advice. Ports are closed for a reason. – Fabian Röling Jul 27 '18 at 21:34
  • Yeah, a lot of open ports are obviously not a good thing, but if he has to open a range of ports anyway (temporarily of course, while the LAN server is running), then it won't matter that much of a difference. If he doesn't want to do that, then he should just run a server. – Marked as Duplicate Jul 29 '18 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy