Run SpigotMC Server within Docker Container
2.2K
Source Code: git.tjdev.de/DrMaxNix/spigot-docker
Run SpigotMC Server within Docker Container
Docker Run (not recommended):
$ docker run -d --name "spigot" --stop-timeout 60 -e AGREE_MINECRAFT_EULA=yes -e MC_VERSION=latest -v ./data:/opt/spigot-data -p 25565:25565 drmaxnix/spigot
Docker Compose (recommended):
services:
main:
image: drmaxnix/spigot
restart: unless-stopped
stop_grace_period: 60s
environment:
AGREE_MINECRAFT_EULA: true
MC_VERSION: "latest"
volumes:
- ./data:/opt/spigot-data
ports:
- "25565:25565"
$ docker compose up -d
Important
Make sure to keep the `--stop-timeout` or `stop_grace_period` option! When stopping, docker will kill the container after 10s; spigot often needs more time than that to save its worlds. Killing it while saving could lead to data loss!
Tip
For both variants, persistent config and data files will be stored in the `./data` directory. Feel free to change this to your needs.
Give yourself OP permissions:
$ docker compose exec main cmd op YourUsernameHere
Note
If you are using docker run, replace `docker compose exec main` with `docker exec -it spigot`.
By default, the container will check for updates when starting. If a new spigot server version is available, it will be built and then used instead of the old one. This behavior can be disabled using AUTO_UPDATE=no.
With automatic updates disabled, the server will only be rebuilt if you delete the jar file (or files in .build-meta) or when changing the Minecraft Version (MC_VERSION).
Content type
Image
Digest
sha256:3284a45b6…
Size
181.9 MB
Last updated
1 day ago
docker pull drmaxnix/spigot