How to Set Up a Minecraft Java Server for Friends 2026

Running your own Minecraft Java server on a home PC for friends is one of the most rewarding things you can do in the game. You get a private world you fully control, no monthly hosting fees, and the freedom to add mods, set the rules, and invite exactly who you want.

In this guide, I will walk you through how to set up a Minecraft Java server on a home PC for friends, step by step, the same way I have done it for my own group over the last several years. Everything here uses Mojang’s free official server software, so the only cost is the PC and internet connection you already have.

Here is the quick overview of the whole process:

  1. Check your hardware and internet meet the requirements

  2. Install the correct version of Java

  3. Download the official Minecraft server .jar file

  4. Run it once, then accept the EULA and edit server.properties

  5. Forward port 25565 on your router (or use a VPN alternative)

  6. Share your public IP with friends and have them Direct Connect

If that looks like a lot, do not worry. Each step is short, and I will flag the parts that trip people up based on questions I have seen repeatedly in places like r/admincraft and r/Minecraft.

One important note up front: opening a port on your home router does carry some security considerations. I cover those in the port forwarding section, and I will also show you a VPN-based alternative that avoids opening ports entirely if you would rather play it safe.

What You Need Before You Start?

You do not need a powerhouse machine, but you do need to clear a few baseline requirements. A weak PC will still run a small server for a few friends, while a modded server with a dozen players demands more.

Here is what I recommend based on running both vanilla and modded servers from home:

  • CPU: Any modern quad-core processor. Minecraft server threads are mostly single-core, so clock speed matters more than core count.

  • RAM: 8 GB total system RAM minimum, with 4 GB dedicated to the server for vanilla or 6 to 8 GB for modpacks. Never give the server all your RAM, because your operating system and the game client you play on need memory too.

  • Storage: An SSD makes a real difference for world loading and chunk saves. The server folder itself starts small but grows with your world.

  • Internet connection: A wired Ethernet connection is strongly preferred over Wi-Fi. Aim for at least 10 Mbps upload speed, since upload is what serves data to your friends.

  • Operating system: Windows 10 or 11, macOS, or a Linux distribution all work. The steps below focus on Windows since that is what most of my readers use, but I will note the Linux equivalents where relevant.

  • Minecraft: Java Edition: You and your friends each need a paid copy of Java Edition. Bedrock players cannot join a Java server without a proxy like Geyser, which is beyond this guide.

If you plan to host and play on the same PC, which is absolutely possible, just make sure you have enough RAM for both the server and your client to run at the same time.

How to Set Up a Minecraft Java Server on a Home PC for Friends?

This is the main walkthrough. Follow the five steps in order, and do not skip the EULA step, because the server will shut itself down immediately if you do.

Step 1: Install the Right Version of Java

Minecraft Java Edition server software runs on, well, Java. Modern versions of Minecraft require a recent Java installation, and using the wrong version is one of the most common reasons a server fails to start.

For Minecraft 1.18 and newer, you need Java 17. For Minecraft 1.20.5 and newer, including the current release line, you need Java 21. You can check the Minecraft version you plan to run and match the Java version accordingly.

To check what you already have installed on Windows, open a Command Prompt and type:

java -version

If the version matches what your Minecraft version needs, you can skip ahead. If it does not, download the Java installer from the official Oracle site or, my preference, the free OpenJDK builds from Adoptium. Install it, restart your terminal, and run java -version again to confirm.

Step 2: Download the Minecraft Server JAR File

Next, you need the official server software. Mojang distributes it free of charge through the Minecraft launcher and website.

Here is how I do it:

  1. Create a dedicated folder on your desktop or somewhere easy to find, for example C:MinecraftServer. Keep everything server-related in this one folder.

  2. Open the Minecraft Launcher, go to the Installations tab, and look for the “server download” link, or grab the .jar directly from the official Minecraft.net server download page.

  3. Download the server.jar file (it may be named with the version number, like minecraft_server.1.21.jar) and place it in your server folder.

There are also alternative server software options like Paper and Spigot that perform better and support plugins, but for a first-time setup with friends, the vanilla server.jar is the right starting point. You can always switch later.

Step 3: Configure server.properties and Accept the EULA

This step has two parts, and the order matters. The first time you run the server, it generates its config files and then immediately exits, because you have not accepted the license agreement yet.

Double-click the server.jar, or run it from a terminal with:

java -jar server.jar

You will see a window flash and close, and several new files will appear in your server folder, including eula.txt, server.properties, and a logs folder. This is normal and expected.

Open eula.txt in a text editor. You will see a line that reads eula=false. Change it to:

eula=true

Save and close the file. By doing this you are agreeing to Mojang’s End User License Agreement, which is required to run the server.

Now open server.properties with a text editor. This file controls everything about how your server behaves. The settings I always adjust for a friends-only server are:

  • max-players=20 – lower this to the number of friends you actually expect.

  • motd=Our Private World – the message that shows up in the multiplayer server list.

  • difficulty=normal – set to peaceful, easy, normal, or hard.

  • view-distance=10 – lower to 7 or 8 if your server lags, since this is a big performance lever.

  • white-list=true – turn this on after you have added your friends, so strangers can never join.

  • spawn-protection=16 – the radius around spawn that only operators can edit.

Save the file. Now run the server again with java -jar server.jar. This time it should stay open and you will see the world generating in the console. When it says “Done!”, your server is live on your local network.

Step 4: Set Up Port Forwarding (or a VPN Alternative)

Right now your server only works for people on your same Wi-Fi. For friends outside your home to connect, traffic on the Minecraft port needs to reach your PC through your router. That is what port forwarding does.

Before you forward anything, set a static local IP for the PC running the server. On Windows, go to Settings, Network and Internet, then your connection properties, and assign a manual IP in the same range as your router, for example 192.168.1.50. If your PC’s local IP changes later, your port forwarding rule will silently break, which is one of the top reasons people report “my friends suddenly can’t connect.”

Next, log into your router. The address is usually printed on the router itself, often 192.168.1.1 or 192.168.0.1. Find the section called Port Forwarding, Virtual Server, or NAT, depending on the brand. Create a new rule:

  • Internal IP: your server PC’s static IP (for example 192.168.1.50)

  • Internal port: 25565

  • External port: 25565

  • Protocol: TCP (UDP is optional but useful for some setups)

  • Enabled: yes

Save the rule and restart your router if it asks. The default Minecraft server port is 25565, so if you left server-port=25565 in server.properties, you are set.

Security warning: Port forwarding opens a small hole in your router’s firewall. For a small private server with a whitelist and only trusted friends, the practical risk is low, but it is not zero. Never forward ports you do not need, always enable the whitelist, and consider turning off the rule when no one is playing. If this still makes you uncomfortable, jump down to the VPN alternatives section, where I show you how to skip port forwarding entirely.

Step 5: Connect Your Friends to the Server

Your server is running and your port is open (or you are using a VPN tunnel). Now it is time to actually play together.

First, find your public IP. Open a browser on the server PC and visit a site like whatismyip.com, or search “what is my IP” in any search engine. The address it shows, something like 203.0.113.45, is what your friends will use to connect.

For yourself, on the same PC as the server, open Minecraft Java Edition, go to Multiplayer, click Direct Connect, and enter:

localhost

Using localhost is important. If you use your own public IP from the same machine, many home routers will reject the loopback connection and you will get a “connection refused” error, even though your friends can connect fine.

For your friends, they each open Minecraft Java Edition, go to Multiplayer, click Direct Connect, and enter your public IP address. No port number is needed unless you changed it from the default.

If you turned on the whitelist, the first time a friend tries to join they will be rejected. From the server console, type op YourName to make yourself an operator, then run whitelist add FriendName for each friend. They will now be able to connect.

That is it. You now know how to set up a Minecraft Java server on a home PC for friends. The next few sections cover the extras that make running the server smoother and safer over the long haul.

Creating a Startup Script (.bat File)

Running the server by double-clicking the jar works, but it does not let you control how much RAM the server uses, and it can close instantly if there is an error before you can read the message. A startup script fixes both problems.

In your server folder, create a new text file and name it start.bat. Right-click and choose Edit, then paste the following line, adjusting the memory values to suit your PC:

java -Xmx4096M -Xms2048M -jar server.jar nogui

Here is what those flags do:

  • -Xmx4096M sets the maximum RAM the server can use, here 4 GB.

  • -Xms2048M sets the starting RAM, here 2 GB. Setting these apart lets the JVM resize as needed.

  • nogui skips the graphical server panel and runs in the console window, which uses less memory.

For a vanilla server with a handful of friends, 2 to 4 GB is plenty. For a heavy modpack, start at 6 GB and watch how it performs. Never allocate more RAM than your system has free, or the server and your whole PC will thrash.

Save the file and double-click start.bat to launch the server from now on. On Linux or macOS, the same idea works in a shell script using the same Java flags.

Configuring Your Firewall for Minecraft

Even after port forwarding, the software firewall on the server PC itself can still block incoming connections. Windows Defender Firewall in particular tends to pop up a permission prompt the first time you run the server, and clicking “cancel” silently blocks it.

On Windows, open Windows Security, go to Firewall and network protection, and click Advanced settings. Create a new Inbound Rule, choose Port, select TCP, and enter 25565 as the specific local port. Allow the connection, name it something like “Minecraft Server”, and save it. Repeat for UDP if you want broader compatibility.

On macOS, go to System Settings, Network, then Firewall. Click Options and add an application exception for the Java runtime or your terminal app. On most Linux distributions, use sudo ufw allow 25565/tcp to open the port in the local firewall.

If friends report that the connection times out but your server console shows no errors, this local firewall rule is almost always the culprit.

VPN Alternatives to Port Forwarding

Port forwarding is not your only option, and for a lot of people it should not be the first choice. A VPN tunnel creates a private virtual network between you and your friends, so the server traffic never has to touch the public internet through an open port.

I have used three of these with my own friend group, and each has its strengths:

  • Playit.gg: My current favorite for Minecraft. You run a small tunnel program on the server PC, and it hands you a custom address your friends use to connect. No router changes, no exposed ports, and it works through carrier-grade NAT.

  • ZeroTier: Creates a virtual LAN between all your friends’ computers. Everyone joins the same network ID, then they connect to your server using your ZeroTier IP the same way they would use a local IP. Very reliable once set up.

  • Radmin VPN (formerly Hamachi-style): A simple virtual LAN tool popular in the Minecraft community. Easiest for non-technical friends, but the free tier can be slow under load.

The trade-off is that every friend has to install the VPN client and join your network, which is a small extra step. In return, you never open a port on your router, which removes most of the security concern. For a friends-only server, this is the setup I recommend to anyone who asks me whether port forwarding is safe.

Handling Dynamic IP Addresses with DDNS

Most home internet connections have a dynamic public IP, meaning it can change whenever your modem reboots. That breaks the IP address you gave your friends.

The fix is Dynamic DNS, or DDNS. You sign up for a free DDNS service (DuckDNS, No-IP, and others), pick a hostname like mymcserver.duckdns.org, then run a small client on your PC that keeps that hostname pointed at your current public IP.

Instead of giving friends a raw IP, you give them the hostname, and it keeps working even after your IP changes. If you own a domain name, you can also set an A record pointing at your IP for a cleaner address, plus an SRV record so friends do not have to type the port number.

Troubleshooting Common Server Issues

Almost every setup hits at least one snag. These are the problems I see most often in forum threads and hear from readers, with the fixes that actually work.

The server window closes instantly. This is almost always the EULA. Open eula.txt, set it to eula=true, save, and run again. The other common cause is running a Minecraft version on the wrong Java version, so double-check Step 1.

Friends get “connection refused” or timeout. Check three things in order: your local firewall rule for port 25565, your router port forwarding rule, and your PC’s static local IP. If the IP changed, the port rule now points at the wrong device.

You can connect from localhost but no one else can. The server is running, so the problem is between your router and the internet. Re-verify the port forward, confirm your public IP has not changed, and ask your ISP whether you are behind carrier-grade NAT, which blocks port forwarding entirely. If so, switch to a VPN alternative like Playit.gg.

Server lag with several players. Lower view-distance in server.properties to 7 or 8, make sure you allocated enough RAM in your startup script, and consider switching to Paper server software, which handles large numbers of entities far better than vanilla.

“Failed to verify username” errors. If online-mode=true in server.properties, players must be logged into a legitimate Minecraft account. Set it to false only for offline testing, because it disables authentication and lets anyone join.

FAQs

How to set up a Java Minecraft server for friends?

Install the correct Java version, download the official server.jar from Minecraft.net, run it once, set eula=true in eula.txt, configure server.properties, forward port 25565 on your router, then have friends Direct Connect to your public IP. The whole process takes about 20 minutes once you have Java installed.

How to host Minecraft server from home PC?

Run the server.jar on any home PC with at least 8 GB of RAM and a stable wired internet connection. Use a startup .bat script to control RAM allocation, forward port 25565 through your router to the server PC’s static local IP, and share your public IP with friends so they can Direct Connect.

How to play Minecraft Java with friends on PC?

Once your server is running, open Minecraft Java Edition, click Multiplayer, then Direct Connect. Hosts on the same PC as the server type localhost. Friends on other computers type the host’s public IP address, or a DDNS hostname if you set one up.

Can you host a Minecraft server on the same PC you play on?

Yes. You can run the server and play on the same machine, as long as you have enough RAM for both. Allocate 2 to 4 GB to the server and keep at least 4 GB free for your game client and operating system. Connect to your own server using localhost in the Direct Connect screen.

Is port forwarding safe for a Minecraft server?

For a small private server with a whitelist and only trusted friends, the practical risk is low. The risk is not zero, since any open port can theoretically be scanned. Always enable the whitelist, never forward ports you do not need, and consider a VPN alternative like Playit.gg or ZeroTier if you want to avoid opening ports entirely.

Why can’t my friends join my Minecraft server?

The most common causes are a missing firewall exception for port 25565, a port forwarding rule pointing at the wrong local IP, your public IP having changed, or being behind carrier-grade NAT. Have friends check whether they get connection refused versus a timeout to narrow down the layer causing the block.

Conclusion

You now have everything you need to set up a Minecraft Java server on a home PC for friends: the Java install, the server.jar setup, EULA and server.properties, port forwarding with its security caveats, a VPN alternative for safer play, DDNS for a stable address, and a troubleshooting guide for the snags that trip most people up.

Start with the vanilla server.jar and a small group, then explore Paper, plugins, and modpacks once your world feels solid. The most important next step is simply launching it and inviting your first friend.

Leave a Comment