DGuard

How to make a Minecraft server on Windows: step by step

On Windows a Minecraft server takes about half an hour: a Java installer, a folder with Paper, a start.bat file, the accepted EULA and a firewall rule for port 25565. Below is every step with a check, plus the mistakes people hit specifically on Windows: hidden file extensions, Java missing from PATH and a dismissed firewall prompt.

The DGuard team9 min read

In short: install 64-bit Java (25 for Paper 26.x, 21 for 1.21.x), put Paper in its own folder, start it with start.bat and set eula=true in eula.txt. When the firewall asks about "OpenJDK Platform binary", allow access — or create a rule for TCP port 25565 by hand. For players to join from the internet, forward the port on your router. The server runs as long as the computer is on and the console window is open.

Step 1. Java

Paper versionJava
1.20–1.21.1121
26.1 and newer25
From the Getting started page in Paper's docs

You need an OpenJDK build. Paper's guide for Windows 10 and 11 installs Amazon Corretto 25 from an MSI installer and says it's safe to click "Next" all the way through. Eclipse Temurin from Adoptium works too: its MSI adds Java to PATH and associates .jar files by default, while setting JAVA_HOME is a separate option that's off by default. According to Adoptium's docs, the Temurin MSI is meant for 64-bit (x64) Windows.

check in a new Command Prompt window
java -version
where java

The first line of the output should start with openjdk 25 (or 21 for a 1.21.x server) and the last one should contain 64-Bit. where java shows which java.exe Windows finds first on PATH: with several Javas installed, the top one runs. If the command isn't found, open a new window — Paper's docs suggest the same.

Step 2. The folder and Paper

  1. 1

    Create a dedicated folder

    For example C:\mc-server. The world, configs and plugins will live there, so keep it apart from Downloads and the Desktop and make sure your account can write to it.

  2. 2

    Download Paper

    On the Paper downloads page pick a version and click the build number. Put the file in the server folder and rename it to paper.jar — it's easier to reference in the script.

  3. 3

    Show file extensions

    In File Explorer on Windows 11: View → Show → File name extensions. On Windows 10, tick "File name extensions" on the View tab. Without this it's easy to create start.bat.txt instead of start.bat.

Step 3. start.bat and the first start

Start the server with a command, not by double-clicking the .jar: that way you see the console where errors appear and commands go in, and you set the memory. Create a text file named start.bat in the server folder with this content:

start.bat
@echo off
java -Xms4G -Xmx4G -jar paper.jar --nogui
pause

-Xms and -Xmx set the memory (the 4 GB in the example comes from Paper's docs; how to pick your own amount is in how much RAM a server needs). --nogui turns off the vanilla server window, and pause keeps the console open if something fails. A ready-made start.bat with Aikar's flags and auto-restart comes out of the free start script generator.

  1. 1

    Run start.bat

    Double-click it. The first start creates eula.txt and stops.

  2. 2

    Accept the EULA

    Open eula.txt in Notepad, change eula=false to eula=true and save. That confirms you've read the Minecraft EULA; without it the server shuts down right after starting.

  3. 3

    Run it again

    The server creates the world, server.properties and the plugins folder. It's ready when the console prints a Done line. Join from the same computer at localhost.

  4. 4

    Shut it down with stop

    Type stop into the console: the server saves the worlds and disables plugins properly. Don't close the window with the X while the server is running.

The other settings live in server.properties — see the server.properties guide. The whole path from choosing a server jar to the pre-launch checklist is in the complete server setup guide.

Step 4. Windows Firewall

Windows Firewall blocks inbound connections by default. On the server's first start you'll get a prompt for "OpenJDK Platform binary": allow access and Windows creates the rules itself. If you click Cancel or answer No, Windows creates block rules for Java — usually two, for TCP and UDP. A block rule beats any allow rule, so a port rule next to it won't help: find the Java block rules in the list and delete them.

You can also create the port rule by hand, with administrator rights. In the Windows Firewall with Advanced Security console (type wf.msc in Start): Inbound Rules → Action → New Rule, rule type Port, protocol TCP, local port 25565, action "Allow the connection", then the profiles and a name. Or in one command:

a rule for the server port
# PowerShell as Administrator
New-NetFirewallRule -DisplayName "Minecraft 25565" -Direction Inbound -Protocol TCP -LocalPort 25565 -Action Allow

Step 5. Access from the internet

  • The same home network. Friends join by the computer's local IP: ipconfig, the "IPv4 Address" line.
  • The internet. Forward TCP port 25565 on the router to this computer and give players your public IP. Pin the computer's local address, or after a reboot the router may hand out another one and the forward stops working.
  • Carrier-grade NAT. If your ISP shares one public IP between many customers, a port forward won't work: you need a public IP, a tunnel or hosting — options in a server for friends.

Port forwarding, testing the port from outside and NAT step by step are in server IP and port. To let players join by name instead of digits, set up a domain and an SRV record.

Keeping the server up

  • Sleep. A sleeping computer doesn't answer players. Lengthen or turn off sleep in Settings → System → Power & battery → Screen, sleep, & hibernate timeouts.
  • Auto-restart. The script generator can add a loop: after a crash or stop the server starts again. Leave the loop with Ctrl+C in the console window.
  • Shared memory. If you play on the same computer, the Minecraft client and Windows need memory too — don't give the server all of it.
  • Around the clock. A home PC isn't built to run nonstop. When players want to join without you, move to hosting or a VPS — see hosting or VPS and a Minecraft server on Linux.

Common mistakes on Windows

What you seeCauseWhat to do
'java' is not recognized as an internal or external commandJava isn't installed or isn't on PATHInstall Temurin with Add to PATH (on by default) and open a new window. Or put the full path to java.exe in quotes in start.bat
The console window flashes and closesAn error at startup and no pause in the scriptAdd pause as the last line — the error stays on screen
The script opens in Notepad and nothing startsThe file is called start.bat.txtShow file extensions and rename it to start.bat
The server keeps asking for the EULAAn eula.txt.txt was created next to the real fileEdit the eula.txt the server created; delete the extra file
Unable to access jarfileThe .jar name in the script doesn't match the fileRename the file to paper.jar or fix the script
UnsupportedClassVersionErrorAn old Java runs but the build needs a newer onewhere java shows which Java comes first on PATH; install 25 for Paper 26.x
Failed to bind to portThe server is already running in another window, or server-ip is wrongClose the second server; leave server-ip empty
You can join, friends on the same network can'tA firewall block rule left by CancelDelete the Java block rules in wf.msc and allow the port
From the Minecraft Wiki and the Paper, Adoptium and Microsoft docs. Reading logs: crash logs

An anticheat on a Windows server

A server on a home computer is open to anyone who knows the address, and a cheater doesn't care which OS it runs on. DGuard — the best anticheat for a modern Minecraft server — installs like any other Paper or Leaf plugin for 1.21–26.3: a key from the panel, the latest PacketEvents release and DGuard.jar in the plugins folder, the key in plugins/DGuard/config.yml, then a restart. It needs no inbound ports, only outbound HTTPS, and Windows Firewall allows outbound connections by default.

DGuard barely touches a computer you also play on: checks run in network threads, and the main thread cost is 0.03% of one core. It catches cheats in combat, movement, packets, inventory, building and the world, and up to 30 players online it's free — with the same protection as the paid plans.

FAQ

Which Java does a Minecraft server on Windows need?

64-bit Java 25 for Paper 26.1 and newer and Java 21 for 1.20–1.21.11. The Amazon Corretto or Eclipse Temurin MSI installers both work; check with java -version in a new Command Prompt window.

Why does start.bat close right away?

The server failed at startup and the window closed with it. Add pause as the last line of start.bat and read the error. Common causes are an unaccepted EULA, Java missing from PATH or a wrong .jar name.

How do I open port 25565 in Windows Firewall?

Allow access in the "OpenJDK Platform binary" prompt on the first start, or create an inbound rule for TCP port 25565 in wf.msc. As administrator, New-NetFirewallRule in PowerShell does the same.

Why can't my friends join my server?

Check in order: the server is listening (netstat -ano | findstr :25565), the firewall isn't blocking Java, the port is forwarded on the router, and your ISP doesn't put you behind its NAT. Friends on the internet need your public IP, not 192.168.x.x.

Can I play on the same computer that runs the server?

Yes, join at localhost. Mind the memory: the client and Windows need RAM too, so don't give the server all of it.

Sources

All sections

Run the best anticheat for modern Minecraft

DGuard catches all 47 kinds of cheats in our comparison — the closest rival, Intave, has 27. Full protection on every plan, free up to 30 players online.