This is an example setup for papermc minecraft server in docker.
Everything you may need is included in this repository.
This setup run on 1.15.2 but it's easy to change.
- How to setup
- How to maintain
- How to backup
As written this setup is for docker. So you need to install docker
and docker-compose
on your local system / server.
Create a folder /etc/docker-compose
and clone everything from this repository inside.
mkdir --parents /etc/docker-compose
git clone https://github.com/fisey/papermc-docker.git /etc/docker-compose/minecraft
Create a new user with the uid 4321
without a password.
adduser --disabled-password --uid 4321 --gecos "" minecraft
Create a minecraft-data
under /srv/
.
mkdir --parents /srv/minecraft-data
chown minecraft:minecraft /srv/minecraft-data
Build docker container.
cd /etc/docker-compose/minecraft
docker-compose build
Run docker container.
cd /etc/docker-compose/minecraft
docker-compose up
For example there comes a point where you want to update the version. With docker this is easy. You just need to add two new lines into your docker-compose.yml
.
Find the download here PaperMC Downloads.
Change version
---
version: '3.5'
services:
minecraft-server:
build: .
ports:
- 25565:25565
container_name: minecraft-server
restart: always
environment:
- APP_UID=4321
- APP_GID=4321
- APP_MEMORY=8192M
- APP_BUILD=<build_number>
- APP_VERSION=<build_version>
volumes:
- /srv/minecraft-data:/minecraft-data
...
Stop minecraft server
cd /etc/docker-compose/minecraft
docker-compose down
Start minecraft server
cd /etc/docker-compose/minecraft
docker-compose up
tbd