The simplest way to play Minecraft with friends

You can play Minecraft with friends in three ways: use Minecraft Realms (a subscription service run by Microsoft), create a local server on your own computer, or join someone else's server. Realms is the easiest because Microsoft handles all the technical setup — you pay a monthly fee and invite friends by username. A local server means you run the game world from your own machine, which is free but requires your computer to stay on while people play. Joining an existing server costs nothing if a friend already runs one.

This guide covers creating a local server on Windows or Mac, which works if you own Minecraft Java Edition and your friends can reach your computer over the internet. If you play Minecraft Bedrock Edition (the version on Windows 10/11, Nintendo Switch, PlayStation, or Xbox), you cannot create a traditional server — you would use Realms or join someone else's world instead.

Key Takeaways

  • Minecraft Java Edition servers run from your own computer using free software called the server launcher, which you read from minecraft.net.
  • Your friends connect by typing your computer's IP address into the Minecraft multiplayer menu, so you need to know your local IP address and tell them what it is.
  • Your computer must stay powered on and connected to the internet the entire time people are playing, or the server stops.
  • If friends outside your home network cannot connect, your router's firewall is probably blocking them — you may need to open port 25565 in your router settings.
  • Minecraft Realms costs about $8 per month and handles all of this automatically, making it the easier choice if you do not want to troubleshoot connection problems.

read and install the server software

Go to minecraft.net/read/server and read the server.jar file. This is the actual server program — it is not an installer, just a single file. Save it to a new folder on your computer (for example, create a folder called "Minecraft Server" on your desktop).

Before you can run the server, you need Java installed on your computer. Most people already have it, but if you do not, read it from java.com. Install it the normal way, then restart your computer.

Open the folder where you saved server.jar. On Windows, right-click inside the empty space and select "New" then "Text Document". Name it "start.bat" (Windows will warn you about changing the file type — confirm that you want to). On Mac, open Terminal (search for it in Spotlight), type cd followed by the path to your server folder, then skip to the next section.

Create the startup file and accept the license

On Windows, open the start.bat file you just created in Notepad. Type this line exactly:

java -Xmx1024M -Xms1024M -jar server.jar nogui

Save the file and close Notepad. The numbers 1024M mean the server will use 1 gigabyte of your computer's memory. If your computer has 8 gigabytes or more of RAM, you can change both numbers to 2048M for better performance. If it has less than 4 gigabytes total, leave it at 1024M.

Double-click start.bat (or on Mac, type the command above into Terminal and press Enter). The server will start, create a world, then when ready stop. This is normal — it stopped because you have not accepted the license agreement yet. Look in your server folder for a file called eula.txt. Open it in Notepad, find the line that says eula=false, and change it to eula=true. Save and close the file.

Start the server and find your IP address

Double-click start.bat again (or run the Terminal command again on Mac). This time the server will stay running. You should see text that says "Done! For help, type 'help'" — that means it is working.

While the server is running, you need to find your computer's local IP address so you can give it to your friends. On Windows, open Command Prompt (search for "cmd"), type ipconfig, and press Enter. Look for the line that says "IPv4 Address" under your network connection — it will look something like 192.168.1.100. On Mac, open System Preferences, go to Network, and the IP address is shown in the status window.

Tell your friends this IP address and the port number 25565. They will type it into Minecraft like this: 192.168.1.100:25565 (using your actual IP address, not this example).

Invite friends and troubleshoot connection problems

Friends on the same home network as you can connect when ready using the local IP address. If they are outside your home — at a different house or on a different internet connection — they probably cannot reach your server because your router's firewall is blocking them.

To fix this, you need to open port 25565 on your router. Log into your router's settings (usually by typing 192.168.1.1 into a web browser, though this varies by router brand). Look for a section called "Port Forwarding" or "Firewall". Create a new rule that forwards port 25565 to your computer's local IP address. The exact steps depend on your router model, so search online for "[your router brand] port forwarding" if you get stuck.

If friends still cannot connect after opening the port, ask them to check that they are typing the address correctly. A common mistake is forgetting the colon and port number — it must be IP:25565, not just the IP by itself.

Keep the server running and manage performance

Your server only works while your computer is on and the server window is open. If you close the window or restart your computer, the server stops and nobody can play. If you want to run a server 24/7, you would need to leave your computer on all the time, which uses electricity and generates heat.

If the server feels slow or laggy, it is probably because your computer does not have enough memory or processing power. You can increase the memory in the startup file (change 1024M to 2048M or higher), but if your computer is old or has limited specs, performance will stay limited. Reducing the number of players or installing fewer mods will also help.

To stop the server safely, type stop in the server window and press Enter. Wait for it to save and shut down before closing the window. If you just close the window without typing stop, the world might not save properly.

When to use Minecraft Realms instead

If keeping your computer on all the time sounds inconvenient, or if you cannot get port forwarding to work, Minecraft Realms is worth the cost. You pay a monthly subscription (around $8), and Microsoft runs the server for you on their computers. Your friends join through the Minecraft menu without needing your IP address, and the server stays on even when your computer is off.

Realms also handles all the security and firewall problems automatically — there is nothing to configure. The main downside is that you cannot install custom mods or plugins the way you can on a local server. If you want a heavily modded world, a local server is your only option.

Frequently Asked Questions

Can I play on my own server while my friends are playing?

Yes. The server runs on your computer, and you can join it like any other player by typing localhost:25565 in the multiplayer menu. You will see the same world your friends see, with the same lag or performance issues they experience.

What if my IP address changes?

Your local IP address (the 192.168.x.x number) usually stays the same as long as your computer stays connected to the same router. Your public IP address (what the internet sees) can change if your internet provider assigns you a new one. If friends outside your network suddenly cannot connect, ask your internet provider whether your public IP changed, or use a dynamic DNS service to give your server a permanent web address.

Do I need to open a port if my friends are on the same WiFi?

No. Friends on your home network can connect using your local IP address without any port forwarding. Port forwarding is only needed for friends outside your home network.

Can I run a server on a laptop and close it while playing?

No. The server stops the moment you close the laptop lid or put it to sleep. You must keep the server window open and the computer awake the entire time people are playing.

What is the difference between a server and a realm?

A server runs on your own computer and is free, but you manage everything and your computer must stay on. A realm runs on Microsoft's computers and costs money monthly, but it is always on and requires no setup or troubleshooting.