NapNodes
Free tool · Minecraft Java

start.bat and start.sh generator for Minecraft

Pick your system, the memory and the server type, and download the script that starts it with Aikar's flags. Put it in the server folder, next to the .jar, and double-click it.

Your computer

Your server

Memory for Java

-Xms y -Xmx4 GB
1 GB32 GB

Leave at least 1.5 GB free for Java and the system: with 8 GB in the PC and playing on the same machine, don't give it more than 4 or 5.

Options

start.bat
@echo off
title Minecraft server
java -Xms4096M -Xmx4096M -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 paper.jar --nogui
pause

How to use it

  1. Download the script (or copy it into a text file with that exact name).
  2. Put it in the server folder, where the .jar is (or run.bat, on Forge and NeoForge).
  3. On Windows, double-click it. On Linux or Mac, chmod +x start.sh and ./start.sh.
  4. The first time, accept the EULA: change eula=false to eula=true in eula.txt and start it again.

Not sure how much memory to give it? Try the RAM calculator. Is it lagging? The guide “Minecraft server lag” (in Spanish) explains where to look.

Frequently asked questions

What are Aikar's flags?

A set of Java startup options that tune how memory is freed (the G1 garbage collector) for the way Minecraft uses it. You notice it as fewer lag spikes every few seconds. They're the ones Paper recommends, and they work for Purpur, Fabric, Forge and NeoForge too.

How do I give my Minecraft server more RAM?

With -Xmx (the maximum) and -Xms (what it takes at startup), in the start script. Set them to the same value, which is what this tool does: that way Java doesn't keep resizing in the middle of a game.

How much RAM should I give it?

What the server needs, not all of the computer's: Java uses a bit more than what you set in -Xmx, and Windows and the game itself (if you play on the same PC) need theirs. Leave at least 1.5 GB free. To find out how much it needs for your players and mods, use the RAM calculator.

When I double-click it, the window closes straight away. What's wrong?

It's almost always Java: either it isn't installed or it's older than the server version needs (Minecraft 1.20.5 or later needs Java 21). With the “pause” at the end, the window stays open and you can read the error.

Where do the flags go in Forge or NeoForge?

Since 1.17, the installer creates a run.bat (or run.sh) that reads the Java options from the user_jvm_args.txt file. The flags go there, one per line, and you start it with run.bat. Choose “Forge or NeoForge” above and you get both files.

How do I run it on Linux?

Save start.sh in the server folder, make it executable with chmod +x start.sh and start it with ./start.sh. To keep it running after you close the terminal, launch it inside screen or tmux.

No script, and no PC left on

At NapNodes the server starts with “Start” in the panel and Java's memory is already set to your plan: there's no script to touch. There's a free Minecraft server, no card needed, so you can try it with your friends without leaving your computer on.

Create your free server

More free tools

All the tools