/whitelist accepts an exact account name (works even when the player is offline or has never joined) or a player selector like @a, which only matches players currently online.
Adds Steve to whitelist.json by account name. Works while they are offline, even before their first join.
Adding names does nothing while the whitelist is off. Run this once; the setting is saved to server.properties and survives restarts.
The master switch. It flips the white-list setting in server.properties, so the change survives restarts.
The list itself, stored in the server's root folder as UUID and name pairs. If you edit it by hand while the server runs, apply the change with /whitelist reload.
server.properties setting, false by default. Set it to true and /whitelist reload kicks every online player who is not on the list.
Server only: /whitelist needs operator permission level 3 and is only registered on multiplayer servers. It does not exist in singleplayer or LAN worlds. Opped players always bypass the whitelist, so you cannot lock yourself out.
To whitelist a Minecraft server, run /whitelist on from the server console or an opped account, then /whitelist add PlayerName for each person you want to allow. From that moment only listed players and server operators can join; everyone else is refused at login with the message: You are not white-listed on this server!
The whitelist is the simplest way to keep a server private. It is an allowlist of account names stored in whitelist.json in the server's root folder, and it survives restarts because /whitelist on also writes white-list=true into server.properties. The command needs operator permission level 3 and only exists on multiplayer servers, never in singleplayer or LAN worlds.
Setting it up takes four commands:
1. Run /whitelist on to turn the whitelist on. Opped players bypass it, so you stay able to join.
2. Run /whitelist add PlayerName once per player, using each exact account name. The players do not need to be online or to have ever joined.
3. Run /whitelist list to verify every name made it onto the list with the right spelling.
4. Optionally set enforce-whitelist=true in server.properties so /whitelist reload also kicks anyone already online who is not on the list.
The generator above builds each of those commands for you: pick the subcommand, enter the player's name or build a selector, and copy the result into the server console or chat.
The command has six subcommands. Two of them take a <targets> argument, which accepts a player's exact account name or a player selector; the other four take nothing:
Common examples you can copy directly:
Every subcommand requires operator permission level 3. The default op level on a vanilla server is 4, so any opped player can manage the whitelist; on a fresh server with no ops yet, run the commands from the server console.
The whitelist lives in two places. The list of allowed players is whitelist.json, a plain text file in the server's root folder where each entry stores a player's UUID and name. Because the UUID is what actually identifies the account, a whitelisted player keeps access even after changing their name. You can edit the file by hand: do it while the server is stopped, or run /whitelist reload afterwards so the running server re-reads it.
The on/off state and the enforcement behavior live in server.properties:
One detail trips up many server owners: /whitelist remove does not kick anyone. A removed player who is online stays online until they disconnect. If you need them gone immediately, follow up with /kick, or enable enforce-whitelist and run /whitelist reload, which drops every connected player who is not on the list.
Run /whitelist on from the server console or an opped account, then /whitelist add PlayerName for each player you want to allow. The whitelist stays on across restarts because the command sets white-list=true in server.properties. Anyone not on the list is refused with the message: You are not white-listed on this server!
Run /whitelist add followed by their exact account name, for example /whitelist add Steve. The player does not need to be online or to have ever joined; the server looks the name up and stores it in whitelist.json. Verify the result with /whitelist list.
Most often the name on the list does not match the account exactly. Run /whitelist list and compare the spelling character by character, then re-add the correct name with /whitelist add. Also confirm the whitelist is actually on, and if you edited whitelist.json by hand, run /whitelist reload so the server picks up the change.
Yes. Any player listed in ops.json can join a whitelisted server whether or not their name is on the whitelist. That is why you cannot lock yourself out by running /whitelist on before adding your own name, as long as your account is opped.
No. /whitelist remove only blocks their next login; a player who is online stays connected. Kick them with /kick PlayerName, or set enforce-whitelist=true in server.properties so that /whitelist reload kicks everyone who is not on the list.
In whitelist.json, in the server's root folder next to server.properties. Each entry stores the player's UUID and name. You can edit the file manually while the server is stopped, or edit it live and apply the change with /whitelist reload.
Need to keep one specific player out instead? Or browse more Minecraft tools: