Run SpigotMC Server within Docker Container
Go to file
2024-09-13 17:23:47 +02:00
.gitea/workflows 👷 drop arm64 builds 2024-09-13 17:23:47 +02:00
.editorconfig 🔧 add editorconfig 2024-09-12 20:13:58 +02:00
cmd 🎉 initial codebase 2024-09-12 20:16:59 +02:00
Dockerfile 🎉 initial codebase 2024-09-12 20:16:59 +02:00
entrypoint.sh 🔊 change missing artifacts to info 2024-09-12 20:57:58 +02:00
LICENSE 📄 add license 2024-09-12 20:14:07 +02:00
README.md 📝 initial readme 2024-09-12 20:36:17 +02:00

Spigot Docker

Run SpigotMC Server within Docker Container

Setup Instructions

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.

Run Server Commands

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.

Disable Automatic Updates

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).