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 version | Java it needs |
|---|---|
| 1.8 to 1.16.5 | Java 8 (newer often works for 1.12+) |
| 1.17 and 1.17.1 | Java 16 or newer |
| 1.18 to 1.20.4 | Java 17 or newer |
| 1.20.5 to 1.21.x | Java 21 or newer |
| 26.1 and newer | Java 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:
- Vanilla is Mojang's own server. Download it from the official Minecraft website's server page. It's the same game with nothing added.
- Paper is a faster version that supports plugins. Download it from papermc.io. Most friend servers should start here.
- Fabric is for mods. Its website has a "server launcher" jar that downloads the rest the first time it runs.
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
-Xmx4Gis the most memory the server may use, here 4 GB. See how much RAM a server needs to pick a number.-Xms2Gis how much it reserves straight away.noguiskips the small Swing window and uses the console instead, which is lighter.pausekeeps the window open if the server stops, so you can read any error.
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:
motd: the description shown in the server list.difficultyandgamemode.max-players: a limit, not a reservation, so it costs nothing to leave it at 20.white-list=true: only people you add can join. Highly recommended for a private server.view-distance: lower it to 8 or 10 if the server lags.
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
- Back it up. Copy the world folders somewhere else regularly. See how to back up a Minecraft server.
- Update carefully. Back up first, and wait for your plugins or mods to support a new Minecraft version before updating. You can't go back to an older version with the same world.
- Watch the console. Warnings like "Can't keep up!" mean the server is falling behind. The lag guide explains what to do.
Common first-run problems
| What you see | What 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. |
UnsupportedClassVersionError | Java is too old for this Minecraft version. Check the table in step 1. |
Error: Unable to access jarfile server.jar | The 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 closes | Add pause as the last line of the script so you can read the error. |