Skip to main content

Basic Admin Tasks (CLI and In-Game

Minecraft Docker Admin Cheat Sheet

Docker/RCON commands are run on the host machine and use docker exec <container> rcon-cli.
In-game commands are typed in the Minecraft chat window (prefix with /).
Replace <container>, <player>, etc. with your actual values.


🔧 Connecting to the Server

(Host only — no in-game equivalent)

Task Docker / Host Command
List running containers docker ps
Attach to server console docker attach <container>
Open interactive RCON shell docker exec -it <container> rcon-cli
View server logs docker logs <container>
Follow live logs docker logs -f <container>

👑 Player Management

Task Docker / RCON In-Game
Make player an op rcon-cli op <player> /op <player>
Remove op from player rcon-cli deop <player> /deop <player>
Kick a player rcon-cli kick <player> <reason> /kick <player> <reason>
Ban a player rcon-cli ban <player> <reason> /ban <player> <reason>
Ban by IP rcon-cli ban-ip <ip> <reason> /ban-ip <ip> <reason>
Unban a player rcon-cli pardon <player> /pardon <player>
Unban an IP rcon-cli pardon-ip <ip> /pardon-ip <ip>
List banned players rcon-cli banlist /banlist
Whitelist a player rcon-cli whitelist add <player> /whitelist add <player>
Remove from whitelist rcon-cli whitelist remove <player> /whitelist remove <player>
Enable whitelist rcon-cli whitelist on /whitelist on
List online players rcon-cli list /list

🌍 World Management

Task Docker / RCON In-Game
Save the world manually rcon-cli save-all /save-all
Enable auto-save rcon-cli save-on /save-on
Disable auto-save rcon-cli save-off /save-off
Set time to day rcon-cli time set day /time set day
Set time to night rcon-cli time set night /time set night
Set specific time (ticks) rcon-cli time set <ticks> /time set <ticks>
Clear weather rcon-cli weather clear /weather clear
Set weather to rain rcon-cli weather rain /weather rain
Set weather to thunder rcon-cli weather thunder /weather thunder
Teleport player rcon-cli tp <player> <x> <y> <z> /tp <player> <x> <y> <z>
Teleport to another player rcon-cli tp <player1> <player2> /tp <player1> <player2>
Backup world data docker cp <container>:/data/world ./backup (host only)

⚙️ Game Settings

Task Docker / RCON In-Game
Change a player's game mode rcon-cli gamemode <mode> <player> /gamemode <mode> <player>
Change your own game mode rcon-cli gamemode <mode> <yourname> /gamemode <mode>
Set default game mode rcon-cli defaultgamemode <mode> /defaultgamemode <mode>
Set difficulty rcon-cli difficulty <level> /difficulty <level>
Set a gamerule rcon-cli gamerule <rule> <value> /gamerule <rule> <value>
Keep inventory on death rcon-cli gamerule keepInventory true /gamerule keepInventory true
Disable mob griefing rcon-cli gamerule mobGriefing false /gamerule mobGriefing false
Give item to player rcon-cli give <player> <item> <amount> /give <player> <item> <amount>
Toggle PvP Edit server.properties on host (host only)

Game mode values: survival, creative, adventure, spectator
Difficulty values: peaceful, easy, normal, hard


🐳 Docker Container Management

(Host only — no in-game equivalent)

Task Command
Start the server docker start <container>
Stop the server (graceful) docker exec <container> rcon-cli stop
Restart the container docker restart <container>
Force stop container docker stop <container>
Update server image docker pull itzg/minecraft-server && docker restart <container>
Copy file into container docker cp <localfile> <container>:/data/<destination>

📢 Communication

Task Docker / RCON In-Game
Broadcast message to all rcon-cli say <message> /say <message>
Send a message to one player rcon-cli tell <player> <message> /tell <player> <message>
Send title overlay to all rcon-cli title @a title {"text":"<msg>"} /title @a title {"text":"<msg>"}

🧰 Useful In-Game Extras

(These work in-game but are less relevant via RCON)

Task In-Game Command
Show your coordinates /whereami or F3 (debug screen)
Heal yourself to full /effect give <player> minecraft:instant_health 1 255
Clear all effects /effect clear <player>
Summon a mob /summon <entity> <x> <y> <z>
Kill all mobs (except players) /kill @e[type=!player]
Set spawn point /spawnpoint <player> <x> <y> <z>
Set world spawn /setworldspawn <x> <y> <z>
Load a specific structure /place structure <structure>
Fill area with blocks /fill <x1> <y1> <z1> <x2> <y2> <z2> <block>
Clone an area /clone <x1> <y1> <z1> <x2> <y2> <z2> <destX> <destY> <destZ>

📁 Key Files & Paths

(Host only — edit these on the Docker host)

File Purpose
/data/server.properties Main server configuration
/data/ops.json List of operators
/data/whitelist.json Whitelisted players
/data/banned-players.json Banned players
/data/banned-ips.json Banned IPs
/data/world/ World save data

To edit a config file on the host:

docker exec -it <container> nano /data/server.properties
docker restart <container>   # restart for changes to take effect

Generated for use with itzg/minecraft-server Docker image. In-game commands require op level 2 or higher.