Minecraft Server: Complete Self-Hosting Guide
Host your own Minecraft server. Java and Bedrock editions with plugins and optimization.
Introduction
Minecraft is one of the most popular games ever created, with over 200 million monthly players as of 2025. But here’s something most players don’t realize: the game you play on official servers like Hypixel or 2b2t can run on your own hardware at home. For the cost of a few months of Minecraft Realms subscription, you can build a self-hosted server that’s more powerful, more customizable, and completely under your control.
Self-hosting a Minecraft server isn’t just about saving money - it’s about creative freedom. Want unlimited worlds? Custom plugins? Modded gameplay with 300+ mods? Complete control over who joins? Backups whenever you want? A self-hosted server gives you all of this and more.
The best part? In 2025, running a Minecraft server has never been easier. Modern server software like Paper offers incredible performance optimizations. Docker makes deployment trivial. And the plugin/mod ecosystem has matured to the point where you can create nearly any gameplay experience imaginable - all without writing a single line of code.
Whether you’re hosting for friends, building a community server, or learning server administration skills that transfer to professional DevOps work, this guide will take you from zero to a fully functional, optimized Minecraft server.
By the end of this guide, you’ll:
- Understand Java Edition vs. Bedrock Edition server differences
- Choose the right server software (Vanilla, Paper, Fabric, Forge, etc.)
- Install and configure a production-ready Minecraft server
- Deploy using Docker for easy management
- Install plugins and mods safely
- Optimize performance for smooth gameplay
- Set up automated backups and maintenance
- Secure your server against common threats
- Support both Java and Bedrock players on one server (via GeyserMC)
Real-world impact: A well-configured Paper server can support 100+ concurrent players on modest hardware (6GB RAM, 4 CPU cores). Compare that to Minecraft Realms’ 10-player limit, and you see why self-hosting is so popular.
Let’s build your Minecraft empire.
Prerequisites
Hardware Requirements
Minimum Specifications (1-10 players):
- CPU: 2 cores @ 3.0GHz+ (single-thread performance matters!)
- RAM: 4GB (2GB for server, 2GB for OS)
- Storage: 10GB SSD (worlds grow over time)
- Network: 10 Mbps upload (1 Mbps per 5-10 players)
Recommended Specifications (10-50 players):
- CPU: 4 cores @ 3.5GHz+ (Intel i5/Ryzen 5 or better)
- RAM: 8GB (6GB for server, 2GB for OS)
- Storage: 50GB SSD/NVMe (fast storage dramatically improves chunk loading)
- Network: 50 Mbps upload
High-Performance Setup (50+ players, modded servers):
- CPU: 6-8 cores @ 4.0GHz+ (Ryzen 7/i7 or better)
- RAM: 16GB+ (12GB for server)
- Storage: 100GB+ NVMe SSD
- Network: 100 Mbps+ upload
Why single-thread performance matters: Minecraft’s core game loop is heavily single-threaded. A 4-core CPU @ 4.5GHz will outperform an 8-core CPU @ 3.0GHz for Minecraft servers.
Software Prerequisites
Operating System:
- Linux: Ubuntu Server 22.04/24.04 (recommended), Debian 11/12
- Windows: Windows 10/11, Windows Server (works but less efficient)
- macOS: Supported but not recommended for production
Required Software:
- Java Runtime Environment:
- Minecraft 1.20.5+: Java 21 (latest)
- Minecraft 1.17-1.20.4: Java 17
- Minecraft 1.16.5 and older: Java 8 or 11
- Docker (optional but recommended for easy deployment)
- Screen or tmux (for running server in background without Docker)
Network Requirements:
- Port forwarding: Ability to forward port 25565 (Java) and/or 19132 (Bedrock)
- Static IP or DDNS: So players can reliably connect
- No CGNAT: Some ISPs use carrier-grade NAT which prevents port forwarding
Knowledge Assumptions
You should be comfortable with:
- Basic command line operations (cd, ls, nano/vim)
- File editing and navigation
- Basic networking concepts (IP addresses, ports)
Helpful but not required:
- Docker basics
- Java fundamentals
- Linux server administration
Java vs. Bedrock: Choosing Your Edition
Minecraft has two distinct editions with different server software.
Java Edition
Platform: PC, Mac, Linux Protocol: Java-based Modding: Extensive mod and plugin ecosystem
Pros:
- Massive plugin library (Spigot, Paper, Bukkit)
- Full modding support (Forge, Fabric, Quilt)
- Better performance optimization (Paper, Purpur)
- Command blocks and redstone work consistently
- Free server software with no licensing
Cons:
- Java Edition clients only (no console/mobile)
- Slightly higher resource usage
- Requires Java installation
Best for:
- PC gamers
- Modded gameplay
- Custom plugins and advanced features
- Competitive/technical Minecraft
Bedrock Edition
Platform: Windows 10/11, Xbox, PlayStation, Switch, Mobile Protocol: C++ based Modding: Limited to behavior packs and addons
Pros:
- Cross-platform (console, mobile, Windows 10)
- Better performance on identical hardware
- Official support from Mojang
- Mobile player support
Cons:
- Limited plugin/mod ecosystem
- Requires behavior packs instead of mods
- Less mature server optimization
- Some redstone mechanics differ from Java
Best for:
- Cross-platform play (console + mobile + PC)
- Casual servers
- Players without gaming PCs
The Hybrid Solution: GeyserMC
Want both Java and Bedrock players on the same server?
GeyserMC is a proxy that translates between Java and Bedrock protocols:
Bedrock Players (Mobile/Console)
↓
GeyserMC Proxy
↓
Java Edition Server
↑
Java Players (PC) Result: One server, both player types!
This guide focuses on Java Edition (most popular for self-hosting), but we’ll cover GeyserMC integration later.
Server Software Options
Choosing the right server software is crucial. Here’s the landscape:
Vanilla (Official Mojang Server)
What it is: Official server software from Mojang Download: https://www.minecraft.net/en-us/download/server
Pros:
- Official, guaranteed compatibility
- No modifications, pure Minecraft experience
- Lightweight (relatively)
Cons:
- No plugin support
- No performance optimizations
- Limited configuration options
- Poor performance with many players
Use case: Small servers (under 5 players), testing, vanilla purists
Paper (Recommended for Most Users)
What it is: High-performance fork of Spigot with extensive optimizations Website: https://papermc.io/
Pros:
- Massive performance improvements over Vanilla (2-3x better)
- Full plugin support (Spigot/Bukkit plugins)
- Active development and updates
- Excellent configuration options
- Built-in anti-cheat improvements
- Async chunk loading
Cons:
- Minor gameplay changes for performance (configurable)
- Not “pure vanilla” (though very close)
Use case: 90% of Java Edition servers - best balance of performance and features
Performance example:
- Vanilla: 20 TPS with 30 players, 4GB RAM
- Paper: 20 TPS with 80 players, 4GB RAM
Purpur
What it is: Fork of Paper with even more features and customization Website: https://purpurmc.org/
Pros:
- All Paper benefits
- Additional gameplay tweaks (rideable dolphins, controllable pets, etc.)
- More configuration options
- Community-driven features
Cons:
- Sometimes trails Paper updates by a few days
- More complexity in configuration
Use case: Power users wanting maximum customization
Fabric
What it is: Lightweight modding framework Website: https://fabricmc.net/
Pros:
- Modern modding API
- Faster updates than Forge
- Performance-focused mods available
- Can run alongside optimization mods
Cons:
- No plugin support (uses mods instead)
- Smaller mod ecosystem than Forge
- Requires compatible mods
Use case: Modded servers with modern mods, technical gameplay enhancements
Popular Fabric mods:
- Lithium: Performance optimization
- Phosphor: Lighting engine optimization
- Starlight: Even faster lighting
- FerriteCore: Memory optimization
Forge
What it is: Traditional modding framework Website: https://files.minecraftforge.net/
Pros:
- Largest mod ecosystem
- Mature, well-documented
- Supports complex mods (tech mods, magic mods, etc.)
Cons:
- Heavy resource usage
- Slower updates
- Compatibility issues between mods
- No plugin support
Use case: Large modpack servers (FTB, SkyFactory, etc.)
Comparison Matrix
| Feature | Vanilla | Paper | Purpur | Fabric | Forge |
|---|---|---|---|---|---|
| Plugins | ❌ | ✅ | ✅ | ❌ | ❌ |
| Mods | ❌ | ❌ | ❌ | ✅ | ✅ |
| Performance | ⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐ |
| Player Count | 10 | 100+ | 100+ | 50+ | 30+ |
| Complexity | Low | Low | Medium | High | High |
Our recommendation: Start with Paper unless you specifically need mods.
Installing Minecraft Server (Paper)
Let’s deploy a production-ready Paper server.
Method 1: Manual Installation (Understanding the Basics)
Step 1: Install Java 21
On Ubuntu/Debian:
# Update package lists
sudo apt update
# Install OpenJDK 21
sudo apt install -y openjdk-21-jdk
# Verify installation
java -version
# Should show: openjdk version "21.x.x" On Windows:
- Download Java 21 from https://adoptium.net/
- Install the MSI package
- Verify in PowerShell:
java -version
Step 2: Create Server Directory
# Create directory
mkdir -p ~/minecraft-server
cd ~/minecraft-server Step 3: Download Paper
# Download latest Paper (replace VERSION with current, e.g., 1.20.4)
wget https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/latest/downloads/paper-1.20.4-latest.jar -O paper.jar
# Or use curl:
curl -o paper.jar https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/latest/downloads/paper-1.20.4-latest.jar Step 4: Create Start Script
On Linux:
nano start.sh Add this content (for 4GB server):
#!/bin/bash
java -Xms4G -Xmx4G -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 -Daikars.new.flags=true -jar paper.jar --nogui Make executable:
chmod +x start.sh On Windows (start.bat):
@echo off
java -Xms4G -Xmx4G -jar paper.jar --nogui
pause Step 5: First Run (Accept EULA)
# Run server for first time
./start.sh Server will generate files and stop with:
You need to agree to the EULA in order to run the server. Accept EULA:
nano eula.txt
# Change: eula=false
# To: eula=true Step 6: Start Server
./start.sh Watch server boot:
[Server thread/INFO]: Starting Minecraft server on *:25565
[Server thread/INFO]: Done! For help, type "help" Your server is running! Connect with localhost:25565 locally or YOUR-SERVER-IP:25565 remotely.
Method 2: Docker Deployment (Recommended)
Why Docker?
- Easy updates (pull new image)
- Isolated environment
- Persistent data via volumes
- Easy backup/restore
- No manual Java installation
Step 1: Create Directory Structure
mkdir -p ~/minecraft-docker/{data,plugins,config}
cd ~/minecraft-docker Step 2: Create docker-compose.yml
nano docker-compose.yml Add this configuration:
version: '3.8'
services:
minecraft:
image: itzg/minecraft-server:java21
container_name: minecraft-server
restart: unless-stopped
ports:
- "25565:25565" # Minecraft Java port
environment:
# Server type
TYPE: "PAPER"
VERSION: "1.20.4"
# Server configuration
EULA: "TRUE"
SERVER_NAME: "My Homelab Server"
MOTD: "Welcome to my self-hosted server!"
DIFFICULTY: "normal"
MODE: "survival"
MAX_PLAYERS: "50"
VIEW_DISTANCE: "10"
# Performance
MEMORY: "4G"
JVM_XX_OPTS: "-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200"
# World settings
LEVEL_TYPE: "minecraft:normal"
SEED: "" # Leave empty for random, or set specific seed
ALLOW_NETHER: "true"
ENABLE_COMMAND_BLOCK: "true"
# Gameplay
PVP: "true"
SPAWN_PROTECTION: "16"
SPAWN_MONSTERS: "true"
SPAWN_ANIMALS: "true"
SPAWN_NPCS: "true"
# Network
ENABLE_RCON: "true"
RCON_PASSWORD: "change-this-password"
RCON_PORT: "25575"
# Operators (admin users)
OPS: "YourMinecraftUsername"
volumes:
- ./data:/data
- ./plugins:/plugins
- ./config:/config
# Resource limits
deploy:
resources:
limits:
memory: 6G
reservations:
memory: 4G
networks:
- minecraft-network
networks:
minecraft-network:
driver: bridge Step 3: Start Server
docker compose up -d Watch logs:
docker compose logs -f minecraft Server ready when you see:
[Server thread/INFO]: Done! For help, type "help" Step 4: Execute Commands
# Attach to console
docker attach minecraft-server
# Press Ctrl+P then Ctrl+Q to detach without stopping
# Execute single command
docker exec minecraft-server rcon-cli say Hello from Docker!
# Stop server
docker compose stop
# Start server
docker compose start
# Restart server
docker compose restart Method 3: Pterodactyl Panel Deployment
If you followed our Pterodactyl guide:
- Create new server in Pterodactyl Panel
- Egg: Select “Paper”
- Version: 1.20.4 (or latest)
- Allocate: 4GB RAM, 2 CPU cores, 10GB disk
- Click “Create Server”
- Server auto-installs and starts!
Benefits:
- Web-based file manager
- Console access via browser
- User permissions
- Scheduled restarts and backups
Initial Configuration
Now let’s configure your server for optimal gameplay.
Server.properties Configuration
Location: data/server.properties (Docker) or ~/minecraft-server/server.properties (manual)
Essential settings:
# Server identity
server-name=My Homelab Server
motd=A Minecraft Server running on Paper
server-port=25565
# Gameplay
gamemode=survival
difficulty=normal
hardcore=false
pvp=true
max-players=50
# Performance
view-distance=10
simulation-distance=8
max-tick-time=60000
# World settings
level-name=world
level-seed=
level-type=minecraft:normal
generate-structures=true
spawn-protection=16
# Monsters and animals
spawn-monsters=true
spawn-animals=true
spawn-npcs=true
# Network
enable-rcon=true
rcon.password=your-secure-password
rcon.port=25575
enable-query=true
# Security
online-mode=true
prevent-proxy-connections=false
enforce-whitelist=false
white-list=false
# Misc
allow-flight=false
enable-command-block=true Key settings explained:
view-distance:
- How many chunks players can see (radius)
- Higher = prettier, but more resource-intensive
- Recommended: 8-12 for most servers
simulation-distance:
- How far away chunks are actively simulated
- Lower than view-distance for performance
- Recommended: 6-8
max-players:
- Maximum concurrent players
- Set realistically based on your hardware
online-mode:
true: Requires official Minecraft accounts (recommended)false: Allows cracked clients (against Mojang EULA)
Restart server after changes:
# Docker
docker compose restart minecraft
# Manual
# Stop server (type "stop" in console)
# Then run: ./start.sh Paper-Specific Configuration
Paper adds its own configuration files with powerful optimizations.
config/paper-global.yml:
# Async chunk loading (huge performance boost)
chunk-loading:
async-chunks: true
min-load-radius: 2
max-concurrent-sends: 2
autoconfig-send-distance: true
# Anti-cheat improvements
anticheat:
anti-xray:
enabled: true
engine-mode: 2
hidden-blocks:
- copper_ore
- deepslate_copper_ore
- gold_ore
- deepslate_gold_ore
- iron_ore
- deepslate_iron_ore
- coal_ore
- deepslate_coal_ore
- lapis_ore
- deepslate_lapis_ore
- diamond_ore
- deepslate_diamond_ore
- redstone_ore
- deepslate_redstone_ore
- emerald_ore
- deepslate_emerald_ore
# Tick optimizations
timings:
enabled: true
server-name: My Server
url: https://timings.aikar.co config/paper-world-defaults.yml:
# Entity optimizations
entities:
spawning:
# Reduce spawn rates for performance
monster-spawn-max-light-level: 0
all-chunks-are-slime-chunks: false
behavior:
# Performance tweaks
disable-chest-cat-detection: false
spawner-nerfed-mobs-should-jump: false
# Hopper optimizations
hopper:
cooldown-when-full: true
disable-move-event: false
# Redstone optimizations
redstone:
implementation: vanilla Apply changes:
# Reload config without restart
docker exec minecraft-server rcon-cli reload
# Or restart
docker compose restart minecraft Plugin Installation & Management
Plugins extend your server with custom features without modifying core game code.
Popular Essential Plugins
Server Management:
1. EssentialsX
- Commands: /home, /warp, /tpa, /spawn
- Economy system
- Kits and signs
- Download: https://essentialsx.net/
2. LuckPerms
- Advanced permission management
- User groups and ranks
- Timed permissions
- Download: https://luckperms.net/
3. Vault
- Economy API (required by many plugins)
- Permission abstraction
- Download: https://www.spigotmc.org/resources/vault.34315/
World Protection:
4. WorldGuard
- Protect regions from griefing
- Flag-based permissions
- Custom build restrictions
- Download: https://enginehub.org/worldguard
5. CoreProtect
- Block logging and rollback
- “Time machine” for your world
- Investigate griefing
- Download: https://www.spigotmc.org/resources/coreprotect.8631/
Performance:
6. ClearLagg
- Remove entities to reduce lag
- Stack items
- Auto-clear warnings
- Download: https://www.spigotmc.org/resources/clearlagg.68271/
7. ChunkMaster
- Pre-generate chunks
- Reduces lag when exploring
- Download: https://www.spigotmc.org/resources/chunkmaster.71351/
Gameplay Enhancement:
8. GriefPrevention
- Let players claim land
- Automatic protection
- No admin needed
- Download: https://www.spigotmc.org/resources/griefprevention.1884/
9. DiscordSRV
- Link Minecraft chat to Discord
- See in-game events in Discord
- Chat between platforms
- Download: https://www.spigotmc.org/resources/discordsrv.18494/
Installing Plugins (Docker)
Method 1: Manual installation
# Navigate to plugins directory
cd ~/minecraft-docker/plugins
# Download plugin JAR
wget https://github.com/EssentialsX/Essentials/releases/download/2.20.1/EssentialsX-2.20.1.jar
# Restart server to load
docker compose restart minecraft Method 2: Using Docker environment variable
Edit docker-compose.yml:
environment:
# Add this:
SPIGET_RESOURCES: "9089,28140,34315" # Plugin IDs from Spigot
# 9089 = EssentialsX
# 28140 = LuckPerms
# 34315 = Vault Restart:
docker compose up -d Plugins auto-download and install!
Installing Plugins (Manual)
# Navigate to server directory
cd ~/minecraft-server/plugins
# Download plugin
wget https://plugin-download-url/plugin.jar
# Restart server
# (type "stop" in console, then ./start.sh) Plugin Configuration
Plugins create config folders:
plugins/
├── EssentialsX/
│ ├── config.yml
│ ├── kits.yml
│ └── worth.yml
├── LuckPerms/
│ └── config.yml
└── WorldGuard/
└── config.yml Example: Configure EssentialsX:
nano plugins/EssentialsX/config.yml Key settings:
# Teleport delays (prevent combat logging)
teleport-delay: 3
teleport-delay-combat: 10
# Starting items for new players
starter-kit:
items:
- 276 1 # Diamond sword
- 363 32 # Steak
# Spawn settings
spawn-on-join: true
spawn-on-newbie: true
# Economy
economy:
starting-balance: 1000
max-money: 100000000 Reload config:
docker exec minecraft-server rcon-cli ess reload Performance Optimization
Let’s make your server run smoothly for maximum players.
JVM (Java) Optimizations
Aikar’s Flags (Industry Standard):
These flags dramatically improve garbage collection and memory usage.
For 4GB server:
java -Xms4G -Xmx4G -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.jar --nogui For 8GB server:
java -Xms8G -Xmx8G [rest of flags same] -jar paper.jar --nogui Key parameters:
-Xmsand-Xmx: Must be identical (prevents memory resizing lag)-XX:+UseG1GC: Use G1 garbage collector (best for Minecraft)-XX:MaxGCPauseMillis=200: Target max GC pause time
Paper Configuration Optimizations
config/paper-world-defaults.yml:
# Reduce entity activation ranges
entities:
behavior:
spawner-nerfed-mobs-should-jump: false
spawning:
alt-item-despawn-rate:
enabled: true
items:
cobblestone: 300 # Despawn cobblestone faster
netherrack: 300
sand: 300
red_sand: 300
gravel: 300
dirt: 300
# Entity activation range (how far away entities are active)
tick-ranges:
monster: 32
animal: 16
misc: 8
# Hopper optimizations
hopper:
cooldown-when-full: true
disable-move-event: false
# Optimize chunk ticking
chunk-loading:
max-concurrent-sends: 2
min-load-radius: 2 config/spigot.yml:
# Mob spawn limits (reduce for better performance)
mob-spawn-range: 6 # Down from default 8
# Entity activation ranges
entity-activation-range:
animals: 16
monsters: 24
raiders: 48
misc: 8
water: 8
villagers: 16
flying-monsters: 32
# Merge radius (merge item stacks and exp orbs)
merge-radius:
item: 4.0
exp: 6.0
# Growth and decay rates (reduce for performance)
growth:
cactus-modifier: 100
cane-modifier: 100
melon-modifier: 100
mushroom-modifier: 100
pumpkin-modifier: 100
sapling-modifier: 100
beetroot-modifier: 100
carrot-modifier: 100
potato-modifier: 100
wheat-modifier: 100 World Pre-generation
Why pre-generate?
- Eliminates lag when players explore new chunks
- Reduces CPU usage during gameplay
- Smoother experience
Using ChunkMaster plugin:
# Install ChunkMaster
# Download from: https://www.spigotmc.org/resources/chunkmaster.71351/
# In-game or via RCON:
/chunkmaster generate world 5000 # Pre-generate 5000 block radius
/chunkmaster generate world_nether 3000 # Pre-generate nether
/chunkmaster list # View progress Pre-generation runs in background, can take hours for large areas.
Monitoring Performance
In-game TPS check:
/tps
# Healthy server: 20.0 TPS
# Laggy server: under 15 TPS Timings Report (Paper feature):
/timings on
# Let server run for 10-15 minutes
/timings paste Generates URL with detailed performance analysis:
- Which plugins are laggy
- What entities cause lag
- Which chunks are resource-intensive
Fix identified issues based on timings report.
Backup & Disaster Recovery
Never lose your world data again.
Automated Backups with Docker
Update docker-compose.yml:
services:
minecraft:
# ... existing config ...
environment:
# Add backup settings
ENABLE_ROLLING_LOGS: "true"
backup:
image: itzg/mc-backup
container_name: minecraft-backup
restart: unless-stopped
environment:
BACKUP_INTERVAL: "4h" # Backup every 4 hours
PRUNE_BACKUPS_DAYS: "7" # Keep backups for 7 days
RCON_HOST: minecraft
RCON_PASSWORD: "change-this-password"
INITIAL_DELAY: "5m" # Wait 5 min after start before first backup
volumes:
- ./data:/data:ro # Read-only access to server data
- ./backups:/backups # Where to store backups
networks:
- minecraft-network
depends_on:
- minecraft Restart to enable backups:
docker compose up -d Backups appear in ./backups/ directory!
Manual Backup (Non-Docker)
Create backup script:
nano ~/backup-minecraft.sh Script content:
#!/bin/bash
# Configuration
SERVER_DIR="/home/user/minecraft-server"
BACKUP_DIR="/home/user/minecraft-backups"
DATE=$(date +%Y-%m-%d_%H-%M-%S)
BACKUP_NAME="minecraft-backup-$DATE.tar.gz"
# Create backup directory if it doesn't exist
mkdir -p "$BACKUP_DIR"
# Create backup
echo "Starting backup..."
tar -czf "$BACKUP_DIR/$BACKUP_NAME" -C "$SERVER_DIR" world world_nether world_the_end plugins server.properties
# Keep only last 7 days of backups
find "$BACKUP_DIR" -name "minecraft-backup-*.tar.gz" -mtime +7 -delete
echo "Backup complete: $BACKUP_NAME" Make executable:
chmod +x ~/backup-minecraft.sh Schedule with cron (daily at 3 AM):
crontab -e
# Add:
0 3 * * * /home/user/backup-minecraft.sh Restoring from Backup
Docker method:
# Stop server
docker compose stop minecraft
# Remove current world
rm -rf ./data/world ./data/world_nether ./data/world_the_end
# Extract backup
tar -xzf ./backups/minecraft-backup-2025-12-16.tar.gz -C ./data/
# Start server
docker compose start minecraft Manual method:
# Stop server (type "stop" in console)
# Backup current state (just in case)
mv ~/minecraft-server/world ~/minecraft-server/world.old
# Extract backup
tar -xzf ~/minecraft-backups/minecraft-backup-2025-12-16.tar.gz -C ~/minecraft-server/
# Start server
./start.sh Supporting Bedrock Players (GeyserMC)
Let mobile and console players join your Java server!
Installing GeyserMC (Docker)
Update docker-compose.yml:
services:
minecraft:
# ... existing config ...
geyser:
image: ghcr.io/geysermc/geyser:latest
container_name: geyser
restart: unless-stopped
ports:
- "19132:19132/udp" # Bedrock port
volumes:
- ./geyser:/data
environment:
# Connect to your Java server
REMOTE_HOST: minecraft
REMOTE_PORT: 25565
networks:
- minecraft-network
depends_on:
- minecraft Start Geyser:
docker compose up -d Now Bedrock players can connect:
- IP: YOUR-SERVER-IP
- Port: 19132
They’ll join the same world as Java players!
Installing GeyserMC (Manual)
As a plugin (easier):
cd ~/minecraft-server/plugins
wget https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot
mv spigot Geyser-Spigot.jar
# Restart server Configure:
nano plugins/Geyser-Spigot/config.yml bedrock:
address: 0.0.0.0
port: 19132
remote:
address: 127.0.0.1
port: 25565
auth-type: online Restart server, Bedrock players can now connect!
Floodgate (Optional)
Allows Bedrock players without Java accounts:
cd ~/minecraft-server/plugins
wget https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot
mv spigot Floodgate-Spigot.jar Restart server. Bedrock players will appear with . prefix (e.g., .BedrockPlayer)
Security Best Practices
Protect your server from common threats.
1. Enable Whitelist
# Enable whitelist
docker exec minecraft-server rcon-cli whitelist on
# Add players
docker exec minecraft-server rcon-cli whitelist add PlayerName Or edit whitelist.json directly:
[
{
"uuid": "player-uuid-here",
"name": "PlayerName"
}
] 2. Configure Anti-Cheat (Paper)
config/paper-global.yml:
anticheat:
anti-xray:
enabled: true
engine-mode: 2 # Strongest protection 3. Install Anti-Grief Plugins
CoreProtect (logging and rollback):
# Rollback griefing
/co rollback u:BadPlayer t:24h r:100 GriefPrevention (land claims):
- Players use golden shovel to claim land
- Only claim owners can build
- Auto-protection, no admin intervention
4. Rate Limiting & DDoS Protection
Use a proxy like TCPShield or Cloudflare Spectrum:
- Hides your real IP
- Filters DDoS traffic
- Free tier available
Or configure firewall rate limiting:
# Limit new connections
sudo iptables -A INPUT -p tcp --dport 25565 -m state --state NEW -m recent --set
sudo iptables -A INPUT -p tcp --dport 25565 -m state --state NEW -m recent --update --seconds 60 --hitcount 10 -j DROP 5. Disable Unused Features
server.properties:
# Disable RCON if not needed
enable-rcon=false
# Disable query if not needed
enable-query=false Troubleshooting Common Issues
Server Won’t Start
Check Java version:
java -version
# Must be Java 17+ for MC 1.20+ Check EULA:
cat eula.txt
# Must be: eula=true Check logs:
docker compose logs minecraft
# Or: cat ~/minecraft-server/logs/latest.log Players Can’t Connect
Check port forwarding:
- Forward port 25565 on your router
- Point to server’s local IP
Check firewall:
sudo ufw allow 25565/tcp Test externally:
- Use https://mcsrvstat.us/ to check if server is visible
Server Lag / Low TPS
Check TPS:
/tps Generate timings report:
/timings paste Common fixes:
- Reduce view-distance
- Reduce entity spawn rates
- Pre-generate chunks
- Remove laggy plugins
- Upgrade hardware (faster CPU)
Next Steps
Expand your server:
- Add more plugins (minigames, custom items, etc.)
- Create multiple worlds (survival, creative, minigames)
- Set up Discord integration
- Build custom resource packs
Related guides:
- “Pterodactyl: Professional Game Server Management”
- “Game Streaming: Sunshine, Moonlight, and Steam Link”
- “Docker Basics for Homelabs”
Conclusion
You now have a production-ready Minecraft server running on your homelab! Whether you’re hosting for friends or building a community, you have the knowledge to maintain, optimize, and scale your server.
Key takeaways:
- Paper offers best performance for Java Edition
- Docker simplifies deployment and management
- Automated backups prevent data loss
- GeyserMC enables cross-platform play
- Regular optimization keeps server running smoothly
Happy mining and crafting!
Last updated: December 16, 2025 Author: homelabbing.io Difficulty: Beginner Time to complete: 60 minutes