A Dockerfile to build and run both Spigot, Paper and Vanilla Minecraft.
You can quickly try it out with this command:
docker run \
--rm \
-p 25565 \
-it \
ghcr.io/shepherdjerred-minecraft/paper:latest
- Uses the latest Amazon Coretto for the latest Java LTS (currently Java 17)
- Supports the latest versions of Spigot, Paper, and Vanilla Minecraft
- No need to worry about server jarfiles -- just mount a server data directory and go
- Always uses the latest build tools for Spigot and Paper
- Automatically builds every day
Pre-built images are located here:
The following tags are available for these images:
- latest
- 1.20.1
Install Earthly and then run earthly -P +ci
in this directory.
New versions is easy.
- Add the version to the Earthfile
- Add the URL to the vanilla .jar in
vanilla.sh
- Update the base image version
The Docker image has a filesystem as follows:
/home/minecraft/
├── server.jar
└── server/
└── plugins/
The working directory of the image is at /home/minecraft/server
. Your server files should be mounted at /home/minecraft/server
. To use the .jar
provided by the image, you'll have to pass the argument -jar ../server.jar
to Docker so that Java is invoked correctly. This is a bit confusing, but it allows end-users to easily bind-mount their server files.
Note that the server directory does not have a server jarfile.
services:
minecraft:
# Swap paper for `spigot` or `minecraft`
# Swap `1.20.1` with `latest` or another version of Minecraft
image: ghcr.io/shepherdjerred-minecraft/paper:1.20.1
tty: true
stdin_open: true
volumes:
# Change `/path/to/server/files` to the absolute path that your sever fiels are located at
# Do NOT change `/home/minecraft/server`
- /path/to/server/files:/home/minecraft/server:z
ports:
# Change the first 25565 to another port if needed
- 25565:25565/tcp
- 25565:25565/udp
# Change how much memory you're giving Java if needed
# Do NOT change `../server.jar`
command: -Xmx1G -Dcom.mojang.eula.agree=true -jar "../server.jar"
restart: unless-stopped
docker run \
--rm \
--name minecraft \
# Change the first 25565 to another port if needed
-p 25565:25565/tcp \
-p 25565:25565/udp \
# Change `/path/to/server/files` to the absolute path that your sever fiels are located at
# Do NOT change `/home/minecraft/server`
--mount type=bind,source=/path/to/server/files,target=/home/minecraft/server \
-it \
# Swap paper for `spigot` or `minecraft`
# Swap `1.20.1` with `latest` or another version of Minecraft
ghcr.io/shepherdjerred-minecraft/paper:1.20.1 \
# Change how much memory you're giving Java if needed
-Xmx1G \
-Dcom.mojang.eula.agree=true \
# Do NOT change `../server.jar`
-jar "../server.jar"