generating...
server.properties
Docker (itzg/minecraft-server)
mcrcon over an SSH tunnel
Regenerate, copy the server.properties lines into your server's config, restart the server, and keep the password in your password manager. Everything is generated in your browser with crypto.getRandomValues. Nothing gets sent to me. The Docker and mcrcon snippets quote the password for a POSIX shell (bash, zsh, sh), so symbols in the third mode don't get eaten.
Before you paste anything, though, let me save you a common afternoon of confusion.
Minecraft has no server password. RCON isn't one.
People search "Minecraft server password" expecting a box where players type a password to join. Vanilla Java Edition doesn't have that. The RCON password is not it either. RCON is a remote admin console: a TCP port that accepts server commands (/op, /stop, /whitelist, all of it) from anyone who knows the password. It lets you run commands without attaching to the server's terminal, and backup scripts use it to pause saving. It does nothing to stop players from joining.
So there are two separate jobs here, and I'll cover both:
- Control who can play: whitelist plus online mode.
- Protect the admin console: a strong RCON password, and RCON kept off the public internet.
How to actually "password protect" a Minecraft server
The whitelist is the lock. These are the server.properties settings that matter, with their meaning from the Minecraft Wiki:
| Property | What it does |
|---|---|
white-list=true | Only players on the whitelist (and ops) can join. |
enforce-whitelist=true | When the whitelist changes, online players who are no longer on it get kicked. |
online-mode=true | Players must be verified against Minecraft's account servers. This is what makes names on the whitelist mean anything. |
Then add your players from the server console or in game as an op:
/whitelist on
/whitelist add SomePlayer
/whitelist remove SomePlayer
/whitelist list
/whitelist reload
/op YourName
Those are the exact subcommands a 26.3 server lists for help whitelist. Ops can always join while the whitelist is on, even if they aren't listed, so be stingy with /op. Ops can also run every command RCON can.
Check the default, don't assume it. Java Edition 26.3 changed white-list to default to true, and a fresh server.properties generated by the 26.3 server jar had white-list=true. Older versions defaulted to false. And in my test, the itzg/minecraft-server image on 26.3 wrote white-list=false when I didn't set its WHITELIST variable. Open the file and look.
Offline mode and auth plugins
With online-mode=false, the server doesn't verify accounts at all. Anyone can connect with any username, including yours, including an op's. A whitelist of names does nothing, because names are just claims. Some people run offline mode on purpose (LAN parties, proxies that do authentication in front of the backend servers, or players without accounts), and on Spigot and Paper servers there are login plugins that make each player register a password with a command after joining. Those plugins are a patch on a hole the server opened, and they're only as good as the plugin and its password storage. If you don't have a specific reason for offline mode, leave online-mode=true.
What RCON is and why its port must stay private
The server.properties side is three lines:
enable-rcon=true
rcon.port=25575
rcon.password=YOUR_GENERATED_PASSWORD
Defaults: enable-rcon is false, rcon.port is 25575, and rcon.password is blank. If RCON is enabled with a blank password, it won't start. There's also broadcast-rcon-to-ops (default true), which sends RCON command output to online ops. Set it to false if a backup script's chatter annoys them.
The important part, straight from the Minecraft Wiki's RCON page: RCON is not encrypted, and exposing the port to the internet is dangerous. The protocol is the Source RCON design Valve made for its game servers. The client connects over TCP and sends a login packet whose payload is the password, as plain text. Every command after that is plain text too. Anyone on the network path can read the password, and anyone who can reach the port can try passwords.
A long random password handles the guessing. Nothing a password can do handles the plain text. So:
Keep RCON off the internet
- Don't forward 25575 on your router. Only the game port (25565 by default) needs to be reachable by players.
- Firewall it on a VPS. With ufw:
sudo ufw allow 25565/tcpandsudo ufw deny 25575/tcp. But read the Docker note below, because Docker-published ports skip ufw. server-ipbinds RCON too. When I setserver-ip=127.0.0.1, the log saidRCON running on 127.0.0.1:25580. It also binds the game port to localhost, though, so that only works when players come in through a proxy on the same machine.- In Docker, publish only the game port, or publish RCON to localhost with
-p 127.0.0.1:25575:25575. Docker's own docs say published ports are routed before ufw rules apply, so a-p 25575:25575is open to the world no matter what ufw says.
Use RCON through an SSH tunnel
If RCON only listens where the internet can't reach it, you reach it the same way you reach the server's shell. From your own computer:
# Forward local port 25575 to RCON on the server's loopback
ssh -N -L 25575:127.0.0.1:25575 you@your-server
# In another terminal, talk to it as if it were local
mcrcon -H 127.0.0.1 -P 25575 -p 'YOUR_GENERATED_PASSWORD' list
Now the password rides inside SSH's encryption. mcrcon also reads MCRCON_HOST, MCRCON_PORT and MCRCON_PASS from the environment, which keeps the password out of your shell history if you load it from a file. Run mcrcon -t for an interactive terminal.
From Python, the mcrcon package works fine. This is what I used to test against a real server:
from mcrcon import MCRcon
with MCRcon("127.0.0.1", "YOUR_GENERATED_PASSWORD", port=25575) as rcon:
print(rcon.command("list"))
A wrong password raises MCRconException: Login failed.
RCON with the itzg/minecraft-server Docker image
The popular itzg/minecraft-server image handles RCON a little differently from a bare server:
- RCON is enabled by default, because the image uses it for clean shutdowns and for coordinating saves during backups.
- If you don't set
RCON_PASSWORD, it generates a random password at each startup. That's safe, but outside tools can't know it. - Set
RCON_PASSWORD, orRCON_PASSWORD_FILEpointing at a file (handy with Docker secrets). - The container ships
rcon-cli, already configured with the password.docker exec mc rcon-cli listjust works. - The image docs say it in capital letters: be cautious of mapping the RCON port externally.
In a Compose file, a literal $ in a value must be written $$, or Compose treats it as a variable and swaps in something else, usually nothing. I checked: RCON_PASSWORD: "ab$$cd$xy" came out as ab$cd. One more reason the default alphabet here is letters and numbers.
Which characters survive server.properties
server.properties is read as a Java properties file (the wiki names Properties.load as the format). I didn't want to guess what that does to a password, so I wrote passwords into server.properties by hand on a 26.3 server, started it, and tried logging in over RCON:
| Written in the file | Password that worked | Lesson |
|---|---|---|
ab\cd | abcd | A backslash escapes the next character and disappears. |
x\ty | x, a tab, y | \t becomes a real tab. |
end\\ | end\ | Write \\ for one backslash. |
lead | lead | Leading spaces are dropped. |
trail plus 2 spaces | trail plus 2 spaces | Trailing spaces are kept, invisibly. |
ab:c=d#e!f | ab:c=d#e!f | Works, and the server rewrote the line as ab\:c\=d\#e\!f. |
pa$$&"'<>%^*()[]{}|;,.?/~`@ | the same | Fine in the file. Your shell is another story. |
The file isn't the only parser in the chain. The password also passes through your shell, maybe a Compose file, maybe a .env file, maybe a backup script. Each has its own rules for $, quotes, backslashes and !. A 32 character password from 62 letters and numbers is about 190 bits, which is absurdly more than a guessing attack will ever get through. Symbols add nothing you need and a lot you might debug. If you pick the all-symbols mode anyway, the generator escapes \ : = # ! in the properties line, and I checked that escaping against the real server.
Generating an RCON password yourself
Any of these give you a letters and numbers (or near enough) password from the operating system's secure random source:
# OpenSSL: 16 random bytes as 32 hex characters
openssl rand -hex 16
# Python: 32 characters from A-Z a-z 0-9
python3 -c "import secrets,string; a=string.ascii_letters+string.digits; print(''.join(secrets.choice(a) for _ in range(32)))"
# Linux/macOS shell
LC_ALL=C tr -dc 'A-Za-z0-9' < /dev/urandom | head -c 32; echo
# Node.js
node -e "const c=require('crypto');const a='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';console.log(Array.from({length:32},()=>a[c.randomInt(a.length)]).join(''))"
Newer servers also have the Minecraft Server Management Protocol (management-server-enabled, off by default), a separate remote management API that uses TLS by default. Its management-server-secret must be exactly 40 letters and numbers, so this generator at length 40 in the first mode makes a valid one.
Bedrock Edition is different
- No RCON. The Bedrock Dedicated Server has no RCON setting in
server.properties. - Allowlist, not whitelist. Set
allow-list=trueand manageallowlist.jsonwithallowlist add,allowlist remove,allowlist listandallowlist reload. There's no on/off subcommand, and unlike Java, being an operator doesn't get you past the list. online-mode=truerequires Xbox Live authentication. Clients connecting to non-LAN servers need it regardless.
Rotation and common mistakes
Change the RCON password when someone with access leaves, when it has ever been typed into a chat or a screenshot, or when you find the port was exposed. Edit rcon.password, restart the server, then update every script that uses it. With itzg, change RCON_PASSWORD and recreate the container.
- Forwarding 25575 "so the panel works." Use a tunnel or put the panel on the same machine.
- Reusing the password from your hosting account or anything else. RCON sends it in plain text, so assume it can leak.
- Committing it to git in a Compose file. Use
RCON_PASSWORD_FILEor an untracked.env. - Treating the RCON password as a join password. Players will still walk right in without a whitelist.
- Pasting a backslash into server.properties and wondering why the password "doesn't work."
RCON is also a nice example of least privilege gone missing: one password gives the holder every command the server has. I wrote more about that way of thinking in the principle of least privilege in the AI age.
Minecraft Server Password and RCON FAQ
How do I put a password on my Minecraft server?
Vanilla Minecraft Java Edition has no join password. You control who gets in with the whitelist: set white-list=true and online-mode=true in server.properties, then run /whitelist add for each player. Turn on enforce-whitelist if you want players removed from the list to be kicked right away. The RCON password is something else: it protects the remote admin console, not the game.
What is the default RCON port and password in Minecraft?
The default rcon.port is 25575 and enable-rcon is false. rcon.password is blank by default, and if RCON is enabled with a blank password it will not start. You have to set enable-rcon=true and a password yourself.
Is Minecraft RCON encrypted?
No. RCON sends the password and every command in plain text over TCP. Anyone who can watch the traffic can read the password. Never expose the RCON port to the internet: bind it to localhost, firewall it, or reach it through an SSH tunnel.
Which characters are safe in rcon.password?
Letters and numbers are always safe. server.properties is read as a Java properties file, so a backslash starts an escape sequence, and leading spaces are dropped. Colons, equals signs, hash and exclamation marks work but Minecraft rewrites them with a backslash in front. Shell and Docker Compose add their own trouble with dollar signs and quotes. That is why this generator defaults to A-Z, a-z and 0-9 at 32 characters.
Is the whitelist on by default?
It depends on the version. Minecraft Java Edition 26.3 changed the white-list default to true, and a fresh 26.3 server.properties I generated had white-list=true. Older versions defaulted to false, and in my test the itzg/minecraft-server Docker image wrote white-list=false when no WHITELIST variable was set. Check your server.properties instead of trusting the default.
Does Bedrock Edition have RCON?
No. The Bedrock Dedicated Server has no RCON setting in server.properties. Access control uses allow-list=true with an allowlist.json file, managed with the allowlist command, and online-mode=true requires Xbox Live authentication.
Related tools: Steam password generator, Roblox password generator, Discord password generator, memorable password generator, Redis password generator, and the API key generator.
-Sethers