Minecraft server as container image.
while-true-do.io is NOT approved or endorsed by Mojang AB or Microsoft Corporation. We are also NOT associated or connected with Mojang AB or Microsoft Corporation.
The container does not include the server software, but will download it from minecraft.net. You also have to acknowledge the EULA, as explained below.
Playing some games is relaxing and Minecraft is something we wanted to play.
This container image is a wrapper to download and configure a Minecraft server. It provides most of the Vanilla configuration options.
You need to have a container engine like Docker or Podman installed.
Running the container image is described in details in this section.
Be aware, that You need to acknowledge the Minecraft EULA. You can read about it here https://www.minecraft.net/download/server/
To acknowledge the EULA, you need to provide --env EULA=true
during the start.
You can run a simple instance and acknowledge the Eula.
# Podman (automatic port)
$ podman run --detach --tty --publish-all --env EULA=true \
docker.io/whiletruedoio/minecraft:latest
# Podman (defined port)
$ podman run --detach --tty --publish 25565:25565 --env EULA=true \
docker.io/whiletruedoio/minecraft:latest
# Docker (defined port)
$ docker run --detach --tty --publish 25565:25565 --env EULA=true \
docker.io/whiletruedoio/minecraft:latest
You can also specify the version.
# Podman
$ podman run --detach --tty --publish 25565:25565 --env EULA=true \
docker.io/whiletruedoio/minecraft:1.18.2
# Docker
$ docker run --detach --tty --publish 25565:25565 --env EULA=true \
docker.io/whiletruedoio/minecraft:1.18.2
You can use a volume to persist the storage (your world and settings).
# Podman
$ podman run --detach --tty --publish 25565:25565 --env EULA=true \
--volume minecraft:/opt/minecraft/ \
docker.io/whiletruedoio/minecraft:latest
# Docker
$ docker run --detach --tty --publish 25565:25565 --env EULA=true \
--volume minecraft:/opt/minecraft/ \
docker.io/whiletruedoio/minecraft:latest
You can configure your server with environment variables. Please see below for details about usable variables and default values.
For simple configurations, you can provide the variables inline.
# Podman
$ podman run --detach --tty --publish 25565:25565 --env EULA=true \
--env XMS=512M --env XMX=2048M --env PVP=false \
docker.io/whiletruedoio/minecraft:latest
# Docker
$ docker run --detach --tty --publish 25565:25565 --env EULA=true \
--env XMS=512M --env XMX=2048M --env PVP=false \
docker.io/whiletruedoio/minecraft:latest
Since Mincecraft can be configured with several properties and options you can provide an environment file. We have an example envfile.sample included. The Minecraft Wiki provides additional explanations for the properties.
# Podman
$ podman run --detach --tty --publish 25565:25565 \
--env-file=/path/to/file \
docker.io/whiletruedoio/minecraft:latest
# Docker
$ docker run --detach --tty --publish 25565:25565 \
--env-file=/path/to/file \
docker.io/whiletruedoio/minecraft:latest
Sometimes, you need to adjust settings on the fly. Minecraft offers a server console to interact with a running server. This can be useful to promote players to ops or ban players and test some settings.
After starting a container with one of the above commands, you can attach to the container and run server console commands.
# Podman
$ podman attach CONTAINERID
help
[19:57:07] [Server thread/INFO]: /advancement (grant|revoke)
[19:57:07] [Server thread/INFO]: /attribute <target> <attribute> (base|get|modifier)
[19:57:07] [Server thread/INFO]: /ban <targets> [<reason>]
[19:57:07] [Server thread/INFO]: /ban-ip <target> [<reason>]
[19:57:07] [Server thread/INFO]: /banlist [ips|players]
...
[19:57:07] [Server thread/INFO]: /worldborder (add|center|damage|get|set|warning)
[19:57:07] [Server thread/INFO]: /xp -> experience
/op mumbojumbo
[19:59:25] [Server thread/INFO]: Made MumboJumbo a server operator
After doing your administration, you can detach from the container with
Ctrl+p Ctrl+q
.
Please check here to get detailed documentation about the possible commands.
None.
Thank you so much for considering to contribute! We are happy, when someone is joining the hard work.
Issues and Pull Requests are handled on a regular basis. Please be aware, that we may reach out to you, ask you to provide additional resources or want to discuss the issue a little, before planning it.
Providing code to this repository is pretty straight forward. Open an issue, so we can discuss the bug/feature and start working on it afterwards. You just need to open the pull request afterwards and that's it.
It is also strongly recommended to read the Contribution Guideline beforehand.
We are maintaining a changelog for repositories. Normally, the developers will update the changelog, according to keepachangelog.com.
To ensure a high quality and functionality, we want to carefully test our software. The provided code is automatically tested as described in the .cirrus.yml.
Except otherwise noted, all work is licensed under a BSD-3-Clause License.
Please feel free to reach out to us and the community. We also recommend to read and understand the Code of Conduct beforehand.
- Site: https://while-true-do.io
- Blog: https://blog.while-true-do.io
- Code: https://github.com/whiletruedoio
- Chat: libera.chat #whiletruedoio
- Mail: [email protected]