How to Play Minecraft Online With a Friend on the Same Wi-Fi Network: A PC Guide

Playing cooperatively in a cube world with a friend who is in the next room or even in another house but connected to the same wireless network is one of the most popular use cases. MinecraftHowever, despite the apparent simplicity of the "Open to Network" feature, users often encounter the second player simply not seeing the created world in the list of available servers. This is a common problem, which is most often rooted not in the game itself, but in the security settings of the Windows operating system or the settings of your router.

For a successful connection, it is critical that both computers are on the same subnet and have the correct firewall settings. If your laptop is connected to Wi-Fi 2.4 GHz, and a desktop PC - via cable or at a frequency 5 GHz, they may still not "see" each other without the correct network profile configuration. In this article, we'll explore all the technical nuances that transform chaotic connection attempts into a stable gaming experience.

First, make sure both players are running the same version of the game, as cross-version compatibility is limited on a local network using Java Edition. It's also worth checking that your antivirus software isn't blocking incoming connections for the process. javaw.exeOften, it is aggressive security settings that block ports necessary for data exchange between devices on the local network segment.

Checking Windows network settings

The first step to successful gaming is to properly configure the network profile in the Windows operating system. By default, when connecting to a new Wi-Fi When connecting to a public network, the system may assign it the "Public Network" status, which hides your computer from other devices and blocks incoming connections. You need to change this setting to "Private Network" to allow discovery.

To do this, go to the Start menu and select "Settings," then open "Network & Internet." In the list of active connections, find your current Wi-Fi connection and click it. In the window that opens, under "Network Profile," toggle the radio button from "Public" to "Private." This will tell the system that you're in a trusted environment, such as your home.

After changing your profile, you need to enable discovery. Open Control Panel and go to Network and Sharing Center. On the left, select Change advanced sharing settings. Under Private (current profile), make sure Turn on network discovery and Turn on file and printer sharing are enabled.

⚠️ Warning: If after changing the settings, the network profile resets back to "Public" every time you reboot, it is possible that your antivirus or your organization's group policies (on work PCs) are forcibly changing this setting for security purposes.

It's also important to ensure that both computers are in the same workgroup, although this is less necessary in modern versions of Windows 10 and 11. The default workgroup name is usually WORKGROUPYou can check this by opening the system properties by right-clicking on the "This PC" icon and selecting "Advanced system settings."

📊 What is your default network status?
Private
Public
I don't know/I haven't checked
I use a mobile hotspot

Setting up a firewall and antivirus

Windows Firewall is a powerful security tool, but it often becomes a major obstacle to local gaming. If rules block ports used by Minecraft, the connection simply won't take place. The game uses a specific range of ports (by default 25565 for the server and random high ports for the client) that must be open for incoming connections.

To add an exception, type "Firewall" into Windows Search and select "Windows Defender Firewall." Click the "Allow an app or feature through Windows Firewall" link. Click "Change settings" (requires administrator rights), then "Allow another app."

In the window that opens, click "Browse" and locate the game's executable file. For Java Edition, this is usually javaw.exe, which may be located in the folder C:\Program Files\Java\jre...\bin or in the launcher installation folder. Make sure the "Private" and "Public" networks are checked next to the added app.

☑️ Firewall Check

Completed: 0 / 4

If you're using a third-party antivirus (e.g., Kaspersky, ESET, Avast), its built-in firewall may override the system firewall. In this case, Windows settings may be ignored. You should open your antivirus interface, find the "Network" or "Firewall" section, and add Minecraft to the list of trusted applications or temporarily disable network protection to test.

Why is my antivirus blocking the game?

Modern antivirus programs use heuristic analysis. Because Minecraft allows data transfer and opens ports, it can be mistakenly classified as potentially dangerous software attempting to create a backdoor. Adding exceptions to the list solves this problem.

Host Instructions: Creating a World

The player who will be creating the world (the host) must complete a series of in-game steps to launch a local server. After loading the game and selecting a profile (e.g., Forge, Fabric, or Vanilla), go to the "Singleplayer" menu and create a new world or select an existing one.

Before entering a world, click the "More World Options" button. Make sure "Allow Cheats" is set to "ON" if you plan to use commands, although this isn't critical for the network itself. The key is to press the "Enable Cheats" key after loading the world. Esc to exit to the pause menu.

In the pause menu, select the "Open to LAN" button. In the window that appears, you can configure the game mode for guests and enable cheats. After clicking "Open World," a message with the port number will appear in the chat, for example: "Local server running on port 54321"This number is critically important.

Parameter Default value Description
Server port Random (eg 25565 or higher) Specified in the chat message when opened
Protocol TCP/UDP Used for data transmission
IP address Local (192.168.xx) Required for direct connection
Version Active version of the game Must match for all players

Write down or remember the five-digit port number that appears in the chat. The second player will need it to connect directly if automatic detection fails. The host should also know their local IP address, which will be discussed in the next section.

Connecting a second player

A second player on the same Wi-Fi network must launch the same game version. Select "Multiplayer" in the main menu. The host's server should typically appear in the list of available games within a few seconds. If it doesn't, don't worry—we'll connect manually.

To connect manually, click the "Add" or "Direct Connection" button. In the server address field, enter the host computer's IP address and port, separated by a colon. The format is as follows: 192.168.1.5:25565, where the first part is the host IP, and the second is the port issued by the game.

The host needs to know its local IP address. To do this, press the combination Win + R, enter cmd and press Enter. In the black console window, enter the command ipconfig and find the "Wireless LAN Adapter" section. The line you need is called "IPv4 Address." This is the address (usually starting with 192.168...) need to tell a friend.

After entering the address, click "Done" and select the server from the list to log in. If your firewall and network settings are correct, you'll be in your friend's world. If the connection drops, check to see if your router is blocking AP Isolation, although this is rare on home routers.

Resolving server visibility issues

One of the most common problems is when computers "see" each other in a network environment, but Minecraft doesn't display the server. This is often due to Java using the wrong network interface to create the tunnel. In such cases, manually entering the address, as described above, helps, but if that doesn't help, it's worth checking Windows services.

Make sure the Function Discovery Provider and Function Discovery Resource Publishing services are running. To do this, enter services.msc In the Run menu, find the listed services and make sure their status is Running and the startup type is Automatic.

⚠️ Note: Launcher interfaces (official, TLauncher, CurseForge) may differ. Make sure you check the settings for the specific build you're playing, as Java profiles may differ.

You should also try temporarily disabling your antivirus completely. If the game works after this, the problem lies with its settings. After checking, remember to turn the protection back on and configure exceptions, rather than leaving your PC unprotected.

Another caveat: if you have multiple versions of Java installed, the system may have selected the wrong one for Minecraft. In the launcher, you can manually set the path to the Java executable file in the game version settings to avoid version conflicts. javaw.exe.

Alternative connection methods

If a standard local Wi-Fi network is unstable or requires too complex a setup, there are alternative methods that allow you to play together by emulating a local connection over the internet. Services like Radmin VPN, Hamachi or ZeroTier create a virtual local area network (VPN) in which computers can see each other even if they are physically located in different houses.

These programs are especially useful if your ISP doesn't provide a public IP address or if you want to play with a friend who isn't connected to your Wi-Fi. The principle is simple: both players install the program, create a room, and connect to it. Then, connecting to Minecraft works just like on a local network, but uses the virtual IP address provided by the program.

Using such solutions is often more stable than port forwarding on a router and safer, as it doesn't require opening ports for the entire internet. However, it's important to keep in mind that traffic passes through intermediary servers, which can add a slight delay (ping).

How do I forward ports on my router for online gaming?

To play over the internet (not over Wi-Fi in your apartment), you'll need port forwarding. Go to your router settings (usually 192.168.0.1) and find the Port Forwarding / Virtual Servers section. Create a rule: port 25565, protocol TCP/UDP, IP address—your PC's local address. However, for playing on Wi-Fi alone, this is excessive and even unnecessarily dangerous.

Why does the game crash when connecting?

Crashes are often related to low RAM or mod conflicts. If you use mods, make sure their versions and Forge/Fabric versions are identical for all players. Also, try allocating more RAM in the launcher settings.

Is it possible to play on a phone and PC on the same Wi-Fi?

Yes, but only if you're running Minecraft Bedrock Edition (from the Microsoft Store) on your PC, not the Java Edition. Java and Bedrock versions are not directly compatible. Cross-platform play on PC requires the Bedrock version.