TheRemote / Legendary-Java-Minecraft-Geyser-Floodgate

Legendary Java Minecraft + Geyser + Floodgate + Paper Dedicated Server for Docker allowing Bedrock players to connect to a Java server
https://jamesachambers.com/minecraft-java-bedrock-server-together-geyser-floodgate/
MIT License
160 stars 36 forks source link
dedicated-game-server dedicated-server docker floodgate geysermc minecraft minecraft-server papermc

Legendary Java Minecraft + Geyser + Floodgate + Paper Dedicated Server for Docker

Legendary Minecraft Geyser Container

This is the Docker containerized version of my Minecraft Java Paper Dedicated Server for Linux/Raspberry Pi scripts but with Geyser and Floodgate included.

Geyser and Floodgate allow Minecraft Bedrock players to join your Java server!

My main blog article (and the best place for support) is here.
The version without Floodgate and Geyser is here.
The official GitHub repository is located here.
The official Docker Hub repository is located here.

The Bedrock version of the Docker container is available here. This is for Java Minecraft but Bedrock players can connect to it.

Features

Docker Usage

First you must create a named Docker volume. This can be done with:

docker volume create yourvolumename

Now you may launch the server and open the ports necessary with one of the following Docker launch commands:

With default ports:

docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest

With custom ports (this example uses 12345 for the Java port and 54321 for the Bedrock port):

docker run -it -v yourvolumename:/minecraft -p 12345:12345 -e Port=12345 -p 54321:54321/udp -p 54321:54321 -e BedrockPort=54321 --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest

With a custom Minecraft version (add -e Version=1.X.X, must be present on Paper's API servers to work):

docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e Version=1.17.1 --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest

With a maximum memory limit in megabytes (optional, prevents crashes on platforms with limited memory, -e MaxMemory=2048):

docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e MaxMemory=2048 --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest

Using a different timezone:

docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e TZ="America/Denver" --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest

Skipping backups on certain folders (comma separated):

docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e NoBackup="plugins/ftp,plugins/test2" --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest

Skipping permissions check:

docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e NoPermCheck="Y" --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest

Kubernetes Usage

First you must create a suitable PVC using your preferred StorageClass.
To run within Kubernetes, you must pass the enviroment variable k8s="True" alongside any others you require:

        env:
        - name: MaxMemory
          value: '1024'
        - name: TZ
          value: Europe/London
        - name: k8s
          value: "True"
Be aware that terminal features will not be available when running in kubernetes


The pod can be exposed using a LoadBalancer or TCP/UDP Ingress service. See example manifests in the /kubernetes folder of the repo. The examples are based on Longhorn storage backend and a LoadBalancer service - these will need altering to be suitable for your environment.

Configuration / Accessing Server Files

The server data is stored where Docker stores your volumes. This is typically a folder on the host OS that is shared and mounted with the container.
You can find your exact path by typing:

docker volume inspect yourvolumename
This will give you the fully qualified path to your volume like this:

{
        "CreatedAt": "2022-05-09T21:08:34-06:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "/var/lib/docker/volumes/yourvolumename/_data",
        "Name": "yourvolumename",
        "Options": {},
        "Scope": "local"
    }


On Linux it's typically available at:

/var/lib/docker/volumes/yourvolumename/_data

On Windows it's at
C:\ProgramData\DockerDesktop
but may be located at something more like
\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\
if you are using WSL (Windows Subsystem for Linux

On Mac it's typically
~/Library/Containers/com.docker.docker/Data/vms/0/

If you are using Docker Desktop on Mac then you need to access the Docker VM with the following command first:

screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

You can then normally access the Docker volumes using the path you found in the first step with docker volume inspect

Most people will want to edit server.properties. You can make the changes to the file and then restart the container to make them effective.

Backups are stored in the "backups" folder

The Geyser configuration is located in plugins/Geyser-Spigot/config.yml
The Floodgate configuration is located in plugins/floodgate/config.yml

TZ (timezone) Environment Variable

You can change the timezone from the default "America/Denver" to own timezone using this environment variable:

docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e TZ="America/Denver" --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest
A list of Linux timezones is available here

BackupCount Environment Variable

By default the server keeps 10 rolling backups that occur each time the container restarts. You can override this using the BackupCount environment variable:

docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e BackupCount=20 --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest

QuietCurl Environment Variable

You can use the QuietCurl environment variable to suppress curl's download output. This will keep your logs tidier but may make it harder to diagnose if something is going wrong. If things are working well it's safe to enable this option and turn it back off so you can see the output if you need to:

docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e QuietCurl=Y --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest

Plugins

This is a "Paper" Minecraft server which has plugin compatibility with Paper / Spigot / Bukkit.

Installation is simple. There is a "plugins" folder on your Docker named volume.

Navigate to your server files on your host operating system (see accessing server files section if you don't know where this is) and you will see the "plugins" folder.

You just need to drop the extracted version of the plugin (a .jar file) into this folder and restart the container. That's it!

Some plugins have dependencies so make sure you read the installation guide first for the plugin you are looking at.
A popular place to get plugins is: https://dev.bukkit.org/bukkit-plugins

Troubleshooting Note - Oracle Virtual Machines

A very common problem people have with the Oracle Virtual Machine tutorials out there that typically show you how to use a free VM is that the VM is much more difficult to configure than just about any other product / offering out there.
The symptom you will have is that nobody will be able to connect.
It is because there are several steps you need to take to open the ports on the Oracle VM. You need to both:


Both of these settings are typically required before you will be able to connect to your VM instance. This is purely configuration related and has nothing to do with the script or the Minecraft server itself.

I do not recommend this platform due to the configuration difficulty but the people who have gone through the pain of configuring an Oracle VM have had good experiences with it after that point. Just keep in mind it's going to be a rough ride through the configuration for most people.

Here are some additional links:

Troubleshooting Note - Hyper-V

There is a weird bug in Hyper-V that breaks UDP connections on the Minecraft server. There are two fixes for this. The simplest fix is that you have to use a Generation 1 VM with the Legacy LAN network driver.
See the following links:
There is a second fix that was shared by bpsimons here.
You need to install ethtool first with sudo apt install ethtool. Next in your /etc/network/interfaces file add "offload-tx off" to the bottom as the issue appears to be with TX offloading.
Here's an example:
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
offload-tx off
This can also be done non-persistently with the following ethtool command:
ethtool -K eth0 tx off

Buy A Coffee / Donate

People have expressed some interest in this (you are all saints, thank you, truly)

Update History