Sign inSign up

rev9en/minecraft

By rev9en

•Updated over 1 year ago

Docker image with Minecraft Server Java Edition

Image
0

245

rev9en/minecraft repository overview

⁠🐳 docker-minecraft⁠

Docker image with Minecraft Server Java Edition⁠.

The image is currently available on hub.docker.com⁠ and contains:

  • Ubuntu 20.04
  • Latest Java for Ubuntu 20.04
  • Minecraft Server Java Edition
  • Small Web Http Api Server to provide server status.

⁠Usage

⁠Prepeare a working directory

You need to create/use a working directory where the server will be storing all files.

If your working directory is empty, a latest server.jar file will be downloaded from the mojang.com site and all files will be created automatically.

Example of this directory:

./minecraft-server
ā”œā”€ā”€ banned-ips.json
ā”œā”€ā”€ banned-players.json
ā”œā”€ā”€ eula.txt
ā”œā”€ā”€ home
ā”œā”€ā”€ logs
ā”œā”€ā”€ ops.json
ā”œā”€ā”€ server.jar
ā”œā”€ā”€ server.properties
ā”œā”€ā”€ supervisord.log
ā”œā”€ā”€ usercache.json
ā”œā”€ā”€ whitelist.json
└── world
⁠Manage a docker container
⁠Launch a container as a service
docker run -d --restart unless-stopped --name minecraft  \
    --cpus=2 --memory=5G --memory-swap=7G \
    -v "<minecraft working directory>:/opt/minecraft-server" \
    -e MINECRAFT_MEMORY_INIT=2G \
    -e MINECRAFT_MEMORY=4G \
    -e TZ=America/New_York \
    -p 25580:80 -p 25522:22 -p 25565:25565 \
    rev9en/minecraft

After the launch you can:

  • connect into the docker container using ssh: ssh mcuser@server-address -p 25522 (default password: mcuser)
  • see current status of the server in your browser: http://server-address:25580⁠
  • connect to the Minecraft server on the default port 25565

Example output from the web server:

{
  "name": "minecraft server status",
  "status": "OK",
  "address": "localhost:25565",
  "ip": "172.10.10.10",
  "version": "1.16.5",
  "description": "Hardcore Server",
  "external_ip": "172.10.10.10",
  "external_port_open": true,
  "players_count": 2,
  "players_max": 10,
  "latency": 5.8,
  "ping": 2.018
}
⁠Stop a container
docker stop minecraft
⁠See the logs
docker logs minecraft - f

Tag summary

Content type

Image

Digest

sha256:7c4c54904…

Size

287.5 MB

Last updated

over 1 year ago

docker pull rev9en/minecraft