Minecraft – the port range for Minecraft LAN worlds


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?

Best Answer

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.

Related Topic