Start Script & JVM Flags Generator

This tool generates a ready-to-use start.bat (Windows) or start.sh (Linux/macOS) script for your Java Edition Minecraft server. Choose your operating system, memory allocation, Java version, and garbage collection flags to build a launch file with optional auto-restart.

Loading the tool…

What This Script Generator Configures

Running a Minecraft server on a VPS, dedicated machine, or home computer requires a startup script to launch the server JAR with the right Java arguments. This generator builds scripts with the following options:

Choosing Between Aikar Flags and ZGC

Java garbage collection (GC) manages how your server frees up unused memory. While Minecraft server performance depends mostly on single-thread CPU speed, poor GC settings can cause noticeable lag spikes when memory is cleared.

Aikar Flags (G1GC): This is a widely used set of G1GC JVM flags for Paper servers, and it can also be used with Purpur, Spigot, Fabric, Quilt, Forge, or NeoForge. The generator automatically adjusts the G1GC tuning values based on your RAM size:

ZGC (Java 21+): Available when selecting Java 21 or Java 25. If you choose Java 21, the generator adds -XX:+ZGenerational (which is only added on Java 21). You can also select None if you prefer to run the server without extra garbage collection flags.

RAM Allocation and First-Start Checklist

Your server needs enough RAM for loaded chunks, active players, plugins, and mods. However, you should not assign all of your machine's memory to the Java process. On a VPS, leave about 1 to 1.5 GB of RAM for the operating system so the system does not run out of memory.

Before running your new start script for the first time, remember these basic setup steps:

  1. Place the generated start.bat or start.sh in the same folder as your server JAR file.
  2. Accept the Minecraft EULA by opening eula.txt and setting eula=true.
  3. Ensure your firewall or router allows connections on the default Java Edition TCP port 25565 (or use a tunnel like playit.gg if hosting at home without port forwarding).

Questions

Why does the generator set -Xms and -Xmx to the same value?

Setting the initial heap size (-Xms) and maximum heap size (-Xmx) to the same amount claims all designated RAM at startup. This prevents the Java Virtual Machine from pausing the server to request more memory from the operating system while players are online.

How much RAM should I leave for the operating system on a VPS?

On a VPS, you should leave about 1 to 1.5 GB of RAM for the operating system instead of assigning all available memory to the Minecraft server.

Why do Aikar flags change at 12 GB of RAM?

At 12 GB or more, Aikar flags switch to larger-heap values: G1NewSizePercent 40 (up from 30), G1MaxNewSizePercent 50 (up from 40), G1HeapRegionSize 16M (up from 8M), G1ReservePercent 15 (down from 20), and InitiatingHeapOccupancyPercent 20 (up from 15).

When do I need a start.bat or start.sh script?

You need a start.bat (Windows) or start.sh (Linux/macOS) script when hosting a server yourself on a home computer, VPS, or dedicated server where you have root or terminal access and manage the files directly.

More server tools

See all →