Minecraft
| Platform | Support | Notes |
|---|---|---|
| Linux | ✅ Native | Recommended |
| Windows | ✅ Native |
02
Minimum Requirements
| Players | Recommended RAM | CPU |
|---|---|---|
| 1-5 | 2 GB | 1-2 vCPU |
| 5-15 | 4 GB | 2 vCPU |
| 15-30 | 8 GB | 4 vCPU |
| 30+ | 16 GB+ | 4+ vCPU |
03
1. Install Java
bash
sudo apt update
# Minecraft 1.20.5+: Java 21
sudo apt install openjdk-21-jdk -y
# Minecraft 1.17-1.20.4: Java 17 is fine
# sudo apt install openjdk-17-jdk -y
java -version
04
2. Create user and folder
bash
# Create dedicated user (security)
sudo useradd -m -s /bin/bash minecraft
sudo su - minecraft
# Create server folder
mkdir ~/server && cd ~/server
05
3. Download the server
Paper (recommended - best performance)
bash
# Download latest Paper version (https://papermc.io/downloads)
VER="1.21.4" # change to desired version
BUILD=$(curl -s "https://api.papermc.io/v2/projects/paper/versions/$VER/builds" | python3 -c "import sys,json; builds=json.load(sys.stdin)['builds']; print(builds[-1]['build'])")
wget "https://api.papermc.io/v2/projects/paper/versions/$VER/builds/$BUILD/downloads/paper-$VER-$BUILD.jar" -O paper.jar
Vanilla (official Mojang)
bash
# Download from official site: https://www.minecraft.net/en-us/download/server
wget https://piston-data.mojang.com/v1/objects/.../server.jar -O minecraft.jar
06
4. First run and EULA
bash
# First execution (creates config files)
java -Xms512M -Xmx2G -jar paper.jar nogui
# Accept EULA
echo "eula=true" > eula.txt
07
5. Startup script
bash
nano ~/server/start.sh
bash
#!/bin/bash
# Optimized Minecraft server startup
cd ~/server
# Adjust Xmx to VPS RAM (leave ~1 GB for system)
java -Xms1G -Xmx3G \
-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 \
-Dusing.aikars.flags=https://mcflags.emc.gs \
-jar paper.jar nogui
bash
chmod +x ~/server/start.sh
08
6. Persistent startup with tmux
bash
# Start server in tmux session
tmux new -s minecraft
~/server/start.sh
# Press Ctrl+B then D to detach
# Server keeps running!
09
7. systemd service (automatic startup)
bash
sudo nano /etc/systemd/system/minecraft.service
ini
[Unit]
Description=Minecraft Server
After=network.target
[Service]
User=minecraft
WorkingDirectory=/home/minecraft/server
ExecStart=/usr/bin/java -Xms1G -Xmx3G -jar paper.jar nogui
ExecStop=/bin/kill -SIGINT $MAINPID
Restart=on-failure
RestartSec=30
[Install]
WantedBy=multi-user.target
bash
sudo systemctl enable minecraft
sudo systemctl start minecraft
sudo systemctl status minecraft
# View logs
sudo journalctl -u minecraft -f
10
8. Basic configuration (server.properties)
ini
# server.properties
server-port=25565
max-players=20
view-distance=10 # reduce for VPS with low CPU (min 6)
simulation-distance=8
online-mode=true # false only for private/cracked servers
difficulty=normal
gamemode=survival
white-list=false
enable-command-block=false
11
9. Open ports
bash
# Minecraft port
sudo ufw allow 25565/tcp
sudo ufw allow 25565/udp
# Bedrock Edition (if using Geyser)
sudo ufw allow 19132/udp
12
10. Console commands
bash
# If using systemd, console is not interactive
# Use RCON to send commands
sudo apt install mcrcon -y
mcrcon -H localhost -P 25575 -p yourrconepassword "list"
# Enable RCON in server.properties:
# enable-rcon=true
# rcon.port=25575
# rcon.password=yourpassword
13
Recommended Plugins (Paper)
- EssentialsX: essential commands (/home, /warp, /tpa)
- LuckPerms: permission management
- WorldEdit: bulk world modification
- Dynmap: web map of world
- CoreProtect: block logging (anti-griefing)
14
Tips & Tweaks
JVM Optimization (Aikar's Flags)
The startup script already includes Aikar's optimized GC flags. For reference, the key flags are:
Adjust -Xms (initial) and -Xmx (maximum) heap based on your VPS RAM:
Paper.yml Tuning
Key performance settings in paper-world-defaults.yml:
yaml
world-settings:
default:
# Reduce chunk loading
max-auto-save-chunks-per-tick: 24
# Entity limits
entity-per-chunk-save-limit:
experience_orb: 16
arrow: 16
# Lighting optimization
enable-async-lighting: true
# Spawn rates
despawn-ranges:
soft: 32
hard: 128
server.properties Optimization
ini
# Critical performance settings
view-distance=10 # reduce to 8 on limited VPS, max 32
simulation-distance=8 # 6-10 recommended
max-tick-time=60000 # prevent watchdog kills
# Network optimization
network-compression-threshold=256 # reduce packet size
max-players=20 # match your plan
Useful RCON Commands
| Command | Purpose |
|---|---|
list | Show connected players |
say <message> | Broadcast message |
save-all | Manual save |
reload | Reload server.properties (plugins need restart) |
stop | Graceful shutdown |
difficulty <level> | Change difficulty (0-3) |
seed | Show world seed |
gamerule <rule> <value> | Change game rules |
Monitoring Commands
bash
# Check if server is running
systemctl status minecraft
# View live logs
journalctl -u minecraft -f
# Check memory usage
ps aux | grep java | grep -v grep
# Monitor connections
ss -tulnp | grep 25565
Common Config Tweaks
For low-end VPS:
ini
view-distance=8
simulation-distance=6
max-players=10
network-compression-threshold=512
For high-performance PVP:
ini
view-distance=12
simulation-distance=10
max-players=50
network-compression-threshold=256
pvp=true
difficulty=hard
Backup Strategy
bash
# Automated daily backup at 3 AM
# Add to root crontab: crontab -e
0 3 * * * su - minecraft -c "tar -czf ~/backups/world-\$(date +\%Y\%m\%d).tar.gz ~/server/world*" 2>/dev/null
Performance Monitoring
Check TPS (ticks per second) via RCON:
bash
mcrcon -H localhost -P 25575 -p password "/forge tps" # Forge servers
Common lag causes:
- -XX:+UseG1GC: Garbage collector optimized for heap sizes 4-8 GB+
- -XX:MaxGCPauseMillis=200: Target pause time for GC
- XX:+ParallelRefProcEnabled: Parallel reference processing
- 2 GB RAM: -Xms512M -Xmx1G
- 4 GB RAM: -Xms1G -Xmx2G
- 8 GB RAM: -Xms2G -Xmx5G
- 16 GB RAM: -Xms4G -Xmx12G
- View distance too high → reduce in server.properties
- Too many plugins → remove unused ones
- Large world size → consider world border /worldborder set 5000
- Insufficient RAM → check Xmx heap size
Gerelateerde artikelen
Gaming Servers
CS2
How to install and configure a Counter-Strike 2 dedicated server on Linux VPS with SteamCMD
5 min lezen
Gaming Servers
Palworld
Create a dedicated Palworld server on Linux with SteamCMD. Configuration, ports and automatic startup.
5 min lezen
Gaming Servers
Rust
Install and manage a Rust server (Facepunch) on Linux with SteamCMD. Includes automatic updates, Oxide plugins and optimizations.
7 min lezen
