guide · static export
Gaming

Run a Minecraft Server on Windows for Friends

A vanilla server for a handful of friends takes fifteen minutes and a spare PC. The parts people get wrong are the memory flag, the port and the whitelist.

by@guidox updated:10/31/26 time:40 min level:Intermediate tested on:Windows 11 24H2, Java 21 works on:Windows 10, Windows 11 tools:Java 21, Server jar
TL;DR

Install a **Java 21 runtime**, put the server jar in its **own folder**, start it with a **fixed heap** and decide early whether friends connect through a **forwarded port** or a **mesh VPN**.

Before you start

Requirements

  • A spare PC or a machine that stays on
  • Java 21
  • The official server jar
Step by step

Instructions

01

Install a current Java runtime

The Java edition server needs a JDK 21 runtime. An old Java 8 install is the reason a fresh jar refuses to start with a version error, and the message does not always say so plainly. Install Temurin 21 and confirm what the terminal reports.

java -version
02

Give the server its own folder

Unpack the jar into an empty folder such as C:\inecraft. The server writes the world, the configuration and the logs into the directory it starts in, so a desktop full of screenshots is the wrong place for it.

C:\inecraft\erver.jar
⚠ warningNever run it from a network share or a synced OneDrive folder. Both lock files while the world is being written and the save ends up damaged.
03

Accept the EULA after the first start

Run the jar once. It stops immediately and writes eula.txt; open that file, change false to true and start again. Nothing else appears in the folder until the EULA is accepted, which is what confuses a first attempt.

java -jar server.jar nogui
eula.txt -> eula=true
04

Start it with a memory limit

A start script with a fixed heap is easier to reason about than a bare command. Four gigabytes cover about ten players on a vanilla world; more RAM does not fix a slow CPU or an oversized view distance.

java -Xms4G -Xmx4G -jar server.jar nogui
pause
tipLeave the operating system at least 4 GB. A 16 GB machine that hands 12 GB to Java starts swapping and the ticks per second collapse.
05

Decide how friends reach it

Either forward TCP 25565 to that machine and accept that your home address is now public, or put both sides on a mesh VPN such as Tailscale and skip forwarding entirely. The VPN is safer and adds a few milliseconds.

Router > Port Forwarding > 25565 TCP -> <lan-ip>
⚠ warningAn open Minecraft port is scanned within hours. Turn the whitelist on before the first friend joins, not after the first stranger does.
06

Set the rules in server.properties

Turn the whitelist on, drop view-distance to 10 and simulation-distance to 8, and keep online-mode true so account names are verified. Whitelist entries are added while the server runs, without a restart.

white-list=true
view-distance=10
whitelist add <name>
Troubleshooting

Common issues

Friends get connection refused

The server is not running, the port is closed, or the Windows firewall blocks Java. Test from another machine in the same LAN first, then from outside.

It works locally but not from outside

The forward points at an old address, or the router cannot loop your own public address back from inside. Test through a phone hotspot instead.

Tick rate drops with three players

View distance and simulation distance are the usual cause, followed by a CPU that is already busy. Lower both before you add RAM.

The world will not load after a crash

A partial save. Restore the newest folder from the backups directory the server keeps next to the world, then start again.

FAQ

Frequently asked

Java or Bedrock?

The Java server runs mods, plugins and the classic jar. Bedrock connects consoles and phones, and the two do not share a world.

Will an old laptop do?

Vanilla with two players, yes. Add mods and the CPU becomes the limit long before the memory does.

How to undo this

Send the **stop** command in the server console, then delete the folder. Remove the port forward in the router and the whitelist entry. Keep the world folder if the map matters.

Changelog · 1 entry
  1. 2026-10-31
    First version
Interactive version: checklist, feedback, related guides →

Free · no account needed · tracks your progress