git clone https://github.com/nap01/mc ~/git/mcIf you don't have git, follow this guide to install.
You can run sudo chmod +x data.sh & sudo ./data.sh
or
Run the following manually:
mkdir ./data
mkdir ./data/plugins
mkdir ./data/config
mkdir ./data/modsTo test if the config works, run:
docker compose upTypically, you start it detached with:
docker compose up -dand stop it with:
docker compose downRCON is enabled by default, so you can exec into the container to access the Minecraft server console:
docker exec -i mc rcon-cliNote: The -i is required for interactive use of rcon-cli.
To run a simple, one-shot command, such as stopping a Minecraft server, pass the command as arguments to rcon-cli, such as:
docker exec mc rcon-cli stopThe -i is not needed in this case.
If rcon is disabled you can send commands by passing them as arguments to the packaged mc-send-to-console script. For example, a player can be op'ed in the container mc with:
docker exec mc mc-send-to-console op player
| |
+- container name +- Minecraft commands start hereIn order to attach and interact with the Minecraft server, add -it when starting the container, such as
docker run -d -it -p 25565:25565 --name mc itzg/minecraft-serverWith that you can attach and interact at any time using
docker attach mcand then Control-p Control-q to detach.