---
title: "Configuration Guide"
description: "Tune your server settings for performance — network, JVM flags, startup parameters, and more."
category: "Server Management"
tags: ["Configuration", "Performance", "Intermediate"]
readTime: 6
---

A well-configured server runs smoother, handles more players, and uses resources efficiently. This guide covers the key configuration knobs for game and app servers on Sonata.

## Startup Parameters

Startup variables are set in the **Startup** tab of your control panel. Each game egg defines the available fields.

### Minecraft JVM Flags

For Minecraft servers, JVM flags have a massive impact on performance. Use the following as a starting point:

```
-Xms{{SERVER_MEMORY}}M -Xmx{{SERVER_MEMORY}}M
-XX:+UseG1GC -XX:+ParallelRefProcEnabled
-XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions
-XX:+DisableExplicitGC -XX:G1NewSizePercent=30
-XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M
```

<Callout type="info" title="Always set Xms = Xmx">
  Setting both to the same value prevents the JVM from dynamically resizing the heap, which reduces GC pauses significantly.
</Callout>

### Pterodactyl Server Port

Ports are assigned automatically by Sonata. Do **not** change the port manually in config files — it will cause a startup failure. The panel injects the correct port via the `SERVER_PORT` environment variable.

## server.properties (Minecraft)

Key settings to configure in `server.properties`:

| Key | Recommended Value | Notes |
|---|---|---|
| `view-distance` | 8–10 | Lower = better performance |
| `simulation-distance` | 6 | Affects mob AI, redstone |
| `max-players` | Match your plan | Don't exceed RAM capacity |
| `online-mode` | `true` | Disable only for approved reasons |
| `sync-chunk-writes` | `false` | Faster disk I/O |

## Network Configuration

### Firewall

Sonata automatically opens the port assigned to your server. You do not need to manually configure firewall rules. If you need additional ports (e.g. for a web server or voice chat), contact support.

### Proxy Setup (BungeeCord / Velocity)

If running a proxy network:

1. Set `online-mode=false` on all backend servers
2. Set `bungeecord: true` (or Velocity secret) in your proxy config
3. Ensure your proxy is on the same node as your backend servers for lowest latency

<Callout type="danger" title="Do not expose backend servers">
  With `online-mode=false`, backend servers must only accept connections from your proxy's IP. Exposing them publicly allows anyone to join without authentication.
</Callout>