Skip to main content
← All Guides
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
  1. 1
    Stop the server
    Run /stop or stop the server before editing, so your changes are not overwritten on shutdown.
  2. 2
    Open server.properties
    Open the file in the server root with nano server.properties (or any text editor). Each line is key=value.
  3. 3
    Find the key
    Locate the setting: gamemode, max-players, view-distance or pvp. The key is left of the = sign.
  4. 4
    Change the value
    Set the value after the =, e.g. gamemode=creative, max-players=40, view-distance=8, pvp=false. No quotes, no spaces.
  5. 5
    Save and restart
    Save the file (Ctrl+O, Ctrl+X in nano) and restart the server. The new values load on boot.
nano server.properties~/mc
# Minecraft server properties
motd=A Minecraft Server
gamemode=survival← tune this
difficulty=normal
max-players=20← tune this
view-distance=10← tune this
pvp=true← tune this
spawn-protection=16
online-mode=true
$ systemctl restart minecraft
[Server] Done (4.812s)! Reloaded properties.
Steve joined the game
players1 / 20

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.
Hosting
Skip the setup
Get a managed server with one click instead of configuring it all yourself.
Database
Blocks, items & IDs
Look up Minecraft IDs and data for the worlds your settings spin up.