• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mtoensing/Docker-Minecraft-PaperMC-Server: Starts a Minecraft PaperMC 1.19 serve ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

mtoensing/Docker-Minecraft-PaperMC-Server

开源软件地址(OpenSource Url):

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

开源编程语言(OpenSource Language):

Dockerfile 48.8%

开源软件介绍(OpenSource Introduction):

Docker Minecraft JAVA PaperMC Server 1.19

Docker Minecraft PaperMC server for 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-to install on a Raspberry Pi 4

  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
  1. Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
chmod +x get-docker.sh 
./get-docker.sh 
apt-get install -y uidmap
dockerd-rootless-setuptool.sh install
sudo usermod -aG docker $USER
newgrp docker
  1. New folder for the server
cd 
mkdir mcserver
  1. Run this image as Minecraft Server
docker run -d --rm --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].

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
sudo docker stop mcserver

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

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

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

Tutorial

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

Watch the video

https://youtu.be/LtAQiTwLgak

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!




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap