Updated 2026-10-27 · All guides

How to make a Minecraft Java server on Windows, step by step

Running your own server costs nothing, and a normal gaming PC can easily handle a world for a group of friends. This guide does it the manual way, so you understand every file involved. If you'd rather skip the fiddly parts, HostCraft does steps 1 to 6 for you, but it's worth knowing what's going on underneath either way.

You'll need a Windows 10 or 11 PC with at least 8 GB of RAM, about 2 GB of free disk space to start with, and a copy of Minecraft: Java Edition to test with. Bedrock Edition (phones, consoles, the Microsoft Store "Minecraft for Windows") uses a different server, though you can let Bedrock players join a Java server later with Geyser.

1. Install the right version of Java

The Minecraft server is a Java program, and each Minecraft version needs a minimum Java version. Using one that's too old is the most common reason a server refuses to start, with an error mentioning UnsupportedClassVersionError or "class file version".

Minecraft versionJava it needs
1.8 to 1.16.5Java 8 (newer often works for 1.12+)
1.17 and 1.17.1Java 16 or newer
1.18 to 1.20.4Java 17 or newer
1.20.5 to 1.21.xJava 21 or newer
26.1 and newerJava 25 or newer

A free, trustworthy place to get Java is Eclipse Adoptium (Temurin). Pick the version from the table, Windows, x64, and the .msi installer. During setup, turn on "Set JAVA_HOME" and "Add to PATH".

To check it worked, open a new Command Prompt (press Win, type cmd, press Enter) and type java -version. You should see the version you installed. If an older one shows, an earlier Java install is first on your PATH. You can either uninstall it or put the full path to the new java.exe in your start script (step 4).

2. Make a folder for the server

The server creates lots of files next to itself (the world, logs, settings), so give it its own folder, for example C:\MinecraftServer. Avoid putting it inside OneDrive, Dropbox or Google Drive: syncing the world while the server is writing to it can corrupt chunks. Avoid the Desktop too if your Desktop is synced to OneDrive, which is the default on many new PCs.

3. Download the server software

You have a few choices. They're explained in detail in Paper vs Fabric vs Vanilla, but in short:

Whichever you pick, you end up with a .jar file. Put it in your server folder and rename it to server.jar so the next steps match.

4. Write a start script

Double-clicking a jar can start the server without a console and with too little memory, so it's better to use a small script. In the server folder, create a new text file, paste this in, and save it as start.bat (make sure Windows doesn't call it start.bat.txt; turn on View → File name extensions in File Explorer to check):

@echo off
java -Xms2G -Xmx4G -jar server.jar nogui
pause

Paper's documentation also publishes a longer list of tuned startup flags (garbage-collection settings sometimes called "Aikar's flags"). They reduce lag spikes on busier servers and are worth adding once everything works.

5. Run it once and accept the EULA

Double-click start.bat. The first run stops almost straight away with a message about the EULA, and creates a file called eula.txt. Open it and you'll see eula=false. Read the Minecraft End User License Agreement; if you agree to it, change the line to eula=true and save. The server won't run until you do this, because hosting a server means agreeing to Mojang's rules, including not selling gameplay advantages.

Run start.bat again. This time the server generates a world, which takes a minute or two the first time. When you see a line ending in Done (…s)! For help, type "help", it's running.

6. Join your own server

Open Minecraft (the same version as the server), click Multiplayer → Add Server and use localhost as the address. If you get in, the server works. Now type op YourName into the server console (no slash needed in the console) to give yourself admin commands.

To stop the server, type stop in the console rather than closing the window. Closing it can lose the last few minutes of the world, because the server saves chunks in the background.

7. Change the basic settings

Stop the server, then open server.properties in Notepad. The settings people change first:

Every option is explained in server.properties explained. Changes apply the next time the server starts.

8. Let your friends join

Friends on the same Wi-Fi can join with your PC's local address, which you can find by typing ipconfig in Command Prompt and reading the IPv4 Address line (something like 192.168.1.100). The first time someone connects, Windows Firewall may ask whether Java can use the network; allow it on private networks.

Friends elsewhere need your public address and a port forward on your router for port 25565. If your internet provider doesn't give you a public address of your own (called CGNAT), see how to host without port forwarding.

If anyone can't get in, the connection troubleshooting guide goes through each error message.

9. Keep it healthy

Common first-run problems

What you seeWhat it means
'java' is not recognized…Java isn't installed or isn't on the PATH. Reinstall with "Add to PATH" on, then open a new Command Prompt.
UnsupportedClassVersionErrorJava is too old for this Minecraft version. Check the table in step 1.
Error: Unable to access jarfile server.jarThe file isn't called exactly server.jar, or the script isn't in the same folder.
FAILED TO BIND TO PORT!Something already uses port 25565, usually another copy of the server that's still running. Close it, or change server-port.
The window flashes and closesAdd pause as the last line of the script so you can read the error.