- Introduction
- Prerequisites
- Project Structure
- Quickstart
- Usage and Configuration
- Verify Server Status
- Minimal docker-compose.yml
- Stop and Cleanup
- Contact
- Checklist
This repository provides a minimal Docker-based setup for running a Minecraft server using Docker Compose. It demonstrates containerization, volume persistence, and external availability checks via mcstatus — without requiring the Minecraft game client or in-depth knowledge of the game itself.
- A V-Server running Ubuntu/Debian
- Docker
Ensure your system is up to date:
sudo apt update && sudo apt install -y docker.io docker-compose gitminecraft-server/
├── docker-compose.yml
├── .gitignore
└── data/ # Automatically created when the server runs it includes all the server data including settings etcpp
- Install dependencies:
sudo apt update && sudo apt install -y docker.io docker-compose git - Clone the repository:
git clone git@github.com:BenjaminTietz/minecraft-server.git cd mincraft-server - Generate and configure the .env file:
The environment file will be created automatically from env.template. Adjust the values to match your setup (optional):cp env_template.txt .env nano .env (optional)
- Start the Minecraft server:
docker-compose up -d
- Install
mcstatusand check server status:python -m pip install mcstatus mcstatus localhost:25565 status
You can configure the server using environment variables in .env.
EULA: "TRUE" # Required to accept Minecraft EULA
MOTD: "Welcome to my server!" # Message of the DayAll world data and configuration are persisted in the ./data folder:
volumes:
- ./data:/dataThe default Minecraft port is exposed:
ports:
- "25565:25565"For cloud deployments, you may map it to another port, e.g., 8888:25565.
python -m pip install mcstatusmcstatus localhost:25565 statusversion: v1.21.5 (protocol 770)
motd: "A Minecraft Server"
players: 0/20 No players onlineservices:
minecraft-server:
image: itzg/minecraft-server #This is an offical commuity image
container_name: mc-server
ports:
- "25565:25565"
environment:
EULA: "TRUE" # (optional) use an .env
volumes:
- ./data:/data
restart: on-failuredocker-compose downTo remove all persisted data:
rm -rf ./data