A whitelist lets only the players you choose join your server. It is the simplest way to run a private server for friends or an application-based SMP, and it keeps out random visitors and griefers.
Whitelist commands on Java Edition
Run these in game as an operator, or in the console without the slash:
/whitelist onturns the whitelist on, and/whitelist offturns it off./whitelist add <name>adds a player. Add yourself first, so you don't lock yourself out./whitelist remove <name>removes a player./whitelist listshows everyone on the whitelist./whitelist reloadreloads the list after you edit the file by hand.
The list is saved in whitelist.json in the server folder. On an online-mode server, adding a name looks up the player's account, so spell names exactly as they are.
Settings in server.properties
white-list=true
enforce-whitelist=true
white-list is the same as /whitelist on but is set before the server starts. With enforce-whitelist on, players who are online but not on the list get kicked as soon as the whitelist is turned on or reloaded. Without it, they can stay until they log out. Operators can always join, so keep the op list short.
Bedrock Dedicated Server: the allowlist
Mojang's Bedrock server calls it an allowlist. In its server.properties, set:
allow-list=true
Then manage players in the server console:
allowlist add Steve
allowlist remove Steve
allowlist list
allowlist reload
The list is saved in allowlist.json. Use the player's gamertag.
Bedrock players on a Java server
If Bedrock players join your Java server through Geyser and Floodgate, their names usually get a prefix such as a dot, and they don't have a Java account to look up. A normal /whitelist add may not find them. Floodgate offers its own whitelist command for Bedrock players; check its documentation for the exact syntax. Another way is to let the player join once with the whitelist off, then add them by the name the server shows. More about crossplay is in how to make a server crossplay.
Whitelisted servers on CraftRank
You can still list a whitelisted server on CraftRank, for example to find members for an application-based SMP. Say clearly in your description how to apply, such as through your Discord or a form, so players know what to do. Our status checker still sees the server online even when the whitelist is on.