Minecraft

How to Host a Minecraft Java Server on Windows

Run the official Minecraft: Java Edition server on a Windows PC: Java 25, server.jar from minecraft.net, the EULA, server.properties, TCP port 25565, a whitelist, backups, and when renting is easier.

· 11 min read

A Raspberry Pi sitting on a small network switch with ethernet cables plugged in

The official Minecraft: Java Edition server is a free server.jar from Mojang, and it runs fine on an ordinary Windows PC. This guide sets up the plain (vanilla) server for a group of friends: Java, the first run, the EULA, the few settings worth changing, the port, and keeping the world backed up.

Sources are Mojang’s server download page, the Java Edition 26.1 release notes and the community Minecraft Wiki server tutorial. We have not run a Minecraft server on our own home setup, so nothing here is presented as first-hand.

Self-host or rent?

Host it yourself if you have a PC that can stay on while people play. The server software is free, you control every file, and adding a data pack or swapping to a modded server is your call.

Rent a server if you want it online all the time without leaving a PC on, if your ISP will not let you forward a port, or if you want one-click modpacks and backups.

The server cost calculator can work out what a home server costs in electricity. Its RAM presets are for ARK and Palworld, so use the RAM advice below for Minecraft.

The setup in five steps

1Install Java 25Minecraft Java Edition 26.1 and later needs Java 252Download server.jar from minecraft.netPut it in an empty folder such as C:\mcserver3Run it oncejava -Xmx4G -jar server.jar nogui creates eula.txt, then stops4Accept the EULAChange eula=false to eula=true in eula.txt5Run it again, then edit server.propertiesFriends connect on TCP 25565 by default
Setting up the official Minecraft Java Edition server.

Install Java 25

Minecraft: Java Edition 26.1 (released March 24, 2026) and later require Java 25, according to Mojang’s release notes. The game launcher brings its own Java, but the server does not, so install a Java 25 runtime on the server PC. Mojang now ships the Microsoft Build of OpenJDK 25 with the game, and that build or Eclipse Temurin 25 both work.

Check it in Command Prompt:

java -version

It should report version 25 or later. If it shows an older version, or says java is not recognised, reinstall and let the installer add Java to your PATH. Older Minecraft versions need older Java: 1.20.5 to 1.21.x need Java 21.

Download and first run

  1. Create an empty folder, for example C:\mcserver. Everything the server makes, including the world, goes in this folder.
  2. Download the server jar from minecraft.net/download/server, put it in the folder, and rename it to server.jar if it has a version in its name.
  3. Make a start script in the same folder:
@echo off
cd /d C:\mcserver
java -Xms2G -Xmx4G -jar server.jar nogui
pause

-Xmx4G caps the server at 4 GB of RAM. The 4 GB figure is our rule of thumb, not an official Mojang number: it is a reasonable starting point for a few friends on vanilla; raise it for more players, a higher view distance, or a modded server, and keep enough RAM free for Windows. nogui skips the server window’s graphical panel, and pause keeps the window open if it stops so you can read the error.

  1. Double-click start.bat. The first run creates eula.txt and server.properties, then stops.
  2. Open eula.txt and change eula=false to eula=true. This means you agree to the Minecraft EULA. The server will not start until you do.
  3. Run start.bat again. When the console says Done, the server is up. Type stop in that window to shut it down cleanly; it saves the world first.

Settings worth changing

Stop the server, edit server.properties in Notepad, then start it again. A first pass:

motd=Our home server
max-players=10
difficulty=normal
white-list=true
enforce-whitelist=true
online-mode=true
server-port=25565
  • motd is the description in the multiplayer list.
  • max-players is the player cap.
  • difficulty is peaceful, easy, normal or hard.
  • white-list and enforce-whitelist let only people you add join. Turn this on for a home server.
  • online-mode=true checks each player’s Minecraft account. Leave it on.
  • server-port is the port. 25565 is the default.

Then, in the server console, add your friends and make yourself an operator:

whitelist add FriendName
op YourName

Port forwarding and joining

New to port forwarding? Port Forwarding for Game Servers walks through the router rule, Windows Firewall, CGNAT and how to test a UDP port properly.

Java Edition players connect on TCP 25565 by default. Forward that port on your router to the server PC’s LAN address (reserve the address first so it does not change), and allow it in Windows Firewall:

New-NetFirewallRule -DisplayName "Minecraft Java server" -Direction Inbound -Protocol TCP -LocalPort 25565 -Action Allow

Friends open Minecraft, choose Multiplayer, then Add Server, and enter your public IP. Port 25565 is the default, so they do not have to type it; if you changed server-port, they enter YOUR-PUBLIC-IP:PORT. On the same network, use the server PC’s LAN IP.

If you cannot forward a port at all, read How to Port-Forward a Game Server Through a VPN and Hosting a Game Server Behind CGNAT. A VPN with port forwarding is one way around CGNAT:

Before you hand out your IP, read How to Let Friends Join Your Home Server Safely. A whitelist is the single most useful setting for a small private server.

Updates and backups

Updating: stop the server, download the new server.jar from Mojang, replace the old one, and start again. Players need the same Minecraft version as the server. Back up first, because a world opened on a newer version may not open on an older one again.

Backups: the world is the world folder next to server.jar (or whatever level-name says in server.properties). Stop the server, or run save-off and save-all in the console first, then copy the folder to another drive or a cloud folder, then save-on. Keep several dated copies. The routine is the same as in the backup and restore guide.

Common problems

UnsupportedClassVersionError when it starts. Your Java is too old for this Minecraft version. Install Java 25 and check java -version again.

The window opens and closes at once. Run start.bat with pause at the end (as above) and read the last lines. Usually it is the EULA or Java.

Friends get “Connection timed out”. Check the server says Done, the forward is TCP 25565 to the right LAN IP, the firewall rule exists, and you gave out your public IP. Test from a phone on mobile data, not your own Wi-Fi.

“You are not white-listed on this server.” Add them with whitelist add Name, spelled exactly as their Minecraft name.

Lag with only a few players. Lower view-distance and simulation-distance in server.properties, and give the server more RAM with -Xmx if Task Manager shows it at its cap.

FAQ

Is the Minecraft server free? Yes. Mojang’s Java and Bedrock server software is a free download from minecraft.net.

Can console players join a Java server? Not directly. Consoles run Bedrock Edition, which uses a different server.

Which port does a Minecraft Java server use? TCP 25565 by default, set by server-port in server.properties.

How much RAM does a Minecraft server need? Mojang does not publish a number. A few GB is enough for a small vanilla group; modpacks and big view distances need much more.


DIY Game Hosting is an unofficial fan site. It is not affiliated with Mojang Studios or Microsoft. Minecraft is a trademark of Mojang Synergies AB.