Server Admin · server.properties · Java
How to Edit server.properties in Minecraft
Every server setting lives in one file: server.properties. Open it, change gamemodemax-players view-distance or pvpsave, and restart.
One file, key=value, restart to apply
- 1Stop the serverRun /stop or stop the server before editing, so your changes are not overwritten on shutdown.
- 2Open server.propertiesOpen the file in the server root with nano server.properties (or any text editor). Each line is key=value.
- 3Find the keyLocate the setting: gamemode, max-players, view-distance or pvp. The key is left of the = sign.
- 4Change the valueSet the value after the =, e.g. gamemode=creative, max-players=40, view-distance=8, pvp=false. No quotes, no spaces.
- 5Save and restartSave the file (Ctrl+O, Ctrl+X in nano) and restart the server. The new values load on boot.
What you need
Quick answers
?
Where is server.properties?
It sits in the root folder of your server, next to the server jar and the world folder. It is generated the first time the server runs, so start the server once if you do not see it.
?
How do I change the gamemode for everyone?
Set gamemode=survival, creative, adventure or spectator in server.properties, then restart. This is the default mode new players spawn into; force-gamemode=true makes everyone snap to it on join.
?
What does max-players do?
max-players is the player cap, e.g. max-players=20. Higher caps need more RAM and CPU. Raising it does not add resources, so size your hardware to the cap you set.
?
What is view-distance and should I lower it?
view-distance is how many chunks the server sends around each player, default 10. Lowering it to 8 or 6 cuts CPU and bandwidth a lot, which is the fastest way to fix lag on a busy server.
?
How do I turn PvP on or off?
Set pvp=true to allow players to damage each other or pvp=false for a peaceful, no-PvP server. It only blocks direct player-vs-player damage; mobs, fall damage and lava still hurt.
?
Do I have to restart for changes to apply?
Yes. server.properties is read at startup, so edits do nothing until you restart the server. Save the file first, then stop and start the server to load the new values.