How to Fix Exit Code 0, Connection Issues, and Configure online-mode

Setting up a Minecraft server often involves troubleshooting startup stops, network blocks, and authentication rules. This intermediate guide explains how to resolve Exit Code 0, fix player connection problems, and manage the online-mode setting.

Understanding and Fixing Exit Code 0 on a Server

When you search for exit code 0 hosting minecraft, it helps to know what the number actually means. In standard software, an exit code of 0 indicates that a process closed normally without an unhandled operating system crash. On a Minecraft server, however, seeing Exit Code 0 right after startup means the server intentionally shut itself down because a required condition was not met, or a mod/plugin triggered a clean stop.

Follow these steps to find and fix the cause:

  1. Accept the EULA: Before the first start, a server generates eula.txt and immediately stops with Exit Code 0. Open eula.txt, change the value to eula=true, save the file, and restart.
  2. Match the Java version to your Minecraft release: Running the wrong Java runtime causes immediate startup failures. Use the Java version lookup tool if you are unsure, or follow the standard requirements:
    • Up to Minecraft 1.16.5: Java 8
    • Minecraft 1.17: Java 16
    • Minecraft 1.18 to 1.20.4: Java 17
    • From Minecraft 1.20.5: Java 21
    • Newest releases (such as Minecraft 26.3): Java 25
  3. Check your RAM and start script: If your server runs out of memory during world generation or mod loading, the host panel may stop the container. Check our RAM calculator at /tools/ram-calculator/ to estimate how much memory your loaded chunks, players, mods, and plugins need. You can also use the start script generator to apply proper Aikar flags (a widely used set of G1GC JVM flags for Paper servers).
  4. Inspect logs for mod or plugin conflicts: If you run Paper (supported up to 26.3), Purpur, or Spigot for plugins, or Fabric (loader 0.20.1), Quilt, Forge, or NeoForge for mods, read logs/latest.log. A missing dependency will force a clean shutdown that outputs Exit Code 0.

Why Did My Minecraft Server Start, But Friends Can't Join?

A common frustration for server administrators is: "Why did my Minecraft server start but friends can't join?" When the console says the server is running, the issue is usually a network block or a default configuration rule rather than a server crash.

First, check the new defaults in server.properties. In Minecraft 26.3, the default configuration sets white-list=true (along with view-distance=10, simulation-distance=10, max-players=20, spawn-protection=16, pause-when-empty-seconds=60, and difficulty=easy). Because the whitelist is enabled by default, anyone not on the list is rejected at login. Either set white-list=false and restart, or add your friends using the console command whitelist add <username> (or build a file with the whitelist generator).

Second, verify that the server is actually reachable from outside your network using a server status checker. If you use a free host, remember that free hosts usually stop the server when nobody is online or queue starts, so the server may have gone back to sleep before your friends connected.

Troubleshooting Network Errors, Ports, and Firewalls

When players see a connection timed out message or search for network error hosting minecraft, packets are failing to travel between the client and the server. How you fix this depends on where you host and which edition you run:

How to Configure online-mode in server.properties

In server.properties (which you can customize with the server.properties generator), the setting online-mode=true is enabled by default. When set to true, the server checks every connecting player against the authentication servers to verify that they own a legitimate account and that their username matches their unique account ID (UUID).

To change this setting, open server.properties in a text editor, find the line, and adjust it:

online-mode=true

Save the file and restart the server for the change to take effect. Note that there is one valid technical reason to set online-mode=false: running a server network. When you use Velocity or BungeeCord to join several servers into a network, the front proxy handles authentication in online mode, while the backend Paper or Spigot servers must be set to online-mode=false to accept forwarded connections from the proxy.

Security Risks of Setting online-mode=false

Server owners frequently ask: "Is it safe to set online-mode=false for TLauncher players?" In short, disabling online mode on a public or standalone server creates severe security problems.

When you set online-mode=false:

If you run a proxy network (Velocity or BungeeCord) where backend servers must use online-mode=false, you must block direct external connections to those backend ports with a firewall and use the proxy's built-in forwarding secret so players cannot bypass the proxy.

Tools for this

Questions

Is it safe to set online-mode=false for TLauncher players?

No. Setting online-mode=false disables account verification. Any player can connect using any username, meaning someone can log in with the username of an admin listed in ops.json and take full control of the server. It also causes skin issues and mismatches player UUIDs.

Why did my Minecraft server start but friends can't join?

In recent versions like Minecraft 26.3, white-list=true is enabled by default in server.properties, which blocks anyone not added to the whitelist. Other common causes include closed firewall ports (TCP 25565 for Java, UDP 19132 for Bedrock), missing port forwarding when hosting at home, or giving friends your local IP instead of your public IP.

What causes Exit Code 0 on Minecraft server hosting?

Exit Code 0 means the server process closed cleanly rather than crashing. This usually happens on first start when eula=true has not been set in eula.txt, when the wrong Java version is selected for your Minecraft release, or when a plugin or mod stops the server due to a missing dependency.

Which Java version do I need to stop startup errors?

Use Java 8 for versions up to 1.16.5, Java 16 for 1.17, Java 17 for 1.18 to 1.20.4, Java 21 starting from 1.20.5, and Java 25 for the newest releases such as Minecraft 26.3.

Related guides

See all →