Server Flags Generator

Generate Minecraft server startup scripts with optimal JVM flags for Linux, Windows, and Java.

Server file

The .jar file to run. Must be in the same folder as the script.

Options

Control Panel

Restart after stopping

Adds the -Dpaper.ignoreJavaVersion=true flag

Flags

Runs Java without special flags (default settings)

Optimal flags for Paper. Suitable for most cases Learn more

Modern flags with low GC latency, but higher memory consumption (Java 21+) Learn more

Alternative flags with low GC latency (Temurin JDK recommended) Learn more

Optimized flags for a proxy server Learn more

Memory: 4 GB
Result
1#!/bin/bash
2 
3java -Xms4096M -Xmx4096M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar --nogui