Server startup file

Own server

start.bat and start.sh with memory and flagsLearn more

The server jar does not run with a double click; next to it, you need the launch file. Collect it here: memory, flags and clues as Java needs.

My game select version

We'll remember in this browser and set up where your version is available. Open link settings are more important than this choice; the Vicki versions do not change.

What are you running?

What is on the server

Paper, Spigot and a dozen or two plugins.

JVM flags

Configure the garbage collector as recommended by the Paper documentation. Suitable for both vanilla and mods.

Game version

You need Java 25 or newer, both vanilla servers and Paper.

Players and memory

Our rating is 4 GB: 2.8 GB requests a vanilla server with so many players in I'm gonna measure it.One more is the Plagina assembly, it's already an outfit.

System and startup

What the file is called on the disk - along with the extension. Windows hides it: “paper-1.21.8” in Explorer is “paper-1.21.8.jar” on the disk.

Result

File · Start.bat

start.bat Java 25

@echo off
cd /d "%~dp0"
java -Xms4G -Xmx4G -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
pause
Need Java
25 or newer
Server memory
4 GB
Free by car
from 6 GB

Place it next to the jar and double-click it to run.

Pick up the start.bat
Are you running via panel or systemd?

One line

The panel (Pterodactyl, Pufferpanel) starts the server itself and asks for a command rather than a file: it does not accept a loop wrapper; restart is its work. The same line is suitable for a loop. screen and tmux.

java -Xms4G -Xmx4G -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

How to use

  1. Place the file next to the jar

    To the same folder, not to a neighboring one: the paths in the command are relative, and a server launched from another location will create a world where it was called from.

  2. Install the required Java

    Number - as a result, on the file tab. Newer is possible, older is not possible: the server will respond UnsupportedClassVersionError. Check: java -version.

  3. Run

    Place it next to the jar and double-click it to run.

  4. Accept the EULA

    The first run will create eula.txt and stops: change eula=false on eula=true and run again.

About memory and flags

  • -Xms is equal to -Xmx intentionally. This is what Aikar advises: the heap is taken as a whole at once and does not grow as the game progresses. Different values ​​give pauses where the heap expands.
  • Do not give the server all of your machine's memory. Paper documentation advises leaving 1000–1500 MB for the system and the JVM itself. Hence the line “free by car.”
  • More is not better. Paper writes that a plagin server should give 6–10 GB regardless of the number of players, and 32 GBs were wasted money. Pufferfish recommends not giving one server more than 16 GB.
  • The flags for the big pile are included themselves, above 12 GB. There is no separate button intentionally: Aikar writes “for 12 GB and less, these parameters do not need to be changed.”
  • Without flags is also an option. PaperMC itself advises on Java 17 and later to first try launching without a single flag.
  • The window closed instantly - the server crashed at the start. For this purpose in start.bat without restarting and costs pause: The window remains open along with the error text.

Flags checked against Aikar publication and PaperMC and Velocity documentation. Java requirements - from Minecraft Wiki and docs.papermc.io.

Frequently asked questions

Why won't the Minecraft server start when I double-click it?

The server jar doesn't run like this: you need a launch file that calls Java with the right arguments. This is the first thing they start up before eula.txt.

Why does the console window close immediately?

The server crashed at the start, and the window closed along with it, without showing an error. In .bat, a pause at the end helps - it will leave a message on the screen.

How much RAM should I allocate to the server?

Not everything on the car: the system should be left near the gigabyte. PaperMC advises a server with 6-10 GB plagins, regardless of the number of players, and calls 32 GB wasted.