Minecraft Server Keeps Crashing: Causes and Fixes
Quick answer: 80% of Minecraft server crashes come from five causes, in this order. Out of memory (Java heap space), wrong Java version for your Minecraft version, a single broken plugin or mod, corrupted world or region files, and the server running out of disk space. Open logs/latest.log, read the last 100 lines, and the exception class will tell you which one you're hitting. The rest of this guide walks through each cause with what to look for and how to fix it.
Rules of thumb to skip to the right section: if your server crashes once a week, it's probably a plugin. If it crashes every few minutes during peak, it's RAM. If it crashed once and now refuses to start at all, it's Java version, corruption, or disk.
First: read the actual error
Before guessing, look at the log. Almost every Minecraft crash leaves a clear root cause if you know where to read.
The files you want:
logs/latest.log— running server log, crashes leave their trace herecrash-reports/crash-YYYY-MM-DD_*.txt— generated when the JVM crashes outright (mostly on modded servers)- Your panel's console scrollback if you don't have file access
Scroll to the very end of the log. Look for these patterns:
Exception in server tick loopEncountered an unexpected exceptionjava.lang.OutOfMemoryErrorCaused by:(the actual root cause is usually below the first error in the chain)
The stack trace lists the path through the code that failed. Plugin and mod names show up in the path, so even if a generic error gets thrown, you can usually see which plugin or mod is responsible.
Cause 1: Out of memory (Java heap space)
Error signature:
java.lang.OutOfMemoryError: Java heap space
or:
java.lang.OutOfMemoryError: GC overhead limit exceeded
What's happening: Your server hit its RAM ceiling and crashed trying to allocate more.
Fixes in order:
-
Add 2 GB and see if it stabilizes. Don't jump straight to 16 GB on a tiny server. Too much RAM causes its own problems (longer GC pauses, more crashes).
-
Set
XmsandXmxto the same value. If your start command has-Xms2G -Xmx8G, change both to8G. Letting Java grow the heap at runtime causes crashes during the resize. -
Use Aikar's flags. Java's default GC settings are bad for Minecraft. Aikar's flags tune G1GC for low-pause behavior:
-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 -
Hunt the memory leak. If RAM climbs until OOM no matter how much you give it, a plugin or mod is leaking. Install Spark and run
/spark heapsummaryto see what's eating memory.
Cause 2: Wrong Java version
Error signature:
java.lang.UnsupportedClassVersionError: ... has been compiled by a more recent version of Java
or:
Class file has wrong version 60.0, should be 52.0
What's happening: Your Minecraft version needs a specific Java version, and you're using the wrong one.
| Minecraft version | Java version |
|---|---|
| 1.20.5 and newer | Java 21 |
| 1.18 to 1.20.4 | Java 17 |
| 1.17 | Java 16 or 17 |
| 1.13 to 1.16.5 | Java 8 or 11 |
| 1.12.2 and older | Java 8 only |
Fix: Install the right Java version and point the server at it. On Linux:
sudo apt install openjdk-21-jre-headless # for 1.20.5+
sudo apt install openjdk-17-jre-headless # for 1.18 to 1.20.4
sudo apt install openjdk-8-jre-headless # for 1.16.5 and older
On a hosting panel, you pick the Java version from a dropdown next to your server jar. Server Heron auto-selects the right version when you pick your Minecraft jar, so this category of crash usually doesn't happen to our customers.
Cause 3: A broken plugin or mod
Error signature:
Could not load 'plugins/SomePlugin.jar'
java.lang.NoClassDefFoundError: org/bukkit/...
or:
[Server thread/ERROR]: Could not pass event ... to PluginName
or for mods:
LoaderExceptionModCrash: Caught exception from modname
What's happening: A plugin or mod is incompatible with your Minecraft version, missing a dependency, or has a real bug.
Fix:
- Read the error. The plugin or mod name is in the message. That's your suspect.
- Check version compatibility. Many plugins lag behind Minecraft releases. A plugin built for 1.20.4 will often crash on 1.21.
- Check for missing dependencies. Plugins often need PlaceholderAPI, Vault, ProtocolLib, or others to load. If the error is
NoClassDefFoundErrorfollowed by a class name, search that class name to find the missing dependency. - Update the plugin. Grab the latest version from SpigotMC, Modrinth, or the plugin's GitHub.
- If it still crashes, isolate it. Move the
.jarto aplugins/disabled/folder and restart. If the server starts cleanly, you found the culprit. Then choose: replace the plugin, drop a feature, or stay on the older Minecraft version it works on.
For modded servers, the same logic applies, but mod dependencies are deeper. If the crash names a specific mod, search the exact error message in that mod's GitHub issues. Most modded crashes have been seen before by someone.
Cause 4: Corrupted world or region files
Error signature:
java.io.IOException: Failed to read chunk
RegionFile: Region file r.X.Y.mca chunk header is invalid
Or symptoms: the server starts but a specific player can't join, or it crashes when someone walks into a specific area.
What's happening: A region file got corrupted, usually because of a hard crash, a power failure, or running out of disk during a chunk write.
Fixes:
- Restore from backup. The cleanest fix. Most managed hosts (including Server Heron) run automatic daily backups. Roll back to yesterday's snapshot.
- Use MCA Selector. Free tool that opens region files and lets you delete corrupted chunks. Deleted chunks regenerate when a player walks into them. Players lose anything they built in those chunks, but the server starts again.
- For player data corruption, delete or rename the offending player's
.datfile inworld/playerdata/. They lose inventory and position but can rejoin clean. - If the world refuses to load at all, remove the most recently modified region files one at a time. The chunks written right before the crash are usually the problem.
Cause 5: Disk full
Error signature:
java.io.IOException: No space left on device
Failed to write chunk data
What's happening: The server can't write to disk anymore.
Fix:
- Check disk usage.
df -hon Linux, or look at your panel's storage display. - Find what's eating space. Common culprits: oversized log files in
/logs, old backups stored on the same disk, CoreProtect database growing unbounded, world bloat from players exploring far out. - Trim logs. Old
.log.gzfiles in/logscan be deleted safely. - Trim the world. Run
/chunky trimif you have Chunky installed to remove chunks far from spawn that nobody uses. - Increase storage if your panel supports resizing.
Cause 6: Watchdog timeout
Error signature:
[Server Watchdog/ERROR]: A single server tick took 60.00 seconds
[Server Watchdog/ERROR]: This is usually caused by a plugin or world corruption
What's happening: The main server thread froze for over 60 seconds. The watchdog killed the JVM to stop the hang.
Common causes: infinite loop in a plugin, deadlocked database call, runaway chunk generation, mob farm with thousands of entities.
Fix:
- Read the thread dump. When watchdog fires, it dumps the call stack of whatever was running. The plugin or mod at the top of the stack is your suspect.
- Install Spark. Run
/spark profiler --timeout 60next time the server gets sluggish to catch the freeze before it becomes a crash. - Remove the suspect plugin to confirm.
Cause 7: Port already in use
Error signature:
Failed to bind to port 25565
java.net.BindException: Address already in use
What's happening: Another process is on the port. Usually a stale Minecraft process that didn't shut down cleanly.
Fix on Linux:
lsof -i :25565 # find what's using the port
kill -9 <PID> # kill the stale process
On a panel, restart the server through the panel UI. Pelican and Pterodactyl both kill stale processes on restart.
Cause 8: Modpack crashes on startup
Symptom: Server hangs during mod loading and never starts, or crashes during the "loading registries" phase.
What's happening: A specific mod is throwing an exception during init. The log will name it.
Fix:
- Read the log carefully. The last mod loaded before the crash is almost always the problem.
- Update the mod to the latest version for your Minecraft and loader version.
- Check the mod's GitHub issues for your exact error. Most modded crashes have been seen before.
- Disable the mod by moving it out of
/modsand see if the server starts. - Ask in the modpack's Discord. Pack authors recognize their own crashes quickly.
Cause 9: A specific player crashes the server
Symptom: Server runs fine until one player joins, then crashes immediately.
What's happening: Their player data is corrupted, or they're carrying an item with broken NBT data (a banner from a removed mod, an item from a no-longer-installed plugin).
Fix:
- Move their
.datfile out ofworld/playerdata/. They respawn at spawn with empty inventory. Annoying for them, but the server runs. - For corrupted areas (not players), use MCA Selector or NBT Explorer to remove the offending entity from the world.
How to share a log when you need help
If you've tried the relevant section and you're still stuck, share the log with someone who can read it. Don't paste 10,000 lines into Discord chat.
Use a paste service:
- mclo.gs (Minecraft-specific, parses common errors automatically and highlights problems)
- pastebin.com
- gist.github.com
Copy your logs/latest.log, paste it into one of those, share the link. Most Minecraft admin communities can diagnose a crash in seconds from a properly shared log.
Quick reference: error to cause
| Error message | Likely cause |
|---|---|
java.lang.OutOfMemoryError |
Not enough RAM (Cause 1) |
UnsupportedClassVersionError |
Wrong Java version (Cause 2) |
Class file has wrong version |
Wrong Java version (Cause 2) |
NoClassDefFoundError |
Missing plugin dependency (Cause 3) |
Could not pass event |
Plugin bug (Cause 3) |
LoaderExceptionModCrash |
Mod crash (Cause 3 or 8) |
Failed to read chunk |
World corruption (Cause 4) |
Region file ... invalid |
World corruption (Cause 4) |
No space left on device |
Disk full (Cause 5) |
single server tick took 60.00 seconds |
Watchdog timeout (Cause 6) |
Failed to bind to port |
Port in use (Cause 7) |
FAQ
Why does my server crash every few hours but not at startup?
Almost always RAM. The heap fills slowly until it OOMs. Bump RAM, or hunt the leak with /spark heapsummary.
My server crashes at the same time every day. Why?
Scheduled tasks: a backup process, an auto-restart that hangs, or a plugin's daily reset firing badly. Check your scheduled task list and plugin configs.
Can a crash corrupt my world?
Yes. A hard crash mid-chunk-save can leave a region file half-written. This is exactly why daily backups matter. If your host doesn't offer automatic backups, set up a plugin or panel task to make them yourself.
How do I prevent crashes long-term?
Daily auto-restart (clears slow memory leaks before they OOM), automatic backups (gives you a rollback when something does break), and Spark installed (so when you do hit lag or freeze, you can diagnose it in 60 seconds).
My modpack server crashes when one specific player joins. Is it their fault?
Probably not. Their player data file has something the server can't load: an item from a removed mod, a broken NBT tag, an entity reference that no longer resolves. Move their .dat file aside and they can rejoin.
Should I upgrade to a newer Java version to fix crashes?
Only if your Minecraft version needs it. Running a newer Java than your Minecraft version supports can also cause crashes. Match the table above exactly.
Does Server Heron handle any of this automatically?
We auto-select the right Java version, ship Aikar's flags out of the box, run automatic daily backups, and the panel kills stale processes on restart so port-bind errors don't happen. The remaining causes (plugins, mods, world corruption) are still your call to fix because they depend on what you're running.
Bottom line
Most Minecraft server crashes are diagnosable from the log if you know what to read. The cause is almost always one of:
- Not enough RAM, or a memory leak
- Wrong Java version for your Minecraft version
- A broken or out-of-date plugin or mod
- A corrupted world or player file
- Out of disk space
Read the last 100 lines of logs/latest.log, find the exception, match it against the reference table. If you can't figure it out, paste the log to mclo.gs and ask in your hosting community. Most crashes are something someone has already seen and fixed.
If you're tired of debugging and want a host that handles RAM tuning, Java selection, automatic backups, and stale-process cleanup for you by default, that's most of what we built Server Heron to do.