How to Set Up a Minecraft Server on Windows

The Windows Minecraft Server: Start Here, Graduate Later

Most people’s first server of any kind runs on Windows. That is not a criticism. If Windows is what you have, Windows is where you start. I ran my own first servers on Windows Server 2003, and the fundamentals are the same regardless of OS: install the runtime, configure the application, open the firewall, and keep it running.

From the homelab: Windows is where most people start, and there is nothing wrong with that. If you have a spare PC or laptop sitting around, you can have a server running in 15 minutes. Once you are comfortable, I would recommend trying the Docker or Ubuntu route for something more robust.

A Windows Minecraft server is a perfectly valid way to learn server administration. You will deal with Java installation, memory allocation, configuration files, firewall rules, and network port forwarding. These are the same concepts you would encounter on Linux, just with different tools.

I will be honest about the trade-offs throughout this guide. Windows works. It is not the best platform for running a 24/7 game server, and I will explain why at the end. But if your gaming PC is the only hardware you have, this guide gets you from nothing to a running server that your friends can connect to.

Windows terminal showing a Minecraft server starting with Java

Prerequisites

  • A Windows 10 or 11 PC (Home or Pro, either works)
  • At least 8 GB of total RAM (you will allocate some to the server and need the rest for Windows and anything else running)
  • Administrator access on the machine
  • A decent internet connection (upload speed matters for remote players)
  • Minecraft Java Edition on whatever device you will use to connect

If you plan to play Minecraft on the same PC that runs the server, you need significantly more RAM. The game client uses 2-4 GB, the server needs 2-4 GB, and Windows itself wants 3-4 GB. Realistically, 16 GB total is the minimum for a comfortable experience running both simultaneously.

Step 1: Install Java 21

Minecraft 1.20.5 and later require Java 21. Even if you have Java installed for something else, verify you have the right version.

Download the Java 21 installer from Adoptium (Eclipse Temurin). Choose the Windows x64 .msi installer. Adoptium is the community-maintained build of OpenJDK. It is free, open source, and what I recommend over Oracle’s distribution (which has licensing restrictions for certain uses).

Run the installer. On the “Custom Setup” screen, make sure “Set JAVA_HOME variable” and “Add to PATH” are both enabled. These are optional features in the installer that default to off. You need both.

After installation, open a new Command Prompt or PowerShell window (existing windows will not pick up the PATH change) and verify:

java -version

You should see:

openjdk version "21.0.x" 2024-xx-xx LTS
OpenJDK Runtime Environment Temurin-21.0.x+xx (build 21.0.x+xx)
OpenJDK 64-Bit Server VM Temurin-21.0.x+xx (build 21.0.x+xx, mixed mode, sharing)

If you see an older version or “java is not recognised,” the PATH was not set correctly. Rerun the Adoptium installer and make sure both PATH options are ticked, or manually add Java’s bin directory to your system PATH.

Do not install Java from random websites. There are dozens of sites offering “Java downloads” that bundle adware or worse. Use Adoptium or download directly from Oracle. Nowhere else.

Step 2: Download the Server JAR

Create a folder for your server. I recommend something like C:\MinecraftServer rather than burying it in your user profile. Keep the path short and avoid spaces.

  1. Create the folder: C:\MinecraftServer
  2. Go to minecraft.net/download/server
  3. Download server.jar and save it to C:\MinecraftServer\

Alternatively, download PaperMC from papermc.io/downloads for better performance. Rename the downloaded file to server.jar and place it in the same folder. PaperMC runs identically on Windows and Linux.

Step 3: Create a Launch Batch File

Do not double-click the server.jar file. It will run with default Java settings, which means minimal RAM allocation. Create a batch file that launches the server with proper settings.

Open Notepad (or any text editor) and paste:

@echo off
title Minecraft Server
cd /d C:\MinecraftServer
java -Xmx4G -Xms2G -jar server.jar --nogui
pause

Save this as start-server.bat in C:\MinecraftServer\. Make sure it saves with the .bat extension, not .bat.txt. If you are using Notepad, change “Save as type” to “All Files” before saving.

The flags:

  • -Xmx4G – Maximum memory allocation (4 GB). Adjust based on your available RAM.
  • -Xms2G – Initial memory allocation (2 GB). Java starts with this and grows as needed.
  • –nogui – Skips the graphical server window. The console output in the command prompt is more useful.
  • pause – Keeps the window open if the server crashes, so you can read the error message.

Double-click start-server.bat to run the server for the first time. It will fail with an EULA message. This is expected.

Step 4: Accept the EULA

The first run generates several files in your server folder, including eula.txt. Open it in Notepad and change:

eula=false

to:

eula=true

Save and close. Run start-server.bat again. This time the server will start properly. Wait until you see “Done” in the console output before trying to connect.

Step 5: Configure server.properties

After the first successful run, the server generates server.properties. Open it in Notepad (or preferably Notepad++ which handles the line endings correctly) and adjust these settings:

# Server basics
server-port=25565
motd=A Minecraft Server
max-players=10
difficulty=normal
gamemode=survival
level-name=world

# Security - turn these on
white-list=true
enforce-whitelist=true
online-mode=true
enable-command-block=false

# Performance
view-distance=10
simulation-distance=8
max-tick-time=60000
network-compression-threshold=256

# Disable remote console unless you need it
enable-rcon=false

Save the file and restart the server (stop it by typing stop in the console, then run the batch file again).

The motd (message of the day) is what players see in their server list before connecting. Keep it short. You can use formatting codes for colour, but plain text is fine for a private server.

Step 6: Windows Firewall Configuration

This is where most Windows server guides fail their readers. Your server is running, but no one else can connect to it because Windows Firewall blocks the port by default. You need to create an inbound rule.

Method 1: Windows Defender Firewall with Advanced Security (GUI)

  1. Press Win+R, type wf.msc, press Enter
  2. Click Inbound Rules in the left panel
  3. Click New Rule in the right panel
  4. Select Port, click Next
  5. Select TCP, enter 25565 in “Specific local ports”, click Next
  6. Select Allow the connection, click Next
  7. Tick all profiles (Domain, Private, Public), click Next
  8. Name it “Minecraft Server (TCP)”, click Finish

Repeat steps 3-8 but select UDP instead of TCP. Name it “Minecraft Server (UDP)”. Minecraft primarily uses TCP, but creating both rules avoids issues with certain features.

Method 2: PowerShell (faster)

Open PowerShell as Administrator and run:

New-NetFirewallRule -DisplayName "Minecraft Server (TCP)" -Direction Inbound -Protocol TCP -LocalPort 25565 -Action Allow
New-NetFirewallRule -DisplayName "Minecraft Server (UDP)" -Direction Inbound -Protocol UDP -LocalPort 25565 -Action Allow

Verify the rules are active:

Get-NetFirewallRule -DisplayName "Minecraft*" | Format-Table DisplayName, Enabled, Direction, Action

You should see both rules listed as Enabled.

If you are running third-party antivirus or firewall software (Norton, McAfee, Bitdefender, etc.), you may need to create the rule in that software as well. Some security suites override Windows Firewall entirely. If players on your local network can connect but external players cannot, and port forwarding is set up correctly, a third-party firewall is almost always the cause.

Step 7: Local Network Testing

Before dealing with port forwarding, confirm the server works on your local network:

  1. From the same PC: Connect to localhost in Minecraft
  2. From another device on your network: Connect to your PC’s local IP address

Find your local IP address:

ipconfig

Look for the IPv4 Address under your active network adapter. It will be something like 192.168.1.50. Use this address in Minecraft’s server list from another device on your network.

If local connections work but you want friends outside your network to connect, you need port forwarding.

Step 8: Port Forwarding for Remote Access

Port forwarding tells your router to send traffic arriving on port 25565 from the internet to your PC’s local IP address. The process varies by router model, but the general steps are:

  1. Log into your router’s admin page (usually 192.168.1.1 or 192.168.0.1 in a browser)
  2. Find the port forwarding section (sometimes called “Virtual Server” or “NAT Forwarding”)
  3. Create a new rule:
    • External port: 25565
    • Internal port: 25565
    • Protocol: TCP (or Both)
    • Internal IP: Your PC’s local IP address
  4. Save and apply

Give friends your public IP address to connect. Find it by searching “what is my IP” in any search engine. If your ISP gives you a dynamic IP (most do), the address changes periodically. Set up a free dynamic DNS service like DuckDNS to get a consistent hostname.

Port forwarding exposes a service on your PC directly to the internet. This is why the whitelist and online-mode=true settings matter. Without them, anyone who discovers your IP and port can connect to your server. Also be aware that some ISPs in the UK use CGNAT (Carrier-Grade NAT), which means port forwarding will not work because you do not have a real public IP. If you are on a mobile broadband provider or certain budget fibre providers, this may affect you. Alternatives include Tailscale, ZeroTier, or Playit.gg for tunnelling.

Step 9: Keeping the Server Running

The biggest operational issue with a Windows Minecraft server is keeping it alive. Unlike a Linux systemd service that restarts automatically, your batch file runs in a command prompt window. If that window closes, the server stops.

Common ways the server gets killed on Windows:

  • Closing the terminal window (accidentally or otherwise)
  • Logging out of Windows (the session ends, all programs close)
  • Windows Update reboots (the middle-of-the-night forced restart that kills your server and your players’ progress)
  • Sleep/hibernate (if the PC goes to sleep, the server becomes unreachable)
  • Someone else using the PC and closing “that black window”

Preventing accidental closure

You can run the server minimised to the system tray using a wrapper, but the simplest approach is: do not run a 24/7 server on a PC that other people use or that goes to sleep.

Auto-start on boot

Create a shortcut to start-server.bat and place it in the Startup folder:

  1. Press Win+R, type shell:startup, press Enter
  2. Copy a shortcut to start-server.bat into this folder

The server will start automatically when you log in. Note: it starts on login, not on boot. If the PC restarts and no one logs in, the server does not start. You can create a Windows Task Scheduler job to start at boot regardless of login, but this is getting increasingly awkward.

Preventing Windows Update reboots

Set active hours in Windows Update settings (Settings > Windows Update > Advanced options > Active hours). Set these to cover the times your server is most used. Windows will not reboot during active hours. This does not prevent the reboot, it just delays it. On Windows Pro, you can use Group Policy to control updates more aggressively. On Windows Home, your options are limited.

If you find yourself fighting Windows to keep a server running, that is the clearest sign it is time to move to Linux. Ubuntu Server has no GUI to eat resources, no forced update reboots, no sleep/hibernate, and systemd keeps services running through anything. That is what server operating systems are designed for.

Managing the Server

Type commands directly into the server console window:

# Add a player to the whitelist
whitelist add PlayerName

# Give a player operator privileges
op PlayerName

# Remove operator privileges
deop PlayerName

# Save the world manually
save-all

# Shut down the server gracefully
stop

Always use the stop command to shut down the server. Never close the window with the X button. The stop command saves the world and shuts down cleanly. Closing the window kills the process immediately and risks world corruption.

Backing Up Your World

Your world data is in the world folder inside C:\MinecraftServer\. Back it up by simply copying the folder:

# PowerShell - copy world to a backup location with timestamp
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
Copy-Item -Path "C:\MinecraftServer\world" -Destination "C:\MinecraftBackups\world-$timestamp" -Recurse

Do this before any server updates and periodically during normal operation. Stop the server first (type stop in the console) to ensure you get a clean copy.

The Case for Moving to Linux

I promised I would be honest about this. Windows works for a Minecraft server. But if you find yourself running the server more than occasionally, every limitation you hit will point towards Linux:

  • Resource overhead: Windows uses 2-4 GB of RAM just for the OS. Ubuntu Server uses 300-500 MB. On a machine with 8 GB, that difference means 2-4 GB more available for the actual server.
  • Stability: Linux does not force-restart for updates. systemd restarts crashed services automatically. There is no GUI consuming resources.
  • Headless operation: Linux servers run perfectly without a monitor, keyboard, or mouse. You SSH in when you need to. Windows technically supports this (RDP, PowerShell remoting) but it is not designed for it.
  • Cost: Ubuntu is free. Windows licenses cost money (though most people have it on their existing PC already).
  • Professional relevance: 96% of the world’s servers run Linux. Learning Linux server administration is a career-relevant skill. Learning to run services on Windows desktop is not.

If you have an old PC, a mini PC, or a Raspberry Pi, install Ubuntu Server on it and follow the Ubuntu Minecraft server guide. Let your gaming PC be a gaming PC and your server be a server. Separation of concerns is a fundamental infrastructure principle, and it applies at home too.

Understanding Windows server concepts is valuable. Firewall rules, port forwarding, service management, and network configuration are the same problems on every platform. But if this Minecraft server sparks an interest in infrastructure, the next step is Linux. That is where the jobs are, where the servers are, and where you will spend your time professionally. This Windows setup is a valid starting point. Linux is where you graduate to.

Watch out: Windows Firewall will silently block incoming connections by default. When the server starts, you should get a firewall prompt — make sure you allow it on your private network. If you missed the prompt, add an inbound rule for TCP port 25565 manually.

Next Steps

Key Takeaways

  • Install Java 21 from Adoptium and make sure it is added to PATH. Verify with java -version in a new terminal window.
  • Always launch the server from a batch file with explicit -Xmx and -Xms memory flags. Never double-click the JAR.
  • Windows Firewall blocks the port by default. Create inbound rules for TCP and UDP on port 25565.
  • Port forwarding on your router is required for players outside your local network. It does not work with CGNAT.
  • Use the stop command to shut down the server. Never close the console window directly.
  • Windows Update reboots, sleep mode, and session logouts will all kill your server. Plan for this.
  • A Windows Minecraft server is a valid starting point. A Linux server is where you should graduate to for anything running 24/7.

Related Guides

If you found this useful, these guides continue the journey:

The RTM Essential Stack - Gear I Actually Use

Enjoyed this guide?

New articles on Linux, homelab, cloud, and automation every 2 days. No spam, unsubscribe anytime.

Scroll to Top