Open Your World to LAN and Share the Port Number

To let other players on your local network join your Minecraft world in version 1.21.5, you pause the game, select Open to LAN, choose your game mode, and note the port number that appears on screen. That port number — usually something like 25565 or a five-digit number starting with a different digit — is what other players type into their server address field to connect. The process takes about 30 seconds and requires no external software or account setup beyond Minecraft itself.

The port is temporary. It only works while your world is open and you are in it. If you close Minecraft or switch to a different world, the port closes and other players disconnect. This is different from a permanent server — it is a direct connection from your computer to theirs over your home network.

Key Takeaways

  • Open to LAN is found in the pause menu and generates a temporary port number that other players use to connect.
  • Other players must be on the same WiFi or wired network as your computer for the connection to work.
  • The port number changes every time you open to LAN, so you must share the new number each time.
  • Your firewall may block the connection on first attempt — check your firewall settings if players cannot join.
  • The world stays open only while Minecraft is running and you are in that world; closing either disconnects all players.

Step-by-Step: Opening Your World to LAN

Start Minecraft 1.21.5 and load the world you want to share. Once you are inside the world, press Escape to open the pause menu. Look for the button labeled Open to LAN — it appears in the main pause menu, usually in the lower half of the screen.

Click Open to LAN. A small window appears with two dropdown menus. The first asks for Game Mode — choose Survival, Creative, or Adventure depending on what you want players to do. The second asks whether to allow cheats. Leave it off unless you want other players to use commands like /give or /teleport. Once you have set these, click Start LAN World.

A message appears at the top of your screen showing the port number. It looks like "Local game hosted on port 25565" or similar. Write down or screenshot this number. This is what other players need to connect. The port stays active as long as you remain in that world.

How Other Players Connect Using the Port

Each player who wants to join opens their own Minecraft 1.21.5 client and clicks Multiplayer from the main menu. They then click Add Server. In the Server Address field, they type your computer's local IP address followed by a colon and the port number. For example: 192.168.1.100:25565.

To find your local IP address, open a command prompt or terminal on your computer. On Windows, type ipconfig and look for the line labeled "IPv4 Address" under your active network connection — it usually starts with 192.168 or 10.0. On Mac or Linux, type ifconfig and find the inet address. Share this IP address along with the port number to anyone who wants to join.

Once they enter the address and click Done, they see your world in their server list. They click it and join. If the connection fails, the most common cause is that they typed the IP or port incorrectly, or they are not on the same network as your computer.

Firewall and Network Settings That Block Connections

Windows Defender Firewall and third-party firewalls sometimes block Minecraft from accepting LAN connections on first attempt. If a player tries to join and cannot connect, check your firewall. On Windows, open Windows Defender Firewall from Settings, click Allow an app through firewall, and look for Minecraft in the list. Make sure both the Private and Public checkboxes are checked next to it.

If Minecraft is not in the list, click Allow another app, browse to your Minecraft launcher installation folder, select the Minecraft executable, and add it. After you make this change, close and reopen Minecraft, then try opening to LAN again. The next player who attempts to join should connect without a prompt.

If you use a router with a guest network, make sure all players are on the same network — the main WiFi or the guest WiFi, not split between them. LAN connections do not cross between separate networks on the same router.

What Happens When Players Join and Leave

When another player successfully connects, you see a message in the chat saying they have joined the world. They appear in the world at the spawn point or their last location, and you can see them moving around just as you would on a multiplayer server. They can build, break blocks, and interact with the world based on the game mode you selected when you opened to LAN.

If a player closes Minecraft, loses connection, or their computer goes to sleep, they disconnect from your world. You see a message in chat saying they have left. If you close Minecraft or switch to a different world, all connected players are kicked when ready and the port closes.

There is no way to pause the world while other players are connected — the game continues running in real time for everyone. If you need to step away, tell the other players first so they know the world might be unattended.

Troubleshooting Common Connection Problems

If a player types the correct IP and port but still cannot connect, ask them to check three things: first, that they are on the same WiFi network as your computer (not a different network or a mobile hotspot); second, that they typed the IP address and port with a colon between them and no spaces; third, that your computer is still running Minecraft and you are still in the world.

If the connection worked once but fails the next time you open to LAN, remember that the port number changes each time. You must share the new port number shown in the message at the top of your screen. This is the most common reason players cannot rejoin — they are using yesterday's port number.

If your computer has multiple network adapters (for example, both WiFi and Ethernet), make sure you are using the one connected to your local network. If you switch from WiFi to Ethernet or vice versa, your IP address may change, and you will need to share the new one.

When to Use LAN World Instead of a Dedicated Server

Open to LAN works best for small groups playing together in the same house or office — a few friends on the same WiFi. It requires your computer to stay on and in the world the entire time others are playing. If you want a world that stays online even when you are not playing, or if you want players to join from outside your home network, you need a dedicated server instead, which is a separate setup.

LAN worlds are also good for testing builds with friends before uploading them to a public server, or for playing casually without the complexity of port forwarding or server hosting. The trade-off is simplicity for availability — your world only exists while you are running it.

Frequently Asked Questions

Can players join my LAN world from outside my home network?

No. LAN connections only work on the same local network. If you want players to join from outside your home, you need to set up port forwarding on your router or use a dedicated server. Port forwarding is more complex and exposes your computer to the internet, so most players use a server host instead.

What if I do not see the Open to LAN button in my pause menu?

Make sure you are in a single-player world, not already in a multiplayer world or on a server. The Open to LAN button only appears in single-player worlds. If you are on a server or realm, that server is already handling connections and you cannot open it to LAN.

Do I need to port forward to use Open to LAN?

No. Port forwarding is only needed if you want players to join from outside your home network. LAN works entirely within your local network and does not require any router changes.

Can I change the port number manually?

No. Minecraft assigns the port automatically when you open to LAN. If you want a specific port, you need to set up a dedicated server instead, which gives you full control over the port and other settings.

What happens to my world if someone griefs it while connected?

Griefing is possible in Survival and Creative mode if you allow it. If you want to prevent other players from breaking or placing blocks, set the game mode to Adventure when you open to LAN, or use a dedicated server with permission plugins that let you control who can build where.