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
server.properties file
A text editor (nano)
view-distance & ticks
A server restart
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.
Blocks and items in this guide
Lava Still is named in the guide above. Look them up in the item database.
More guides on this site
Guides that go with this one
How to Set Up a Bedrock Dedicated Server
Run the official bedrock_server on UDP port 19132, edit server.properties, and bridge Java players with...
How to Add a Server Icon in Minecraft
Add a custom server icon to your Minecraft server: save a 64x64 PNG as server-icon.png in the server...
Change Difficulty With Commands in Minecraft
<> The /difficulty command flips your whole world between peaceful, easy, normal, and hard in one line....
Bedrock server.properties File Explained
Complete reference for every setting in the Bedrock Dedicated Server server.properties file with...
How to Reduce Minecraft Server Lag (Get TPS Back to 20)
Fix a laggy Minecraft server: lower view-distance, switch to Paper, cap entities, and profile with Spark...
How to Fix Chunk Loading Lag in Minecraft
Fix slow chunk loading and chunk lag in Minecraft servers and clients. Covers pre-generation, async...
Hosting →
Managed Hosting
Skip the setup: a managed server online in minutes.
Database →
Command Reference
Syntax, arguments and examples for every command.
Database →
Item Database
Every item with its stats, IDs, recipes and uses.
Guides →
More Server & Admin guides
Run a server: setup, hosting, permissions, worlds and crossplay.