A high-performance Minecraft Java Edition 1.21.11 (Mounts of Mayhem) server optimized for small groups with far render distance support.
- High Performance: 12GB RAM allocation with Aikar's optimized JVM flags
- Far Render Distance: 32 chunks view distance, 20 chunks simulation distance
- Secure: Tailscale-only access (no public internet exposure)
- Persistent: systemd service for auto-start on boot and auto-restart on crash
- Automated Backups: Daily backups at 3 AM, retaining last 7 days
- Easy Connection: Simple Tailscale setup for friends
- Java 21 (OpenJDK)
- Tailscale installed and authenticated
- Linux with systemd (tested on Ubuntu/Pop!_OS)
- At least 12GB available RAM (uses 12GB heap)
sudo apt update && sudo apt install -y openjdk-21-jre-headlesscurl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale upDownload the latest Minecraft server JAR from https://www.minecraft.net/en-us/download/server and save as server.jar
Or for version 1.21.11 specifically:
curl -o server.jar https://piston-data.mojang.com/v1/objects/64bb6d763bed0a9f1d632ec347938594144943ed/server.jar# Copy template and edit with your settings
cp server.properties.template server.properties
# Generate a strong RCON password
openssl rand -base64 32
# Edit server.properties and replace CHANGE_THIS_PASSWORD with your generated password
nano server.propertiesecho "eula=true" > eula.txt# Copy service files
mkdir -p ~/.config/systemd/user
cp minecraft.service ~/.config/systemd/user/
cp minecraft-backup.service ~/.config/systemd/user/
cp minecraft-backup.timer ~/.config/systemd/user/
# Make scripts executable
chmod +x start.sh backup.sh
# Reload systemd and enable services
systemctl --user daemon-reload
systemctl --user enable minecraft.service
systemctl --user enable minecraft-backup.timersystemctl --user start minecraft.service
systemctl --user start minecraft-backup.timer# Start server
systemctl --user start minecraft.service
# Stop server (graceful shutdown)
systemctl --user stop minecraft.service
# Restart server
systemctl --user restart minecraft.service
# Check status
systemctl --user status minecraft.service
# View live logs
journalctl --user -u minecraft.service -fAutomated daily backups run at 3 AM and keep the last 7 backups in the backups/ directory.
# Manual backup
./backup.sh
# List backups
ls -lh backups/
# Restore from backup
tar -xzf backups/minecraft-backup-TIMESTAMP.tar.gzSee CONNECTION-GUIDE.md for detailed instructions on how to connect to the server using Tailscale.
Quick Summary:
- Install Tailscale from https://tailscale.com/download
- Log in with the same account or get invited to the network
- In Minecraft, add server with address:
<YOUR_TAILSCALE_IP>
Uses Aikar's optimized flags tuned for high-memory servers:
- 12GB heap (
-Xms12G -Xmx12G) - G1GC garbage collector optimized for Minecraft
- Aggressive pre-touching for better performance
Key performance settings in server.properties:
view-distance=32- Maximum client-supported render distancesimulation-distance=20- Increased for smoother gameplaysync-chunk-writes=false- Performance boost on modern hardwareenable-jmx-monitoring=true- Performance tracking enabled
mindcraft-server/
├── start.sh # Server startup script with JVM flags
├── backup.sh # Backup script
├── server.jar # Minecraft server (gitignored)
├── server.properties # Server config (gitignored - sensitive)
├── server.properties.template # Template for server.properties
├── eula.txt # EULA acceptance
├── CONNECTION-GUIDE.md # Instructions for connecting
├── README.md # This file
├── world/ # World data (gitignored)
├── backups/ # Backup storage (gitignored)
└── logs/ # Server logs (gitignored)
Located in ~/.config/systemd/user/:
- minecraft.service - Main server service with auto-restart
- minecraft-backup.service - Backup execution service
- minecraft-backup.timer - Daily backup scheduler
- Server only accessible via Tailscale (private network)
- No public internet exposure
- RCON password-protected for admin access
- server.properties excluded from git (contains RCON password)
- World data excluded from git (personal/large files)
Check logs:
journalctl --user -u minecraft.service -n 50Increase heap size in start.sh (change -Xms12G -Xmx12G to higher values)
Verify Tailscale is connected:
tailscale status
ping <TAILSCALE_IP>Check timer status:
systemctl --user list-timers minecraft-backup.timer- JVM flags based on Aikar's Flags
- Server setup optimized for high-performance with excess resources
Public domain - use as you wish!