• Stars
    star
    240
  • Rank 168,229 (Top 4 %)
  • Language
    Shell
  • License
    MIT License
  • Created almost 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Starts a Minecraft PaperMC server

Docker Minecraft JAVA PaperMC Server 1.20+

Docker Minecraft PaperMC server for 1.20, 1.19, 1.18, 1.17 for AMD64 and ARM64 platforms. Works on Synology, Raspberry Pi 4 or any other systems that support docker.

Build and push

Quick Start

docker run --rm --name mcserver -e MEMORYSIZE='1G' -v /home/joe/mcserver:/data:rw -p 25565:25565 -i marctv/minecraft-papermc-server:latest

The server will generate all data including the world and config files in /home/joe/mcserver. Change that to an existing folder.

How do I update the container?

On Synology DSM

  • Re-download the image from the docker repository.
  • Stop the container.
  • Clear the container.
  • Start the container.

On Terminal

docker pull marctv/minecraft-papermc-server:latest
docker stop mcserver

Or just use https://containrrr.dev/watchtower/

Run as non-root user

You can get the desired UID/GID (xxx) with the ID command (id username) then add the following to your docker run command:

-e PUID=xxx
-e PGID=xxx

Skip permission change step

If you have a big custom minecraft install (e.g. multiple plugins which generate files), changing ownership can take up a tremendous amount of time. You can skip this, by making sure that your files have the necessary permissions for the UID/GID that you passed using the environment variables above and then add the following variable:

-e SKIP_PERM_CHECK=true

Docker Compose

If you prefer to use docker-compose, use the following commands:

Start the server:

docker-compose up

Stop the server:

docker-compose stop

Issue server commands after attaching to the container:

docker attach mcserver
# then you can type things like "list"
list
# which will show the current players online or
help
# to see all the commands available

How to use the Makefile with Docker Compose

Additionally, a Makefile is provided to easily start, stop, and attach to the container.

make start     # equivalent to `docker-compose up -d --build`
make stop      # equivalent to `docker-compose stop --rmi all --remove-orphans`
make attach    # equivalent to `docker attach mcserver`
make help      # prints a help message

Environment variables

MEMORYSIZE = 1G

Not more than 70% of your RAM for your container. This is important. Because this is the RAM, your Minecraft Server will use within the container WITHOUT the operating system.

TZ = Europe/Berlin

Sets the timezone for the container. A list of valid values can be found on Wikipedia: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

PAPERMC_FLAGS = --nojline

Optional: Sets the command-line flags for PaperMC. Remove --nojline if you want to enable color and tab-completion for the server console.

JAVAFLAGS

Optional: Overrides the optimized java parameter configuration with your own. You can set your own Xms and Xmx values this way.

Tutorial Synology

Tutorial (german) https://marc.tv/anleitung-stabiler-minecraft-server-synology-nas/

Watch the video

https://youtu.be/LtAQiTwLgak

How-to install on a Raspberry Pi 4

Video Tutorial Raspberry Pi 4

Watch the video

https://youtu.be/BuHOyhM2fCg

How-to install on a Raspberry Pi 4

You can install this docker container by using my dedicated installer: https://github.com/mtoensing/RaspberryPiMinecraftDocker Or just follow these steps:

  1. Download Raspberry Pi Imager https://www.raspberrypi.com/software/ and start it.
  2. Select Raspberry Pi OS lite (64-bit) under "Raspberry Pi OS (other)".
  3. Click on gear icon in the Raspberry Pi Imager and enable ssh and set username and password.
  4. Write image to a fast sd card.
  5. Connect the Raspberry Pi 4 to an ethernet cable.
  6. Use putty for Windows or terminal on macOS and connect via ssh:
ssh pi@raspberrypi
  1. Upgrade all packages
 sudo apt update && sudo apt upgrade
 sudo reboot now

The Raspberry Pi will restart now.

  1. Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
chmod +x get-docker.sh
./get-docker.sh
sudo apt-get install -y uidmap
dockerd-rootless-setuptool.sh install
sudo usermod -aG docker $USER
sudo systemctl enable docker
newgrp docker
  1. New folder for the server
cd
mkdir mcserver
  1. Run this image as Minecraft Server
docker run -d \
--restart unless-stopped \
--name mcserver \
-e MEMORYSIZE='1G' \
-e PAPERMC_FLAGS='' \
-v /home/pi/mcserver:/data:rw \
-p 25565:25565 \
-it marctv/minecraft-papermc-server:latest

The server will generate all data including the world and config files in /home/pi/mcserver.

  1. Enter the command line of Minecraft server
docker attach mcserver

Here, you can use Minecraft server commands like whitelist add [userrname].

Credits

On GitHub https://github.com/mtoensing/Docker-Minecraft-PaperMC-Server

This server is live here: https://mc.marc.tv

Based on the work of Felix Klauke Thanks for your help!

More Repositories

1

Docker-Minecraft-Bedrock-Server

Starts a Minecraft BEDROCK Server (PE Pocket Edition) for iOS, iPhone, iPad, XBOX and Windows.
Dockerfile
55
star
2

Docker-Minecraft-Overviewer

Dockerimage for Minecraft Overviewer
Python
14
star
3

Moondance-StepMania64-pi4

StepMania with 60 FPS on Raspberry Pi 4
Lua
8
star
4

RaspberryPiMinecraftDocker

Install a Minecraft Java Server and Watchtower for automatic updates using Docker within seconds.
Shell
8
star
5

synology-ramdisk

Mount a ramdisk in DSM
Shell
7
star
6

Docker-chd-converter

Converts all GID, ISO and CUE files in a folder using chdman in Mame Tools to CHD. Skips existing chd files.
Dockerfile
6
star
7

Train-Time-Tracker

"Train Time Tracker" display real time information for a specific connection by scraping mobile.bahn.de
PHP
4
star
8

MCMonitor

Display basic minecraft server information with query and php
PHP
4
star
9

game-review-block

Add a review rating block with a score from 1 to 10 to your post. Adds schema.org meta data for Rich Results in search engines.
PHP
2
star
10

wp-tgdb-importer

A 'The Game Database Importer' for Wordpress.
PHP
2
star
11

mi2sheet

Poll Xiaomi Mijia temperature and humidity data via bluetooth to a Google Spreadsheet
Python
2
star
12

last-commented-posts

PHP
1
star
13

wp-shortscore-api

json api for shortscore data by shortscore id (comment id)
PHP
1
star
14

wp-shortscore-core

Wordpress plugin for the SHORTSCORE project
PHP
1
star
15

cookie-notice-lite

Most simple cookie notice I can think of. For WordPress.
PHP
1
star
16

ulanzi-awtrix-iobroker-javascript-snippets

a collection of JavaScript snippets for the Awtrix Adapter in ioBroker
JavaScript
1
star
17

marctv-quicktags

This plugin displays the most basic of quicktag buttons on your comment forms, using the Quicktag API built into WordPress (as of 3.3). No jQuery needed.
PHP
1
star