Editing configs without breaking the server

YAML indentation, quoting, stopping first, and how to recover when the server refuses to start after an edit.

1 min readDiese Anleitung auf Deutsch lesen

On this page 3
  1. The three rules
  2. The server will not start after an edit
  3. Line endings

The three rules

  1. Stop the server before editing files it writes itself: server.properties, ops.json, whitelist.json, usercache.json, most plugin data files. Otherwise the server overwrites your change on shutdown. Plugin config files are usually safe to edit while running, but they are read on restart or /reload of that plugin.
  2. Keep a copy. Before a big change, use Duplicate in the file's menu. Or create a backup.
  3. Respect the format.
    • YAML (config.yml, paper-world-defaults.yml): indentation with spaces, never tabs; two spaces per level; a space after every colon (max-players: 20); strings with special characters in quotes.
    • properties (server.properties): key=value, no spaces around =, one per line, # comments.
    • JSON (ops.json, whitelist.json): commas between entries but not after the last one; keys in double quotes.
    • TOML (Forge/NeoForge configs): key = value, strings in double quotes, sections in [brackets].

The server will not start after an edit

The console names the file and often the line: while parsing a block mapping ... line 14. Open it, check the indentation on that line and the one above. If you cannot see it, paste the file into Kowalski and ask what is wrong, or restore your copy.

Line endings

Editing on Windows and uploading via SFTP can add \r characters that some Linux tools choke on. The editor in the server management never does this; when in doubt, edit there.

Still stuck?

Kowalski, the assistant in your dashboard, reads your server's log and fixes most things on request. For everything else there is the ticket system.