docker.recipes

Minecraft Server

beginner

Minecraft Java Edition server with RCON support.

Overview

Minecraft Java Edition is the original version of Mojang's legendary sandbox game that revolutionized open-world creativity and multiplayer gaming. First released in 2009, Minecraft allows players to build, explore, and survive in procedurally generated worlds made of blocks, supporting both creative building and survival gameplay modes. The Java Edition remains the most feature-rich version with extensive modding support, regular updates, and the ability to run custom servers with various modifications and plugins. This Docker stack combines the itzg/minecraft-server image with RCON (Remote Console) capabilities to create a fully-featured multiplayer Minecraft server environment. The itzg image is the most popular containerized Minecraft solution, supporting multiple server types including Vanilla, Paper, Forge, Fabric, and Quilt, while RCON provides remote administration capabilities for server management without requiring in-game access. The configuration enables persistent world storage, memory optimization, and flexible server type switching. This setup is perfect for families wanting private servers, gaming communities requiring reliable uptime, and developers testing Minecraft mods or plugins. The combination of Docker containerization with the mature itzg image provides stability and easy updates, while RCON support enables automated server management and integration with external tools like Discord bots or web dashboards.

Key Features

  • Multi-server type support including Vanilla, Paper, Forge, Fabric, Quilt, and Modpack installations
  • RCON protocol integration for remote server administration and command execution
  • Automatic Java Edition version management with support for latest, specific, or snapshot builds
  • Memory allocation optimization with configurable JVM heap size settings
  • Operator permissions system with environment variable configuration for admin users
  • Custom MOTD (Message of the Day) display for server branding and information
  • Interactive TTY support for direct console access and real-time log monitoring
  • Automatic EULA acceptance handling for legal compliance and server startup

Common Use Cases

  • 1Private family Minecraft servers with whitelist protection and custom rules
  • 2Gaming community hosting with modded content and plugin-based gameplay enhancements
  • 3Educational institutions running Minecraft Education Edition alternatives for STEM learning
  • 4Content creators and streamers hosting subscriber-only servers for community engagement
  • 5Minecraft mod and plugin developers requiring test environments with quick reset capabilities
  • 6Home lab enthusiasts running 24/7 servers for friends with automated backups and monitoring
  • 7LAN party organizers needing portable server instances with custom maps and game modes

Prerequisites

  • Docker Engine 20.10+ and Docker Compose V2 for container orchestration support
  • Minimum 3GB RAM available (2GB for Minecraft + 1GB for system overhead)
  • Port 25565 available for Minecraft client connections and port 25575 for RCON access
  • Valid Minecraft Java Edition account for each player connecting to the server
  • Basic understanding of Minecraft server administration and player permission systems
  • Sufficient disk space for world data storage (worlds can grow to several GB over time)

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 minecraft:
3 image: itzg/minecraft-server:latest
4 container_name: minecraft
5 restart: unless-stopped
6 ports:
7 - "${MC_PORT:-25565}:25565"
8 - "${RCON_PORT:-25575}:25575"
9 environment:
10 - EULA=TRUE
11 - TYPE=${SERVER_TYPE:-VANILLA}
12 - VERSION=${MC_VERSION:-LATEST}
13 - MEMORY=${MEMORY:-2G}
14 - RCON_PASSWORD=${RCON_PASSWORD:-minecraft}
15 - ENABLE_RCON=true
16 - OPS=${OPS:-}
17 - MOTD=${MOTD:-A Minecraft Server}
18 volumes:
19 - minecraft_data:/data
20 networks:
21 - minecraft-network
22 tty: true
23 stdin_open: true
24
25volumes:
26 minecraft_data:
27
28networks:
29 minecraft-network:
30 driver: bridge

.env Template

.env
1# Minecraft Server
2MC_PORT=25565
3RCON_PORT=25575
4SERVER_TYPE=VANILLA
5MC_VERSION=LATEST
6MEMORY=2G
7RCON_PASSWORD=minecraft
8OPS=
9MOTD=A Minecraft Server

Usage Notes

  1. 1Server at localhost:25565
  2. 2RCON at localhost:25575
  3. 3Set OPS for admin players
  4. 4Supports Paper, Forge, Fabric, etc.

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 minecraft:
5 image: itzg/minecraft-server:latest
6 container_name: minecraft
7 restart: unless-stopped
8 ports:
9 - "${MC_PORT:-25565}:25565"
10 - "${RCON_PORT:-25575}:25575"
11 environment:
12 - EULA=TRUE
13 - TYPE=${SERVER_TYPE:-VANILLA}
14 - VERSION=${MC_VERSION:-LATEST}
15 - MEMORY=${MEMORY:-2G}
16 - RCON_PASSWORD=${RCON_PASSWORD:-minecraft}
17 - ENABLE_RCON=true
18 - OPS=${OPS:-}
19 - MOTD=${MOTD:-A Minecraft Server}
20 volumes:
21 - minecraft_data:/data
22 networks:
23 - minecraft-network
24 tty: true
25 stdin_open: true
26
27volumes:
28 minecraft_data:
29
30networks:
31 minecraft-network:
32 driver: bridge
33EOF
34
35# 2. Create the .env file
36cat > .env << 'EOF'
37# Minecraft Server
38MC_PORT=25565
39RCON_PORT=25575
40SERVER_TYPE=VANILLA
41MC_VERSION=LATEST
42MEMORY=2G
43RCON_PASSWORD=minecraft
44OPS=
45MOTD=A Minecraft Server
46EOF
47
48# 3. Start the services
49docker compose up -d
50
51# 4. View logs
52docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/minecraft-server/run | bash

Troubleshooting

  • OutOfMemoryError in logs: Increase MEMORY environment variable value or reduce server view distance and entity limits
  • RCON connection refused errors: Verify RCON_PORT is properly forwarded and RCON_PASSWORD matches client configuration
  • Players cannot connect to server: Check firewall rules allow port 25565 and verify MC_PORT environment variable matches client settings
  • Server stuck on 'Loading libraries' message: Insufficient memory allocation, increase MEMORY value to at least 2G for modded servers
  • World corruption after container restart: Ensure proper shutdown using RCON 'stop' command rather than killing container process
  • Mod loading failures with Forge/Fabric: Verify VERSION environment variable matches mod compatibility requirements and all dependencies are present

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space