A whitelist means only the players you've added can join. It's the simplest way to keep a private server private and stops strangers wandering in if your address gets shared.
Turn it on
In the Console tab, run:
whitelist on
Then make sure players are removed if they're taken off the list while online:
whitelist reload
You can also set white-list=true and enforce-whitelist=true in server.properties and restart. enforce-whitelist kicks anyone online who isn't on the list.
Add and remove players
whitelist add Steve
whitelist remove Steve
whitelist list
Use their exact Minecraft username. The server looks up their account, so the name must belong to a real Java Edition account.
The Players tab in the panel shows the whitelist too, and lets you add and remove players without typing commands.
Add yourself first
If you turn the whitelist on before adding yourself, you'll be locked out like everyone else. Add your own name straight away.
Operators can join even when they aren't whitelisted, but it's still tidier to add them.
Bedrock players (Geyser and Floodgate)
Bedrock players joining through Floodgate have a prefix on their name, usually a dot: .Steve. Add them with that prefix:
fwhitelist add .Steve
fwhitelist is Floodgate's command and works while they're offline. The normal whitelist add only works for Bedrock players once they've joined at least once.
Fixing "You are not whitelisted on this server"
- Check the spelling of their name with
whitelist list. Names are case-insensitive but must otherwise match. - If they changed their username recently, remove the old name and add the new one.
- If you edited
whitelist.jsonby hand, runwhitelist reloador restart.
Questions
Does the whitelist work on cracked or offline-mode servers?
It checks names, but with online-mode off anyone can use any name, so a whitelist protects nothing. Keep online-mode on.
Can I whitelist someone who hasn't joined before?
Yes, whitelist add works for any real Java Edition username. For Bedrock players through Floodgate, use fwhitelist add with their prefixed name.
Where is the whitelist stored?
In whitelist.json in your server's top folder. It's safer to use the commands or the Players tab than to edit it by hand.