Skip to content

Latest commit

 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minecraft Java Edition in Docker

  1. Downloads newest server jar file automatically.
  2. Sets EULA based on provided environmental variable.
  3. Bind mounts local directory for easy access to your Minecraft worlds. Can be replaced with a named volume if no easy access is required.
  4. Starts server with -Xmx4G -Xms4G -jar server.jar nogui java parameters. Those can be adjusted inside of start.sh file.

Building

Adjust server parameters in start.sh if needed, then run:
docker build -f Dockerfile -t image:tag .

Starting

Option 1: Docker run

Example docker run command
docker run \
-it \
--rm \
-v /home/user/Minecraft/data:/data \
-e EULA=TRUE \
-p 25565:25565 \
image:tag

Option 2: Docker compose

Docker Compose depends on a local .env file to:

  • Accept EULA
  • Select an image
  • Set bind mount directory for server data
.env file template:
MINECRAFT_DATA=/home/user/Minecraft/data
MINECRAFT_IMAGE=image:tag
Start your server with a standard
docker compose up

To do:

  1. Stop baking the jar file into the image and download it when starting the container instead.

About

Vanilla Minecraft server in a Docker container.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages