Self-Hosting Game Servers in Your Home Lab: Minecraft, Valheim, and More
Running game servers is one of the most fun uses for a home lab. Instead of paying monthly for hosted servers or dealing with the limitations of built-in multiplayer, you get full control: custom configurations, mods, whitelists, and the satisfaction of hosting your friends on your own hardware.
Most popular games have dedicated server software that runs on Linux in Docker containers. The LinuxGSM project and various community Docker images make deployment straightforward.

Hardware Requirements
Game servers are RAM-hungry and sometimes CPU-intensive, but the requirements vary wildly by game:
| Game | RAM (minimum) | RAM (recommended) | CPU | Storage |
|---|---|---|---|---|
| Minecraft (Java) | 2GB | 4-8GB | 2+ cores | 2-10GB |
| Minecraft (Bedrock) | 1GB | 2GB | 2 cores | 1-5GB |
| Valheim | 2GB | 4GB | 2+ cores | 2GB |
| Terraria | 512MB | 1GB | 1 core | 500MB |
| Satisfactory | 4GB | 8GB+ | 4 cores | 5-15GB |
| Palworld | 8GB | 16GB | 4 cores | 5-20GB |
| 7 Days to Die | 4GB | 8GB | 4 cores | 10-20GB |
If you're running game servers alongside other home lab services, plan for the game server's RAM to be dedicated. Minecraft with 10 players and mods will happily consume 6-8GB of RAM and get cranky if it has to share.
Minecraft Server (Java Edition)
Minecraft is the quintessential self-hosted game server. The itzg/minecraft-server Docker image is the gold standard — it handles server updates, mod loaders, and configuration automatically.
Basic Server
services:
minecraft:
image: itzg/minecraft-server
container_name: minecraft
restart: unless-stopped
ports:
- "25565:25565"
volumes:
- ./minecraft-data:/data
environment:
EULA: "TRUE"
MEMORY: "4G"
TYPE: "PAPER"
DIFFICULTY: "normal"
MAX_PLAYERS: 10
MOTD: "Home Lab Minecraft"
VIEW_DISTANCE: 12
SPAWN_PROTECTION: 0
tty: true
stdin_open: true
Key Configuration Choices
Server type: The TYPE environment variable controls which server software to use:
VANILLA— Official Mojang server. No mods, no plugins. Simplest.PAPER— Drop-in replacement with performance optimizations. Supports Bukkit/Spigot plugins. Recommended for most setups.FABRIC— Lightweight mod loader. Best for modded survival experiences.FORGE— The classic mod loader. Larger mod ecosystem but heavier.
Memory allocation: Set MEMORY to how much RAM you want dedicated to the JVM. For a vanilla server with 5-10 players, 4GB is comfortable. For heavily modded servers, 6-8GB.
Performance Optimization
Minecraft (Java Edition) is famously single-threaded for its main game loop. A fast single-core CPU matters more than many cores. To improve performance:
- Use Paper: It includes dozens of performance patches over vanilla.
- Reduce view distance:
VIEW_DISTANCE: 10instead of the default 12-16 dramatically reduces chunk loading. - Pre-generate chunks: Use a plugin like Chunky to pre-generate the world before players join. Chunk generation is the biggest performance killer.
- Use Aikar's JVM flags: The itzg image supports these automatically, but verify with
JVM_XX_OPTS.
environment:
JVM_XX_OPTS: "-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"
Valheim
Valheim's dedicated server runs well in Docker. The lloesche/valheim-server image handles updates and provides a nice management interface.
services:
valheim:
image: lloesche/valheim-server
container_name: valheim
restart: unless-stopped
ports:
- "2456-2457:2456-2457/udp"
volumes:
- ./valheim-config:/config
- ./valheim-data:/opt/valheim
environment:
SERVER_NAME: "Home Lab Valheim"
WORLD_NAME: "HomeLab"
SERVER_PASS: "changeme"
BACKUPS: "true"
BACKUPS_INTERVAL: 3600
BACKUPS_MAX_AGE: 3
cap_add:
- sys_nice
Valheim is relatively lightweight compared to Minecraft. A 2-core, 4GB RAM allocation handles 5-10 players comfortably. The server needs to generate terrain as players explore, so CPU usage spikes when someone travels to a new area.
Backups
The lloesche image has built-in backup support. Set BACKUPS: "true" and it automatically creates world backups at the specified interval. Critical for a game where a bug or griefer can destroy hours of building.
Terraria
Terraria is the lightest game server you'll run. It needs almost no resources.
services:
terraria:
image: ryshe/terraria:latest
container_name: terraria
restart: unless-stopped
ports:
- "7777:7777"
volumes:
- ./terraria-data:/root/.local/share/Terraria/Worlds
environment:
WORLD_FILENAME: "HomeLabWorld.wld"
AUTOCREATE: "2"
WORLDNAME: "HomeLabWorld"
DIFFICULTY: "0"
MAXPLAYERS: "8"
tty: true
stdin_open: true
512MB of RAM and a single CPU core handles a full Terraria server. It's the perfect game to add to your home lab if you have limited spare resources.
Networking
Port Forwarding
For friends to connect from outside your network, you need to forward the game's ports through your router:
- Minecraft: TCP 25565
- Valheim: UDP 2456-2457
- Terraria: TCP 7777
Using a Reverse Proxy
Game servers use raw TCP/UDP, not HTTP, so a standard reverse proxy (Traefik, Caddy) won't work directly. However, you can use your reverse proxy for web-based management panels.
For the game traffic itself, port forwarding or a VPN is the way to go.
Tailscale / WireGuard
The most secure approach is to skip port forwarding entirely and use a mesh VPN. Have everyone install Tailscale (or WireGuard), and they connect to your server's private IP. No ports exposed to the internet, no DDoS risk, and latency is usually only 1-3ms higher than direct connection.
Automated Backups
Beyond built-in backup features, set up a cron job that backs up game data:
#!/bin/bash
# Backup game servers daily
BACKUP_DIR="/data/backups/games/$(date +%Y-%m-%d)"
mkdir -p "$BACKUP_DIR"
# Stop containers briefly for consistent backups
docker stop minecraft valheim terraria
# Copy data
cp -r /path/to/minecraft-data "$BACKUP_DIR/minecraft"
cp -r /path/to/valheim-data "$BACKUP_DIR/valheim"
cp -r /path/to/terraria-data "$BACKUP_DIR/terraria"
# Restart
docker start minecraft valheim terraria
# Clean up old backups (keep 7 days)
find /data/backups/games -maxdepth 1 -mtime +7 -exec rm -rf {} +
For a less disruptive approach, many game servers support saving the world while running. Minecraft accepts save-all via RCON, and you can copy the world files while the server continues running.
Running Game Servers Alongside Other Services
If your home lab also runs production services (NAS, monitoring, Home Assistant), keep game servers from starving other workloads:
Docker Resource Limits
services:
minecraft:
deploy:
resources:
limits:
cpus: "4.0"
memory: 6G
reservations:
memory: 4G
Separate VM
Run game servers in a dedicated Proxmox VM with fixed CPU and RAM allocation. This guarantees your other services aren't affected when 10 players load new chunks simultaneously.
Scheduling
If game servers are only used on evenings and weekends, stop them during off-hours:
# Start game servers at 5 PM, stop at midnight
0 17 * * * docker start minecraft valheim
0 0 * * * docker stop minecraft valheim
Or use Wake-on-LAN if the game server runs on dedicated hardware — power it on when someone wants to play and shut it down when the last player leaves.
Game servers are a gateway into home labbing for a lot of people. The desire to host a Minecraft server for friends leads to learning Docker, networking, backups, and remote management. It's a legitimately good way to learn system administration while having fun.