Back Server setup guides
Minecraft server hosting12 min

Minecraft 1.21 Dedicated Server Setup and Server Software Selection Guide

Minecraft 1.21+ dedicated server setup, Java 21 runtime requirements, Paper/Fabric/NeoForge architecture comparisons, server.properties tuning, and open-source LGSM management.

A Minecraft dedicated server offers a highly controllable multiplayer environment. Vanilla survival, plugin communities, and large technology-and-magic modpacks all need the correct runtime environment and suitable server software. This article covers the standard setup process and tuning parameters for current Minecraft 1.21+ versions.


1. Runtime requirements and server architecture

1. Required Java Runtime Environment (JRE)

Minecraft versions Required Java version Common error symptoms
1.20.5 ~ 1.21+ Java 21 (JDK/JRE 21 64-bit) has been compiled by a more recent version of the Java Runtime (class file version 65.0)
1.18 ~ 1.20.4 Java 17 class file version 61.0 error
1.16.5 and earlier Java 8 or Java 11 For older legacy modded servers

2. Popular server software selection matrix

Server software Purpose and features Compatibility Use cases
Vanilla (official) Mojang's official, original experience No plugins/mods; heavy single-thread load 2~5-player vanilla games, snapshot testing
Paper Industry-grade performance, asynchronous lighting and multithreaded optimization Full Bukkit/Spigot plugin support First choice for friends' servers, economy communities, and public minigames
Purpur Downstream Paper fork with extensive customization Full Paper plugin ecosystem Highly customizable servers needing detailed mob behavior tuning
Fabric Lightweight modern mod server, fast version updates, low resource use Fabric mods only; no traditional plugins Lightweight client/server mods and optimized redstone machines
NeoForge / Forge Established, stable container for large mods Vast technology, magic, and dimension mod compatibility Multiplayer modpacks and large industrial/magical adventure worlds

2. Standard deployment (Paper 1.21 example)

1. Download the server file and initialize

Download the latest paper-1.21.x.jar from official PaperMC sources, place it in a separate folder, and run it for the first time:

PowerShell
java -Xms2G -Xmx4G -jar paper-1.21.x.jar --nogui

2. Accept the EULA

On first run, the server creates eula.txt and exits. Open it and change the value to true:

PROPERTIES
eula=true

3. Aikar's optimized JVM startup script

For production, the community-tested Aikar G1GC garbage collection flags are recommended to reduce stuttering during chunk loading in large worlds:

PowerShell
java -Xms6G -Xmx6G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -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.jar --nogui

3. Networking and key server.properties settings

1. Ports

  • Default Java Edition port: TCP 25565 (required for direct player connections).
  • Default Bedrock Edition port: UDP 19132.
  • If you use Geyser to connect Bedrock and Java players, allow both ports.

2. Key settings

In server.properties in the server root:

PROPERTIES
# Description displayed in the server list
motd=A LanGame Minecraft Server

# Default port
server-port=25565

# Maximum players
max-players=20

# Account authentication (true for licensed accounts; false for LAN/offline multiplayer)
online-mode=true

# View distance (chunks); 8~10 recommended; high values put heavy pressure on CPU and upload bandwidth
view-distance=10

# Simulation distance (chunks); 6~8 recommended to reduce background entity calculation load
simulation-distance=6

# Allow flight (required for glider/flight mods to prevent incorrect kicks)
allow-flight=true

4. Choose an approach: manual configuration or LanGame Server Manager (LGSM)

Manual setup helps you understand Java arguments and directory structure, but maintaining routine plugin installations, scheduled world backups, and cross-version updates takes more work.

To simplify multiple-instance management or automated backups, we recommend the official open-source tool:

LGSM supports Minecraft-specific workflows:

  1. Multiple server types and automatic Java matching: Its built-in download engine supports Paper/Purpur/Fabric/Vanilla, detects the host's Java 21 runtime, and associates it to avoid version conflicts.
  2. Visual properties editor: Edit view distance, difficulty, whitelist, and ports in server.properties through a graphical interface with configuration validation.
  3. World snapshots: Create complete backups before major redstone projects or large builds, with immediate rollback.
  4. Console and background hosting: Provides Web/GUI console commands and automatic restart supervision after crashes.

5. Common issues and tuning pitfalls

1. Joining reports io.netty.channel.AbstractChannel$AnnotatedConnectException

  • The server has not actually bound its listening port, or the system firewall blocks TCP 25565.
  • Confirm the LAN does not have double routing that prevents forwarding from reaching the server host.

2. Can't keep up! Is the server overloaded?

  • A typical warning that server MSPT (milliseconds per tick) exceeds 50ms.
  • Reduce view-distance and simulation-distance in server.properties.
  • Use Spark (/spark profiler) to identify the entities or redstone circuits consuming CPU.