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 list

Useful whitelist commands

Console commandWhat it does
whitelist onEnable the whitelist
whitelist add PlayerNameAdd a player
whitelist remove PlayerNameRemove a player
whitelist listShow whitelisted players
whitelist reloadReload the whitelist file after manual edits
whitelist offDisable 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.

Was this article helpful?
Help us improve this article

Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.

What could we improve?
Do not include passwords, server IPs, or other private information.0 / 1000