How to Connect to a LAN World in Minecraft 1.21.5 Using a Port

Minecraft's LAN feature lets players on the same local network jump into each other's worlds without setting up a dedicated server. In version 1.21.5, the process works the same core way it always has — but knowing how ports factor in makes the difference between a smooth session and an hour of frustration.

What "LAN World" Actually Means in Minecraft

When you open a world to LAN in Minecraft, your game essentially becomes a mini-server. It broadcasts your world to other devices connected to the same local network (your home Wi-Fi or wired network). Other players running Minecraft on that same network can then see and join your world directly from the multiplayer menu.

No external server software is needed. No Minecraft Realms subscription. Just two or more devices on the same network.

What Port Does Minecraft Use for LAN Worlds?

This is where a lot of players get confused. When you open a world to LAN, Minecraft automatically assigns a random port — usually somewhere in the range of 49152 to 65535. That port number is displayed in your chat log the moment you open the world.

You'll see a message like:

Local game hosted on port 54321

That number is your LAN port for that session. It changes every time you open a new LAN world, so there's no single fixed port to memorize.

In version 1.21.5, this behavior remains consistent with recent versions. There's no dedicated "LAN port" setting baked into the base game's world-opening screen, but the port is always shown in chat.

How to Connect to a LAN World Step by Step

On the Host Device (the person sharing the world)

  1. Load your singleplayer world.
  2. Press Esc to open the pause menu.
  3. Click Open to LAN.
  4. Choose your game mode and whether cheats are allowed.
  5. Click Start LAN World.
  6. Note the port number shown in the chat.

On the Joining Device

  1. Open Minecraft 1.21.5 and go to Multiplayer.
  2. The LAN world should appear automatically in the server list under "Local Network."
  3. If it doesn't appear automatically, click Direct Connection.
  4. Enter the host's local IP address followed by a colon and the port number — for example: 192.168.1.5:54321

🔍 The host's local IP address can be found by:

  • Windows: Running ipconfig in Command Prompt and looking for the IPv4 address
  • Mac: Going to System Settings → Network → Wi-Fi → Details
  • Linux: Running ip addr in the terminal

Why the LAN World Might Not Show Up Automatically

Automatic detection uses UDP broadcast, which works cleanly on most home networks but can fail in certain setups. Common culprits include:

IssueWhat's Happening
Different Wi-Fi bandsHost on 5GHz, joiner on 2.4GHz (or vice versa)
Wired vs. wireless mixNetwork broadcast doesn't always cross these cleanly
Firewall blocking MinecraftWindows Defender or third-party software blocking the port
VPN active on either deviceVPN creates a separate virtual network, isolating the broadcast
Router AP isolationSome routers block device-to-device communication on Wi-Fi

If automatic discovery fails, Direct Connection with the IP and port almost always resolves it — provided both devices are genuinely on the same network.

Firewall Considerations for Port Access 🛡️

On Windows in particular, Minecraft may prompt you to allow network access the first time. If you dismissed that prompt or if access is blocked:

  • Go to Windows Defender Firewall → Allow an app through firewall
  • Make sure Minecraft (or the Java runtime, if playing Java Edition) has both Private and Public checked
  • You can also create a manual inbound rule for the specific port shown in chat, though this needs to be updated each session if the port changes

On macOS, you may need to allow incoming connections through System Settings → Privacy & Security → Firewall.

Java Edition vs. Bedrock Edition: LAN Behavior Differs

The process described above applies to Java Edition. Bedrock Edition handles LAN differently:

  • Bedrock LAN worlds are discovered automatically and don't typically require manual port entry
  • Bedrock uses port 19132 by default for local network play
  • Cross-platform LAN between Java and Bedrock is not natively supported without third-party tools

If you're mixing editions on the same network, that's a meaningful variable — they won't see each other's LAN worlds.

What Changes Between Sessions

Because LAN worlds assign a random port each time, a few things shift per session:

  • The port number in Direct Connection needs to be updated each time the host opens the world
  • Firewall rules set for a specific port number may not carry over
  • If the host's device gets a new local IP address (DHCP reassignment), the Direct Connection address also changes

Some players address the IP issue by setting a static local IP for the host device in their router settings — this keeps the IP consistent even if the router reassigns addresses overnight.

The Variables That Determine Your Experience

Whether LAN play in Minecraft 1.21.5 "just works" or requires troubleshooting depends on factors specific to your setup:

  • Your router model and configuration (AP isolation, band steering, firewall rules)
  • Which edition of Minecraft everyone is running
  • Operating system and firewall settings on both the host and joining devices
  • Whether anyone is on a VPN
  • Network topology — a mesh network or enterprise-style router behaves differently than a basic home router

Two players on the same simple home network with the same edition will likely connect in under a minute. Players with more complex network setups, mixed editions, or strict firewall configurations will hit more variables to work through.