Direct answer
For a private Java server, enable the whitelist and add every player who should be allowed to join. In the server console, commands do not need the leading slash.
whitelist on
whitelist add PlayerName
whitelist listUseful whitelist commands
| Console command | What it does |
|---|---|
whitelist on | Enable the whitelist |
whitelist add PlayerName | Add a player |
whitelist remove PlayerName | Remove a player |
whitelist list | Show whitelisted players |
whitelist reload | Reload the whitelist file after manual edits |
whitelist off | Disable the whitelist |
Console vs in-game commands
In the server console, type whitelist add PlayerName. In Minecraft chat, an operator uses /whitelist add PlayerName. The slash is part of the in-game command interface, not the dedicated server console.
Why a whitelist matters
A port-forwarded server can be reachable by anyone who discovers the address. A whitelist is a simple access-control layer for a friends-only SMP. It does not replace backups, secure host accounts, or sensible plugin permissions.
If a whitelisted player still cannot join
Check the exact Java Edition account name, confirm the whitelist is enabled, and read the disconnect reason. A network timeout is not a whitelist problem; a whitelist rejection normally says the player is not whitelisted.
Official references
These references were checked while preparing this guide. Version-specific behavior can change, so use the project documentation for your exact release when a detail differs.
Related guides
Help us improve this article
Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.