Server Start Script

Set your RAM and download a start.bat or start.sh for your Minecraft Java server.

Java

Launch settings

Use Java 25 for Minecraft 26.1 through 26.3.

Server memory

start.bat

@echo off
setlocal DisableDelayedExpansion
pushd "%~dp0" || exit /b 1
if not exist "server.jar" (echo JAR file not found. & popd & exit /b 1)
where java >nul 2>&1 || (echo Java was not found on PATH. & popd & exit /b 1)
:start
java -Xms4G -Xmx4G -jar "server.jar" nogui
echo Server stopped. Restarting in 5 seconds.
timeout /t 5 /nobreak >nul
goto start

Point the script at your server JAR

Set Operating system to the machine that runs your server. If you play on Windows but rent a Linux server, pick Linux or macOS. Use Minecraft version to see which Java installation the server needs.

Enter the exact name of the file in JAR filename. For example, if your server folder contains paper.jar, enter that name with the extension. Leave the field blank to use server.jar with Java defaults or velocity.jar with Velocity flags. The script uses the folder you save it in to find the JAR and your server settings.

Leave room for the machine to run

Use RAM allocation to set how much memory Java starts with and can grow to. Turn on Set minimum and maximum separately if you want Java to start with less memory than it can use later. You can enter 2G for the minimum and 4G for the maximum. Java, your operating system and any other apps also need memory, so keep the maximum below what the machine has available.

Try Java defaults first for a vanilla server. Use Velocity flags for a Velocity proxy JAR. If you choose Aikar's flags, the preset recommends using the same amount for both memory fields.

Start it from the server folder

  1. Use Download script and save the file next to your JAR.
  2. On Windows, run start.bat. On Linux or macOS, open a terminal in the server folder and run bash start.sh.
  3. Check the console for startup messages. If the script cannot find Java, open a terminal and run java -version to check your installation. On the first launch, Minecraft may ask you to review its EULA in eula.txt.

Turn off Restart after exit when working on the server. With it on, the script starts the server again five seconds after it stops. End the script with Ctrl+C when you want it to stay off.