Setting Up a Minecraft Server — The Free Routes That Actually Work
LAN, self-hosted or Realms? Here's the honest comparison, the RAM you actually need, and the port-forwarding step people get wrong.
The short answer
For a small group the simplest free option is opening a world to LAN over a VPN-style service, which requires no port forwarding and no router access. Self-hosting a dedicated server gives better performance and persistent uptime but requires port forwarding TCP 25565 and a machine left running. Allocate 1 GB of RAM per two to three concurrent players plus 1 GB for the server itself — over-allocating causes longer garbage collection pauses, not better performance.
Verified and last updated August 12, 2026.
- Time needed
- 45 min
- Difficulty
- Intermediate
- Read time
- 5 min
Most Minecraft server guides skip the only decision that matters: which route you should be using at all. Self-hosting a dedicated server for three friends who play once a fortnight is a lot of work for no benefit.
RAM is not a dial you turn up
Allocating 16 GB to a six-player server makes it worse. Java's garbage collector has to sweep the whole heap, and a larger heap means longer pauses — which you experience as periodic freezes. 1 GB for the server plus 1 GB per two to three players is the working rule.
Step 1: Pick the right route
The virtual-network route is underrated. It creates a software LAN across the internet, so Minecraft's built-in "Open to LAN" works with friends anywhere and your router is never touched. For a casual group it is the right answer far more often than the guides suggest.
Step 2: Set up a self-hosted server
If you want persistence and mods, this is the route.
Get the server jar into its own folder 5 min
Download the official server jar and put it in an empty folder. It generates a dozen files on first run and you do not want those mixed into your Downloads folder.
Run it once, then accept the EULA 2 min
The first run fails deliberately and creates eula.txt. Open it, change eula=false to eula=true, save. This step confuses a surprising number of people because the failure looks like an error.
Configure server.properties 10 min
The settings that actually matter: view-distance (8 is plenty for a server — this is the single biggest performance lever), simulation-distance (6 to 8), max-players, online-mode=true unless you have a specific reason, and difficulty.
Create a start script 5 min
A batch or shell file with your Java command and RAM flags, so you are not retyping it. Include the garbage collection flags below.
Step 3: Allocate RAM correctly
Use these flags in your start command — they tune the garbage collector for short, predictable pauses rather than long ones:
-XX:+UseG1GC -XX:MaxGCPauseMillis=50 -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:G1HeapRegionSize=32M
Set -Xmx and -Xms to the same value from the table. Matching them prevents the heap resizing mid-session, which is itself a source of lag spikes.
Step 4: Port forwarding without breaking anything
Only needed for a public self-hosted server.
Give the host machine a static local IP 5 min
Reserve it by MAC address in the router's DHCP settings. If the host's IP changes after a reboot, your forwarding rule now points at nothing and you will spend an hour confused.
Forward TCP 25565 to that IP 5 min
TCP only for Java. Bedrock uses UDP 19132 instead. Forward exactly one port — do not put the machine in the DMZ, which exposes everything on it.
Allow Java through the firewall on both profiles 3 min
Windows Defender Firewall, find the Java entry, tick both Private and Public. This is the highest-hit-rate fix for "the server is running but nobody can connect", and it is the same failure that breaks LAN worlds.
Port forwarding exposes your home IP
Anyone who connects sees your IP address. For a server of friends this is usually fine, but do not advertise a home-hosted server publicly. Use a whitelist (white-list=true in server.properties, then /whitelist add name) so only invited players can join.
When it runs badly
Server lag and client lag are different problems with different fixes. If the server is stuttering for everyone simultaneously, reduce view-distance first — the cost is quadratic and dropping from 12 to 8 is a large saving. If only one player is stuttering, that is client-side and belongs in Minecraft FPS and lag fixes.
What works
What doesn't
Key takeaways
Frequently asked questions
How much RAM does a Minecraft server need?
Roughly 1 GB for the server plus 1 GB per two to three concurrent players, so a six-player vanilla server is comfortable on 3 to 4 GB. Heavily modded servers need considerably more, often 6 to 8 GB. Critically, allocating far more than needed makes performance worse, not better, because the Java garbage collector has a larger heap to sweep and pauses get longer and more noticeable as lag spikes.
Do I have to port forward?
Only if you self-host and want people outside your network to connect. Playing over LAN with everyone in the same house needs no forwarding at all, and VPN-style services create a virtual LAN so remote friends can join without touching your router. Port forwarding is only necessary for a genuinely public self-hosted server, and it does carry a real security consideration.
Why can my friends not connect to my LAN world?
The most common cause is Windows Firewall blocking Java, and specifically that it is allowed on Private networks but not Public — if your network profile is set to Public, connections are refused. Check the firewall entry for Java and tick both boxes. The second most common cause is the two machines being on different networks, such as one on 2.4 GHz guest Wi-Fi and one on the main network.
Is Realms worth paying for?
For a group that plays irregularly and does not want an always-on machine, yes — it removes every technical problem in this article and keeps the world available when the host is offline. The trade-offs are a player cap, limited mod support on Java, and no filesystem access to your world. For a technically confident host running a modded server, self-hosting is far more flexible and free.
Can Bedrock and Java players play together on my server?
Not natively. A Java server accepts Java clients and a Bedrock server accepts Bedrock clients. Cross-play requires a proxy plugin layer that translates between the two protocols, which works well but adds a maintenance burden and occasionally breaks after version updates. If your group is split across editions, decide which edition the server runs and have everyone use that.
About the author
PC Hardware & Performance Editor
Marcus has been building, breaking and repairing gaming PCs since 2011, first as a weekend favour for friends and then for eight years as a bench technician at an independent repair shop in Portland, where roughly a third of the job was diagnosing machines that "ran fine yesterday".
Found something wrong? Games patch and fixes go stale. If a step here no longer works, tell us at hello@spyld.com and we will retest it. Read how we test and our editorial policy.