The Ultimate Windows Guide to Hosting a Minecraft Java Server

Back to Posts
2280 words
The Ultimate Windows Guide to Hosting a Minecraft Java Server
2026-04-07

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.

  1. Visit the Oracle download page

  2. 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.

  3. Download the installer

    • Choose Windows x64 Installer (.exe) and download it.
  4. Run the installer

    • Double‑click the .exe, click “Next”, and keep the default installation path.
  5. Verify the installation

    • Press Win + R, type cmd, and hit Enter.
    • Run this command:
      Terminal window
      java -version
    • You should see something like:
      java version "17.0.x" 202x-xx-xx LTS
      Java(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)
      If you see that, Java is installed correctly.

Option B: Microsoft Store (Simpler)#

  1. Open the Microsoft Store.
  2. Search for “Java” or “OpenJDK”.
  3. Pick a version and install it.
  4. Verify with java -version as 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)#

  1. 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.)

  2. Click the download button for minecraft_server.x.xx.x.jar (e.g., minecraft_server.1.20.1.jar).

  3. 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.

Paper is an optimised fork of the vanilla server – better performance, fewer bugs.

  1. Go to the PaperMC downloads page:
    https://papermc.io/downloads/paper

  2. Select your Minecraft version (e.g., 1.20.1).

  3. Download the latest build .jar file.

  4. 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:

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):

  1. Right‑click in an empty space → New → Text Document.

  2. 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”.

  3. Right‑click start.bat and open it with Notepad.

  4. Paste the appropriate content based on your server type:

For Vanilla server:

Terminal window
@echo off
java -Xms2G -Xmx4G -jar minecraft_server.1.20.1.jar nogui
pause

For Paper server:

Terminal window
@echo off
java -Xms2G -Xmx4G -jar paper-1.20.1-xxx.jar nogui
pause

What these parameters mean:

  • -Xms2G – initial RAM allocation (2 GB)
  • -Xmx4G – maximum RAM (4 GB) – adjust based on your system
  • -jar – the jar file to run
  • nogui – 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 -Xmx16G

Don’t allocate more than 70% of your physical RAM – otherwise your system will slow down.

2. Accept the EULA#

  1. Double‑click start.bat to run it.
  2. The server will start and then immediately close – that’s normal.
  3. A new file called eula.txt will appear in the folder.
  4. Open eula.txt in Notepad.
  5. Find this line:
    eula=false
  6. Change it to:
    eula=true
  7. Save and close the file.

3. Launch the Server Properly#

  1. Double‑click start.bat again.
  2. This time the server will start normally and stay running.
  3. Wait until you see a message like:
    [Server thread/INFO]: Done (xx.xxxs)! For help, type "help"
  4. 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#

  1. Shut down the server (press Ctrl + C in the command window, or type stop and press Enter).
  2. Open server.properties with Notepad or any text editor.
  3. 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 players
max-players=20
# Game mode: survival, creative, adventure, spectator
gamemode=survival
# Difficulty: peaceful, easy, normal, hard
difficulty=normal
# Enable PvP (player vs player)
pvp=true
# Allow flying (creative mode always allows it)
allow-flight=false
# World folder name
level-name=world
# World seed (leave blank for random)
level-seed=
# ===== Advanced Settings =====
# View distance (in chunks – higher = more lag)
view-distance=10
# Simulation distance
simulation-distance=10
# Generate structures (villages, fortresses, etc.)
generate-structures=true
# Enable command blocks
enable-command-block=false
# OP permission level (1–4)
op-permission-level=4
# Enable whitelist
white-list=false
# Online mode (authentication)
# true = only premium accounts can join
# false = offline / cracked accounts allowed
online-mode=true
# Max build height
max-build-height=256
# Allow the Nether
allow-nether=true
# Allow the End
allow-end=true
# Spawn animals
spawn-animals=true
# Spawn monsters
spawn-monsters=true
# Spawn NPC villagers
spawn-npcs=true
# Spawn protection radius
spawn-protection=16
# Player idle timeout (minutes, 0 = disabled)
player-idle-timeout=0
# Network compression threshold
network-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=25575

2. Important Settings Explained#

Game Mode#

gamemode=survival # Survival
gamemode=creative # Creative
gamemode=adventure # Adventure
gamemode=spectator # Spectator

Player 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 PlayerName

Online Mode (Authentication)#

# If all players have premium accounts, keep this on
online-mode=true
# If some friends use cracked launchers, turn this off
online-mode=false

Warning: Setting online-mode=false allows 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 seed
level-seed=village_at_spawn
# View distance (affects performance and visibility)
# Low‑end PC: 6–8
# Mid‑range: 10–12
# High‑end: 15–20
view-distance=10

3. Save and Apply Changes#

  1. Save server.properties (Ctrl + S).
  2. Restart your server by double‑clicking start.bat.
  3. The new settings will take effect.

Step 5: Connect to Your Server#

Local Connection (Same PC)#

  1. Launch the Minecraft Java client.
  2. Click Multiplayer.
  3. Click Add Server or Direct Connect.
  4. Enter localhost or 127.0.0.1 as the server address.
  5. Click Done or Join Server.
  6. You’re in!

LAN Connection (Other Devices on the Same Network)#

  1. Find your local IP address:

    • Press Win + R, type cmd, and hit Enter.
    • Run ipconfig and press Enter.
    • Look for the IPv4 Address – it will look like 192.168.1.100.
  2. 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)#

  1. 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.
  2. Log into your router

    • Open a browser and go to your router’s address (usually 192.168.1.1 or 192.168.0.1).
    • Enter the admin username and password.
  3. 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”)
    • Save the settings.
  4. Give your public IP to friends

    • They connect using: your.public.ip:25565
    • Example: 123.45.67.89:25565

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:

Using SakuraFrp as an example:

  1. Create an account.
  2. Download and run the client.
  3. Create a tunnel:
    • Type: TCP
    • Local IP: 127.0.0.1
    • Local Port: 25565
  4. Start the tunnel – you’ll get a domain name.
  5. Friends connect using that domain.

Method C: Third‑Party Hosting Platforms#

If all of this sounds like too much work, try free hosting services:


Step 6: Server Administration#

Common Console Commands#

In the server command window, you can type commands directly:

Terminal window
# Show help
help
# Stop the server gracefully
stop
# Save the world
save-all
# Disable auto‑save (for backups)
save-off
save-on # Re‑enable auto‑save
# Grant OP (admin) privileges
op PlayerName
# Remove OP
deop PlayerName
# Ban a player
ban PlayerName
# Unban a player
pardon PlayerName
# List online players
list
# Change game mode (in‑game or console)
gamemode survival PlayerName
gamemode creative PlayerName
# Teleport
tp Player1 Player2
# Broadcast a message
say Hello everyone, welcome to the server!
# Set world spawn
setworldspawn
# List all game rules
gamerule
# Keep inventory on death
gamerule keepInventory true
# Set time
time set day
time set night
time set noon
# Set weather
weather clear
weather rain
weather thunder

Managing Player Permissions#

1. Using OP (Operator) Status#

OPs have full administrative control.

Terminal window
# In console:
op Steve
# In‑game (if you're already OP):
/op Steve

2. Using a Whitelist#

Allow only specific players to join:

Terminal window
# Enable whitelist
whitelist on
# Add players
whitelist add Steve
whitelist add Alex
# Remove a player
whitelist remove Steve
# List whitelisted players
whitelist list
# Reload the whitelist
whitelist reload

You can also enable the whitelist in server.properties:

white-list=true

Then 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.

  1. Find plugins
    Popular repositories:

  2. 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
  3. Installation:

    • Shut down the server.
    • Place the downloaded .jar plugin files into the plugins folder.
    • Start the server – plugins load automatically and generate config files.
  4. Configuration:

    • Each plugin creates its own config folder inside plugins.
    • Edit the config files as needed.
    • Reload plugins: /reload or /pluginname reload (check the plugin’s docs).

Backing Up World Data#

Regular backups are essential!

Manual Backup#

  1. Stop the server (type stop).
  2. Copy the entire server folder, or just the world, world_nether, and world_the_end folders.
  3. Paste them somewhere safe (another drive, cloud storage, etc.).
  4. Restart the server.

Automated Backup Script#

Create a backup.bat file in your server folder:

Terminal window
@echo off
set backup_folder=D:\MC_Backup
set server_folder=D:\MC_Server
set 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 /Y
xcopy "%server_folder%\world_nether" "%backup_folder%\world_nether_%date_str%" /E /I /Y
xcopy "%server_folder%\world_the_end" "%backup_folder%\world_the_end_%date_str%" /E /I /Y
echo Backup complete!
pause

Run 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:

Terminal window
@echo off
java -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 nogui
pause

2. server.properties Optimisation#

# Lower view distance (biggest performance impact)
view-distance=8
simulation-distance=8
# Tune entity spawning
spawn-animals=true
spawn-monsters=true
spawn-npcs=true
# Disable unnecessary features
enable-command-block=false
spawn-protection=0
# Adjust tick rate (change with caution)
max-tick-time=60000

3. Pre‑Generate the World#

Use a plugin to pre‑generate chunks, reducing lag when players explore:

Commands:

Terminal window
/chunky radius 1000
/chunky start

4. 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.bat matches the actual file name.
  • Look at the log files in the logs folder.
  • Make sure you’ve set eula=true in eula.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 localhost first.

To open Windows Firewall port:

  1. Control Panel → Windows Defender Firewall → Advanced Settings.
  2. Inbound Rules → New Rule.
  3. Port → TCP → Specific local ports: 25565.
  4. Allow the connection.
  5. 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-port in server.properties to another number (e.g., 25566).
  • Or find and kill the process using the port:
    Terminal window
    netstat -ano | findstr :25565
    taskkill /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:

  1. Installed Java
  2. Downloaded a server core
  3. Created a startup script and accepted the EULA
  4. Configured server.properties
  5. Started the server and connected
  6. Set up port forwarding (for online play)
  7. 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 (logs folder)
  • 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:

The Ultimate Windows Guide to Hosting a Minecraft Java Server
https://blog.yufurry.cn/posts/00000008/
Author
LanyingShadow
Published
2026-04-07
License
CC BY-NC-SA 4.0
Download Markdown Source