This repository contains scripts to easily create a docker image for a desired Minecraft version.
Currently, only the official Minecraft server versions are supported. However, I plan on supporting Minecraft Forge versions in the future.
Make sure you have the required commands installed (listed at the top of build-image.sh
) then run the command below depending on which version you'd like!
The command creates the image with the name minecraft-server:VERSION
. If you're using -r
or -s
, tags of minecraft-server:latest
and minecraft-server:latest-snapshot
are also created, respectively.
./build-image.sh -r
./build-image.sh -s
./build-image.sh -v 1.16.5
- Configure your server settings as you want in
docker-compose.yml
- Start the server:
docker compose up
- Configure the
server.properties
and any other settings in your Minecraft data mount location (minecraft-data
by default), restarting the server if you did so.
- Run the command below, changing any arguments as needed.
docker run -it \ # EULA=true bypasses the eula.txt check -e EULA=true \ # MEMORY=2G sets the server's memory to 2GB of RAM -e MEMORY=2G \ # Makes the server hosted on 25565 (the default Minecraft server port) -p 25565:25565 \ # Mounts the server's data folder to /path/to/minecraft-data (you'll want this path to be a meaningful folder) -v /path/to/minecraft-data:/data \ # Specifies the docker image that was previously built that you want to run the server with (here it will use 1.16.5) minecraft-server:1.16.5
- Configure the
server.properties
and any other settings in your Minecraft data mount location (minecraft-data
by default), restarting the server if you did so.