With Docker
RCON is enabled by default, so you can exec into the container to
access the Minecraft server console:
Note: 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:
The -i is not needed in this case.
When RCON is disabled¶
If rcon is disabled you can send commands by passing them as arguments to the packaged mc-send-to-console script after setting the env var CREATE_CONSOLE_IN_PIPE to "true". For example, a player can be op'ed in the container mc with:
docker exec --user 1000 mc mc-send-to-console op player
| |
+- container name +- Minecraft commands start here
Enabling interactive console¶
In order to attach and interact with the Minecraft server make sure to enable TTY and keep stdin open.
Example
With docker run use the -it arguments:
or with a compose file:
With that you can attach and interact at any time using the following, replacing the {...} placeholders.
...when container is created with docker run
...or when declared using a compose file
and then Control-p Control-q to detach.
RCON is required for fully interactive, color console
RCON must be enabled, which is the default, in order to use a fully interactive console with auto-completion and colorized log output.