Complete guide to installing and running a Minecraft Java Edition dedicated server on Windows.
Minecraft requires Java 21 or newer. Download and install the latest Java JDK.
java -versionYou should see Java version 21 or higher.
Download the official Minecraft server JAR file from Mojang.
C:\MinecraftServerLatest Version
Always download the latest version from the official Minecraft website for security and compatibility.
Run the server once to generate configuration files, then accept the EULA.
cd C:\MinecraftServer
java -Xmx2G -Xms1G -jar server.jar noguiThe server will stop and create an eula.txt file. Edit it:
eula=trueEdit the server.properties file to customize your server settings.
server-port=25565
max-players=20
motd=My Minecraft Server
difficulty=normal
gamemode=survival
online-mode=true
white-list=falseUse our Config Builder to generate a customized configuration file.
Open the required ports in Windows Firewall to allow connections to your server.
# Run these commands in PowerShell as Administrator
# Allow Game Port (TCP 25565)
New-NetFirewallRule -DisplayName "Minecraft Server" -Direction Inbound -Protocol TCP -LocalPort 25565 -Action AllowPort Forwarding Required
If hosting from home, you'll also need to forward port 25565 on your router. Access your router's admin panel and add a port forwarding rule for TCP 25565.
Navigate to your server folder and run the server with optimized memory settings.
cd C:\MinecraftServer
java -Xmx4G -Xms2G -jar server.jar noguiMemory Settings
Adjust -Xmx (max memory) and -Xms (initial memory) based on your system. Use 2-4GB for small servers, 4-8GB for larger ones.
Create a batch file to easily start your server with proper settings.
@echo off
title Minecraft Server
cd /d "%~dp0"
:start
echo Starting Minecraft Server...
java -Xmx4G -Xms2G -jar server.jar nogui
echo Server stopped. Restarting in 5 seconds...
timeout /t 5
goto startOnce your server is running, players can connect using:
123.45.67.89)localhost or your local IP