The Ultimate Windows Guide to Hosting a Minecraft Java Server
The Ultimate Windows Guide to Hosting a Minecraft Java Server
Hey everyone! This is a super‑detailed, beginner‑friendly tutorial on setting up your very own Minecraft Java Edition server on a Windows PC. Whether you want to play with a few friends or run a small community server, this guide has you covered – zero prior experience needed.
Prerequisites
1. System Requirements
- OS: Windows 10 or Windows 11 (64‑bit)
- RAM: At least 8 GB total (system + server usage)
- Storage: Minimum 10 GB free space
- Network: Stable internet connection
2. Software You’ll Need
- Java Runtime Environment (JRE / JDK)
- Minecraft server core file (jar)
- Text editor (Notepad++ or VS Code recommended, but regular Notepad works too)
Step 1: Install Java
Minecraft Java servers require Java to run. Here are two ways to get it.
Option A: Official JDK (Recommended)
-
Visit the Oracle download page
- https://www.oracle.com/java/technologies/downloads/
- Alternatively, use the open‑source OpenJDK: https://adoptium.net/
-
Pick the right version
- Minecraft 1.17 and below → Java 8 or Java 11
- Minecraft 1.18 – 1.20.4 → Java 17
- Minecraft 1.20.5 and above → Java 21
Recommendation: If you’re unsure, download Java 17 – it’s the most compatible across versions.
-
Download the installer
- Choose Windows x64 Installer (.exe) and download it.
-
Run the installer
- Double‑click the .exe, click “Next”, and keep the default installation path.
-
Verify the installation
- Press
Win + R, typecmd, and hit Enter. - Run this command:
Terminal window java -version - You should see something like:
If you see that, Java is installed correctly.java version "17.0.x" 202x-xx-xx LTSJava(TM) SE Runtime Environment (build 17.0.x+x-LTS-x)Java HotSpot(TM) 64-Bit Server VM (build 17.0.x+x-LTS-x, mixed mode, sharing)
- Press
Option B: Microsoft Store (Simpler)
- Open the Microsoft Store.
- Search for “Java” or “OpenJDK”.
- Pick a version and install it.
- Verify with
java -versionas above.
Step 2: Download the Minecraft Server Jar
1. Choose Your Game Version
Decide which Minecraft version you want to run. Popular choices:
- 1.20.1 – Stable, lots of mod support
- 1.19.4 – Relatively new
- 1.16.5 – Classic, well‑optimised
- 1.12.2 – Old but with a huge mod ecosystem
For beginners: Go with 1.20.1 – it has new features and is rock‑solid.
2. Download the Server Core File
Option A: Official Vanilla Server (Pure, unmodded)
-
Visit the official Minecraft server download page:
https://www.minecraft.net/en-us/download/server
(The page auto‑detects your OS – just click the jar link.) -
Click the download button for
minecraft_server.x.xx.x.jar(e.g.,minecraft_server.1.20.1.jar). -
Save it to a new folder – preferably on a drive other than C: (e.g.,
D:\MC_Server). Put the jar file inside that folder.
Option B: Paper Server (Recommended – Better Performance)
Paper is an optimised fork of the vanilla server – better performance, fewer bugs.
-
Go to the PaperMC downloads page:
https://papermc.io/downloads/paper -
Select your Minecraft version (e.g., 1.20.1).
-
Download the latest build .jar file.
-
Place it in your server folder (e.g.,
D:\MC_Server).
Option C: Forge / Fabric Server (For Mods)
If you want to run mods, you’ll need a mod‑loader server.
Forge Server:
- Visit https://files.minecraftforge.net/
- Choose your version and download the “Installer”.
- Run the installer, select “Install server”, and point it to your server folder.
Fabric Server:
- Visit https://fabricmc.net/use/server/
- Download the server jar for your version.
Newbie tip: Start with Paper – it’s the easiest to set up and manage. Move to Forge/Fabric later when you’re comfortable.
Step 3: First Server Launch
1. Create a Startup Script
Inside your server folder (e.g., D:\MC_Server):
-
Right‑click in an empty space → New → Text Document.
-
Rename it to
start.bat(make sure the extension is.bat, not.txt).
If you don’t see file extensions, go to the folder’s View tab and check “File name extensions”. -
Right‑click
start.batand open it with Notepad. -
Paste the appropriate content based on your server type:
For Vanilla server:
@echo offjava -Xms2G -Xmx4G -jar minecraft_server.1.20.1.jar noguipauseFor Paper server:
@echo offjava -Xms2G -Xmx4G -jar paper-1.20.1-xxx.jar noguipauseWhat these parameters mean:
-Xms2G– initial RAM allocation (2 GB)-Xmx4G– maximum RAM (4 GB) – adjust based on your system-jar– the jar file to runnogui– disables the graphical interface (saves resources)pause– keeps the window open so you can see any errors
Memory allocation tips:
- 8 GB RAM total →
-Xms2G -Xmx4G- 16 GB RAM total →
-Xms4G -Xmx8G- 32 GB RAM total →
-Xms8G -Xmx16GDon’t allocate more than 70% of your physical RAM – otherwise your system will slow down.
2. Accept the EULA
- Double‑click
start.batto run it. - The server will start and then immediately close – that’s normal.
- A new file called
eula.txtwill appear in the folder. - Open
eula.txtin Notepad. - Find this line:
eula=false
- Change it to:
eula=true
- Save and close the file.
3. Launch the Server Properly
- Double‑click
start.batagain. - This time the server will start normally and stay running.
- Wait until you see a message like:
[Server thread/INFO]: Done (xx.xxxs)! For help, type "help"
- That means your server is up and running!
Note: The first launch generates the world files – this may take a few minutes. Please be patient.
Step 4: Configure the Server
Your server folder now contains many files. The most important one is server.properties – the main configuration file.
1. Edit server.properties
- Shut down the server (press
Ctrl + Cin the command window, or typestopand press Enter). - Open
server.propertieswith Notepad or any text editor. - Here are the key settings and what they do:
# ===== Basic Settings =====# Server port (default 25565 – usually leave as is)server-port=25565
# Server name (shown in the server list)motd=A Minecraft Server
# Maximum number of playersmax-players=20
# Game mode: survival, creative, adventure, spectatorgamemode=survival
# Difficulty: peaceful, easy, normal, harddifficulty=normal
# Enable PvP (player vs player)pvp=true
# Allow flying (creative mode always allows it)allow-flight=false
# World folder namelevel-name=world
# World seed (leave blank for random)level-seed=
# ===== Advanced Settings =====# View distance (in chunks – higher = more lag)view-distance=10
# Simulation distancesimulation-distance=10
# Generate structures (villages, fortresses, etc.)generate-structures=true
# Enable command blocksenable-command-block=false
# OP permission level (1–4)op-permission-level=4
# Enable whitelistwhite-list=false
# Online mode (authentication)# true = only premium accounts can join# false = offline / cracked accounts allowedonline-mode=true
# Max build heightmax-build-height=256
# Allow the Netherallow-nether=true
# Allow the Endallow-end=true
# Spawn animalsspawn-animals=true
# Spawn monstersspawn-monsters=true
# Spawn NPC villagersspawn-npcs=true
# Spawn protection radiusspawn-protection=16
# Player idle timeout (minutes, 0 = disabled)player-idle-timeout=0
# Network compression thresholdnetwork-compression-threshold=256
# Enable query (for server status tools)enable-query=false
# RCON remote console password (if you need remote control)rcon.password=rcon.port=255752. Important Settings Explained
Game Mode
gamemode=survival # Survivalgamemode=creative # Creativegamemode=adventure # Adventuregamemode=spectator # SpectatorPlayer Management
# Max players (adjust based on your PC and internet)max-players=10
# Whitelist mode (only allowed players can join)white-list=true
# After enabling whitelist, add players via console or in‑game:# /whitelist add PlayerNameOnline Mode (Authentication)
# If all players have premium accounts, keep this ononline-mode=true
# If some friends use cracked launchers, turn this offonline-mode=falseWarning: Setting
online-mode=falseallows anyone to join with any username – be aware of the security implications.
World Generation
# Custom seed (you can find nice ones online)level-seed=123456789
# Or use a text seedlevel-seed=village_at_spawn
# View distance (affects performance and visibility)# Low‑end PC: 6–8# Mid‑range: 10–12# High‑end: 15–20view-distance=103. Save and Apply Changes
- Save
server.properties(Ctrl + S). - Restart your server by double‑clicking
start.bat. - The new settings will take effect.
Step 5: Connect to Your Server
Local Connection (Same PC)
- Launch the Minecraft Java client.
- Click Multiplayer.
- Click Add Server or Direct Connect.
- Enter
localhostor127.0.0.1as the server address. - Click Done or Join Server.
- You’re in!
LAN Connection (Other Devices on the Same Network)
-
Find your local IP address:
- Press
Win + R, typecmd, and hit Enter. - Run
ipconfigand press Enter. - Look for the IPv4 Address – it will look like
192.168.1.100.
- Press
-
On the other device:
- Open Minecraft.
- Go to Multiplayer → Add Server.
- Enter your IPv4 address as the server address, e.g.,
192.168.1.100. - If you changed the port, use
192.168.1.100:25565.
Online Connection (Let Friends Join from the Internet)
This requires port forwarding or tunneling – it’s a bit more advanced.
Method A: Router Port Forwarding (Requires a Public IP)
-
Check if you have a public IP
- Visit https://ip.cn to see your public IP.
- Log into your router’s admin page and check the WAN IP.
- If they match, you have a public IP.
-
Log into your router
- Open a browser and go to your router’s address (usually
192.168.1.1or192.168.0.1). - Enter the admin username and password.
- Open a browser and go to your router’s address (usually
-
Set up port forwarding / virtual server
- Find “Port Forwarding”, “Virtual Server”, or “NAT Settings”.
- Add a new rule:
- External Port:
25565 - Internal Port:
25565 - Internal IP: your PC’s IP (e.g.,
192.168.1.100) - Protocol:
TCP & UDP(or select “Both”)
- External Port:
- Save the settings.
-
Give your public IP to friends
- They connect using:
your.public.ip:25565 - Example:
123.45.67.89:25565
- They connect using:
Notes:
- Your public IP may change after each router reboot – consider using DDNS.
- Make sure your Windows firewall allows port 25565.
Method B: Tunneling Tools (No Public IP Needed)
If your ISP doesn’t give you a public IP, use a tunneling service:
Popular tools:
- SakuraFrp: https://www.natfrp.com/ (free tier available)
- Ngrok: https://ngrok.com/
- Hamachi (LogMeIn)
Using SakuraFrp as an example:
- Create an account.
- Download and run the client.
- Create a tunnel:
- Type: TCP
- Local IP:
127.0.0.1 - Local Port:
25565
- Start the tunnel – you’ll get a domain name.
- Friends connect using that domain.
Method C: Third‑Party Hosting Platforms
If all of this sounds like too much work, try free hosting services:
- Aternos: https://aternos.org/ (completely free)
- Minehut: https://minehut.com/
- Or rent a VPS from cloud providers like AWS, Google Cloud, or Alibaba Cloud.
Step 6: Server Administration
Common Console Commands
In the server command window, you can type commands directly:
# Show helphelp
# Stop the server gracefullystop
# Save the worldsave-all
# Disable auto‑save (for backups)save-offsave-on # Re‑enable auto‑save
# Grant OP (admin) privilegesop PlayerName
# Remove OPdeop PlayerName
# Ban a playerban PlayerName
# Unban a playerpardon PlayerName
# List online playerslist
# Change game mode (in‑game or console)gamemode survival PlayerNamegamemode creative PlayerName
# Teleporttp Player1 Player2
# Broadcast a messagesay Hello everyone, welcome to the server!
# Set world spawnsetworldspawn
# List all game rulesgamerule
# Keep inventory on deathgamerule keepInventory true
# Set timetime set daytime set nighttime set noon
# Set weatherweather clearweather rainweather thunderManaging Player Permissions
1. Using OP (Operator) Status
OPs have full administrative control.
# In console:op Steve
# In‑game (if you're already OP):/op Steve2. Using a Whitelist
Allow only specific players to join:
# Enable whitelistwhitelist on
# Add playerswhitelist add Stevewhitelist add Alex
# Remove a playerwhitelist remove Steve
# List whitelisted playerswhitelist list
# Reload the whitelistwhitelist reloadYou can also enable the whitelist in server.properties:
white-list=trueThen manually edit whitelist.json to add player UUIDs – but the in‑game commands are easier.
Installing Plugins (Paper / Spigot Only)
If you’re using Paper or Spigot, you can add plugins to extend functionality.
-
Find plugins
Popular repositories: -
Recommended plugins for beginners:
- EssentialsX – essential admin commands
- WorldEdit – world editing tools
- CoreProtect – block logging (anti‑griefing)
- LuckPerms – advanced permissions
- Vault – economy system foundation
- Multiverse‑Core – multi‑world management
-
Installation:
- Shut down the server.
- Place the downloaded
.jarplugin files into thepluginsfolder. - Start the server – plugins load automatically and generate config files.
-
Configuration:
- Each plugin creates its own config folder inside
plugins. - Edit the config files as needed.
- Reload plugins:
/reloador/pluginname reload(check the plugin’s docs).
- Each plugin creates its own config folder inside
Backing Up World Data
Regular backups are essential!
Manual Backup
- Stop the server (type
stop). - Copy the entire server folder, or just the
world,world_nether, andworld_the_endfolders. - Paste them somewhere safe (another drive, cloud storage, etc.).
- Restart the server.
Automated Backup Script
Create a backup.bat file in your server folder:
@echo offset backup_folder=D:\MC_Backupset server_folder=D:\MC_Serverset date_str=%date:~0,4%%date:~5,2%%date:~8,2%_%time:~0,2%%time:~3,2%%time:~6,2%set date_str=%date_str: =0%
if not exist "%backup_folder%" mkdir "%backup_folder%"
echo Backing up server...xcopy "%server_folder%\world" "%backup_folder%\world_%date_str%" /E /I /Yxcopy "%server_folder%\world_nether" "%backup_folder%\world_nether_%date_str%" /E /I /Yxcopy "%server_folder%\world_the_end" "%backup_folder%\world_the_end_%date_str%" /E /I /Y
echo Backup complete!pauseRun this script weekly, or before any major changes.
Step 7: Performance Optimisation
1. JVM Tuning
Modify your start.bat with advanced JVM flags for better performance:
@echo offjava -Xms4G -Xmx8G ^ -XX:+UseG1GC ^ -XX:+ParallelRefProcEnabled ^ -XX:MaxGCPauseMillis=200 ^ -XX:+UnlockExperimentalVMOptions ^ -XX:+DisableExplicitGC ^ -XX:+AlwaysPreTouch ^ -XX:G1NewSizePercent=30 ^ -XX:G1MaxNewSizePercent=40 ^ -XX:G1HeapRegionSize=8M ^ -XX:G1ReservePercent=20 ^ -XX:G1HeapWastePercent=5 ^ -XX:G1MixedGCCountTarget=4 ^ -XX:InitiatingHeapOccupancyPercent=15 ^ -XX:G1MixedGCLiveThresholdPercent=90 ^ -XX:G1RSetUpdatingPauseTimePercent=5 ^ -XX:SurvivorRatio=32 ^ -XX:+PerfDisableSharedMem ^ -XX:MaxTenuringThreshold=1 ^ -jar paper-1.20.1-xxx.jar noguipause2. server.properties Optimisation
# Lower view distance (biggest performance impact)view-distance=8simulation-distance=8
# Tune entity spawningspawn-animals=truespawn-monsters=truespawn-npcs=true
# Disable unnecessary featuresenable-command-block=falsespawn-protection=0
# Adjust tick rate (change with caution)max-tick-time=600003. Pre‑Generate the World
Use a plugin to pre‑generate chunks, reducing lag when players explore:
- Chunky plugin: https://www.spigotmc.org/resources/chunky.81534/
Commands:
/chunky radius 1000/chunky start4. Clean Up Unused Data
Regularly remove:
- Offline player inventory data
- Old log files
- Outdated backups
Common Issues & Solutions
1. Server Fails to Start
Symptoms: start.bat opens and closes instantly.
Fixes:
- Verify Java is installed:
java -version - Check that the jar filename in
start.batmatches the actual file name. - Look at the log files in the
logsfolder. - Make sure you’ve set
eula=trueineula.txt.
2. Can’t Connect to Server
Symptoms: “Connection timed out” or “Can’t connect to server”.
Fixes:
- Is the server actually running?
- Double‑check the IP address and port.
- Is Windows Firewall blocking port 25565?
- Test locally with
localhostfirst.
To open Windows Firewall port:
- Control Panel → Windows Defender Firewall → Advanced Settings.
- Inbound Rules → New Rule.
- Port → TCP → Specific local ports:
25565. - Allow the connection.
- Name the rule and save.
3. Server is Laggy
Symptoms: TPS (ticks per second) drops below 20.
Fixes:
- Reduce view‑distance.
- Lower max‑players.
- Limit redstone and mob farms.
- Install optimisation plugins like ClearLag.
- Allocate more RAM (but not too much).
- Pre‑generate the world with Chunky.
4. Authentication Problems
Symptom: Friends can’t join, getting “Failed to authenticate”.
Fixes:
- If everyone has premium accounts: keep
online-mode=true. - If some use cracked launchers: set
online-mode=false. - Remember that offline mode is less secure.
5. Port Already in Use
Symptom: “Address already in use” error.
Fixes:
- Change
server-portinserver.propertiesto another number (e.g., 25566). - Or find and kill the process using the port:
Terminal window netstat -ano | findstr :25565taskkill /PID process_id /F
6. World Corruption
Symptom: Server fails with world loading errors.
Fixes:
- Restore from a backup.
- Use repair tools like MCEdit (older versions).
- Delete corrupted region files (last resort).
Final Words
Congratulations! You’ve now successfully set up your very own Minecraft Java Edition server.
Quick recap of what you’ve done:
- Installed Java
- Downloaded a server core
- Created a startup script and accepted the EULA
- Configured
server.properties - Started the server and connected
- Set up port forwarding (for online play)
- Installed plugins and optimised performance
What you can do next:
- Invite your friends to play
- Explore plugins and mods
- Learn advanced server admin commands
- Create custom gameplay experiences
- Build your own community
If you get stuck, here’s where to look for help:
- Check the server logs (
logsfolder) - Visit Minecraft forums (like MCBBS or Reddit)
- Join Discord communities or QQ groups dedicated to server hosting
Have a blast in the world of Minecraft!
Useful Links:
- Minecraft Official Site: https://www.minecraft.net/
- PaperMC Downloads: https://papermc.io/
- SpigotMC Plugins: https://www.spigotmc.org/
- Minecraft Wiki: https://minecraft.wiki/