Standalone Docker image for PaperMC with pinned builds and verified downloads.
2.2K
Standalone Docker image for PaperMC. Originally forked from phyremaster/papermc; the startup script has since been rewritten.
PaperPilot is upcoming and work in progress. It is a separate management tool currently in development. Its management features and integration with this image are not available yet. This image works independently and does not require PaperPilot.
Choose a Minecraft version and exact stable Paper build from the official downloads service. Example tested target: Minecraft 26.3, Paper build 226. Review and accept the Minecraft EULA before setting EULA=true.
services:
minecraft:
image: oeschme/papermc:1.2.0
environment:
EULA: "true"
MC_VERSION: "26.3"
PAPER_BUILD: "226"
PAPER_CHANNEL: "STABLE"
MC_RAM: "4G"
MC_RAM_MIN: "1G"
ports:
- "25565:25565/tcp"
volumes:
- minecraft-data:/papermc
restart: unless-stopped
stop_grace_period: 60s
volumes:
minecraft-data:
Save as compose.yml, then run docker compose up -d. Existing-server operators must keep their current world/plugin mounts, ports, networks and configuration owner; this example is not permission to replace a running deployment. Environment changes require container recreation, e.g. docker compose up -d after editing the source configuration, rather than only a restart.
Default process UID remains root for compatibility with existing volume ownership. For an unprivileged standalone run, specify user: "<uid>:<gid>" and prepare the data directory with matching ownership/write access. The image does not recursively chown existing server data, install a controller or mount the Docker socket.
| Variable | Default | Meaning |
|---|---|---|
MC_VERSION | latest | Explicit MC version, or newest version with a build in the selected channel. Exact pins are recommended. |
PAPER_BUILD | latest | Exact positive build number or greatest numeric build ID in the selected MC version/channel. Exact build requires explicit MC version. |
PAPER_CHANNEL | STABLE | Required channel for both latest and exact build selection. Set deliberately to use nonstable builds. |
PAPER_PROJECT | paper | Official Paper Downloads project ID. Defaults/tests/documented compatibility target Paper; other projects are not promised production support. |
PAPER_UA | Project-identifying User-Agent with this source URL | Sent to the Paper service and download requests. May be replaced with an identifying operator contact. |
EULA | false | Only true explicitly permits startup. A refusal happens before download/world changes. |
MC_RAM | empty | Maximum Java heap; also minimum heap if MC_RAM_MIN is unset. Empty leaves JVM defaults. |
MC_RAM_MIN | empty | Minimum heap; ignored unless MC_RAM is supplied. Sizes are positive integers with optional K/M/G suffix. |
JAVA_OPTS | empty | Whitespace-delimited extra JVM arguments. Shell syntax, quoting and glob expansion are not evaluated. Do not put secrets in arguments. |
PAPER_DATA_DIR | /papermc | Existing writable absolute data directory. Mount that directory if overriding it; /papermc remains the image's declared volume. |
PAPER_OFFLINE | false | true requires exact version/build, an image-generated cache manifest and a matching local SHA-256; makes no Paper API/download requests. |
With PAPER_OFFLINE=false, startup checks the official v3 API even when a JAR is cached. A matching SHA-256 avoids redownloading. Downloads require the official HTTPS artifact host and SHA-256, use bounded timeouts/retries/size limits, and are verified in a temporary file before atomic replacement of the target JAR. Redirects are not followed. Failed downloads/checksums preserve existing JARs.
An explicit Minecraft version never falls back to another version. If its requested channel/build is unavailable, startup stops with an error. MC_VERSION=latest is the explicit cross-version discovery option: a restart can select a newer stable Minecraft version. Do not use latest selections for controlled production upgrades.
Old and unrelated top-level JARs are preserved, as are plugin/world/config directories. Retained JARs consume disk space; remove obsolete artifacts only through your own reviewed retention policy. The image performs no world pruning, plugin upgrade, BlueMap purge, backup or automatic rollback.
A successful online startup records .paper-cache/<project>-<version>-<build>.json beside the JAR. After that, the same exact pins with PAPER_OFFLINE=true verify the cached JAR locally and start without querying/downloading from Paper. Missing/mismatched manifests, channel changes or corrupted JARs fail closed. Unverified old JARs do not count as offline cache.
This is an integrity cache owned by the data-directory owner, not an authorization mechanism or signed provenance. Do not edit the manifest to bypass validation. Paperclip's first boot downloads its runtime/libraries; fully network-isolated boot therefore also needs a previously completed boot/cache. Plugins and server features may independently need network access.
A data-directory lock is held for the Java process lifetime, preventing two copies of this entrypoint from starting against the same directory. Java receives signals directly via exec; allow enough stop grace time to save worlds. Do not run two independently launched server processes against the same world.
PaperPilot is an upcoming management tool, not a released or bundled feature of this image. The following describes the planned integration requirements, not functionality available today.
The planned adapter will use the same environment/startup contract as standalone deployments. It must first verify the running image digest, persisted Compose/Portainer source, mounts and supported contract. It must pin exact MC version/build/channel, preserve unrelated settings and enforce backup, approval and controller gates before recreating an explicitly enrolled server. After an initial verified boot, it may explicitly select offline startup for reproducible pinned restarts. Planned scheduled release checks are read-only and must never deploy changes. No automatic enrollment or deployment ownership takeover is planned. Publishing this image does not implement that adapter or upgrade any running deployment.
bash -n paper.sh
shellcheck paper.sh tests/smoke.sh
python3 -m unittest discover -s tests -v
docker build -t papermc:test .
bash tests/smoke.sh papermc:test
Host test prerequisites: Linux Bash, Python 3, jq, curl, flock and Docker for image/real-server smoke tests. Unit tests replace curl/Java with fakes and use temporary directories. The Docker smoke test creates its own volume/container, publishes no host ports, boots a real pinned server, stops it gracefully, then boots the same target with networking disabled and verifies shutdown. Never point tests at production resources.
GitHub CI runs shell checks, hermetic tests and real image/boot/restart tests on native x86-64 and ARM64 runners. Publishing is a separate manual Publish Docker image workflow, gated by the same tests. Add a write-capable Docker Hub token as repository secret DOCKERHUB_TOKEN; the workflow uses Docker ID oeschme. Select the matching semantic version and whether to update latest. It builds/pushes both architectures with source revision, provenance and SBOM metadata. Source publication is not proof of image delivery: verify the finished workflow and registry digest.
/papermc data mount and established Compose/Portainer owner. No production migration is performed by publishing this image.EULA=true is required before downloading/starting. Existing MC_RAM, MC_RAM_MIN and whitespace-delimited JAVA_OPTS behavior is preserved./paper.sh, avoiding working-directory dependence. Existing root /paper.sh invocation remains available. Remove an obsolete custom command only after reviewing your deployment.docker pull oeschme/papermc:latest