Minecraft Start Script Generator
Pick version, server software and memory. You get a ready start script for Linux and Windows with matching Java flags.
Forge and NeoForge from 1.17 start through the bundled run.sh or run.bat. Put the Java flags into user_jvm_args.txt there; the file is shown below.
Linux and macOS (start.sh)
On Linux, make the script executable once with chmod +x start.sh, then start it with ./start.sh.
Windows (start.bat)
user_jvm_args.txt
What the flags do
Xms and Xmx fix the memory so Java does not request more during play. The Aikar flags tune the G1 garbage collector so short stutters from memory cleanup happen less often. For very small servers under 2 GB they do little.
Continue on your server
Open your server dashboard if needed. Confirm changes to settings and worlds there yourself.