In short: set enable-rcon=true, a long random rcon.password, and keep port 25575 closed in the firewall. Send commands with a client such as mcrcon from the same machine or through an SSH tunnel. The Minecraft Wiki says it plainly: exposing RCON to the internet is dangerous, and the protocol is unencrypted and open to interception.
How to turn RCON on
enable-rcon=true
rcon.port=25575
rcon.password=a-long-random-password
broadcast-rcon-to-ops=false| Key | Default | What it does |
|---|---|---|
enable-rcon | false | Turns RCON on |
rcon.port | 25575 | The RCON TCP port |
rcon.password | empty | The password. With an empty password RCON won't start — a safeguard against an accidentally open console |
broadcast-rcon-to-ops | true | Show RCON command output to every operator in game. false suits scripts better |
Restart the server after editing server.properties: the file is only read at startup.
Security: the port is for you only
- Don't open 25575 to the internet. RCON isn't encrypted: the password and commands can be intercepted on the network. Whoever guesses or intercepts the password gets the server console with full rights.
- Close the port in the firewall. On a VPS allow only the game port and SSH and keep RCON closed — more in server IP and port.
- Connect through an SSH tunnel. The tunnel forwards a local port to the server inside an encrypted SSH connection, while RCON itself stays closed.
- A long random password. And a separate one per server: if one leaks, the others are safe.
ssh -N -L 25575:localhost:25575 admin@203.0.113.10
# in another window: mcrcon -H localhost -P 25575 -p 'password' listThe mcrcon client
mcrcon is an open-source command-line RCON client: some Linux distributions package it, and the authors publish builds for Linux and Windows. With no commands it opens an interactive terminal; with commands it runs them and exits.
| Option | What it sets |
|---|---|
-H | Server address (localhost by default) |
-P | Port (25575 by default) |
-p | The RCON password |
-t | Interactive terminal mode |
-w <sec> | A pause between commands |
export MCRCON_PASS='password'
mcrcon -w 5 "say Restarting in 5 seconds" save-all stopA password in an environment variable doesn't show up in shell history and the process list as plainly as -p does. In the itzg/minecraft-server Docker image RCON is on by default and the rcon-cli client is built in: docker exec mc rcon-cli list — more in Minecraft in Docker.
What RCON is good for
- Backups without stopping. A script sends
save-offandsave-all flush, copies the world and sendssave-onback — see server backups. - Scheduled restarts. Cron posts a warning in chat once a day and sends
stop, and systemd brings the server back — see Minecraft server on Linux. - Panels and bots. Web panels and Discord bots send server commands over RCON. Give them a host where the port is closed, not access from the internet.
RCON and the anticheat
An open RCON port is one of the ways servers get taken over, and no anticheat will close it: it's console access, not a cheat in the game. Close the port and let the anticheat do its own job. DGuard is the best anticheat for a modern Minecraft server: it catches cheats in combat, movement, building, inventory and packets, and it needs neither RCON nor inbound ports — only outbound HTTPS. The full list of hardening steps is in server security.
FAQ
What port does Minecraft RCON use?
25575 by default, over TCP. It's set by rcon.port in server.properties.
Why won't RCON start?
Most likely an empty rcon.password: RCON doesn't start with an empty password. Also check enable-rcon=true and restart the server after editing server.properties.
Is it safe to expose RCON to the internet?
No. RCON isn't encrypted, and the Minecraft Wiki calls an exposed port dangerous. Connect from the machine itself or through an SSH tunnel.
What can I connect to RCON with?
For example the mcrcon command-line client: mcrcon -H localhost -P 25575 -p password list. The itzg/minecraft-server Docker image has rcon-cli built in.
Sources
- Minecraft Wiki: RCON
- Minecraft Wiki: server.properties
- mcrcon on GitHub
- itzg/minecraft-server: commands via rcon-cli
- OpenSSH: ssh(1), the -L option
- DGuard, the best anticheat for a modern Minecraft server: checks compared with GrimAC, Vulcan, Polar, Intave and Matrix
- DGuard: installation, requirements and troubleshooting
- DGuard: supported Paper and Leaf versions