Guides / Startup flags
How to make a start.bat for a Minecraft server
Make a Windows start.bat for your Minecraft server, with the right memory and flags, in two minutes.
Updated
A start.bat file starts your server on Windows with a double-click, and keeps your memory settings and flags in one place.
Make the file
- Open your server folder (the one with the server jar).
- Right-click, choose New → Text Document, and name it
start.bat. Make sure it doesn't end in.txt: turn on View → File name extensions in File Explorer to check. - Right-click it, choose Edit, and paste your script.
A basic script looks like this:
@echo off java -Xms4G -Xmx4G -jar server.jar nogui pause
For a tuned version with Aikar's flags and your memory and jar filled in, use the startup flags generator and pick Windows.
What each line does
@echo offhides the commands so the window only shows the server's outputjava ... -jar server.jar noguistarts the server without the extra GUI window, which saves memorypausekeeps the window open if the server stops, so you can read any error
Common errors
- "java is not recognized": Java isn't installed, or isn't on your PATH. Install the right version (see which Java version) and tick the option to add it to PATH.
- "Unable to access jarfile": the jar name in the script doesn't match the file. Check the exact name, including capitals.
- The window flashes and closes: you're missing the
pauseline, so you can't see the error.
Accept the EULA
The first start creates eula.txt. Open it, change eula=false to eula=true, and run start.bat again.