A whitelist makes your server private. Only players on the list can join. Everyone else sees "You are not white-listed on this server".
whitelist on.whitelist add YourName.This also sets white-list=true in server.properties, so it stays on after restarts.
| Command (in console) | What it does |
|---|---|
whitelist add <name> | Adds a player |
whitelist remove <name> | Removes a player |
whitelist list | Shows everyone on the list |
whitelist off | Lets anyone join again |
whitelist reload | Reloads whitelist.json after you edit it by hand |
In game, ops can run the same commands with a / in front, like /whitelist add Steve.
Kick players who aren't on the list. By default, turning the whitelist on doesn't remove players who are already online. Set enforce-whitelist=true in server.properties to kick anyone not on the list straight away.
Names must be exact. Use the player's Java Edition username, spelled exactly. The server looks up the account, so a typo adds the wrong person or fails.
Bedrock players through Geyser and Floodgate have a prefix in front of their name, usually a dot. Add them with fwhitelist add <name> instead (see "How do I let Bedrock players join with Geyser and Floodgate?").