Java Bot Hosting

Host Java-based applications, including Discord bots using JDA (Java Discord API) or Spring Boot backends. We support Java 8, 11, 17, and 21.

1. Preparing Your Jar

Unlike Python or Node.js where you upload source code, Java applications must be compiled into an executable .jar file before uploading.

  • Maven: Run mvn clean package. Look for the "fat" or "shaded" jar in your target/ folder (the one containing all dependencies).
  • Gradle: Run gradle shadowJar (if using the Shadow plugin) to build a standalone executable.

2. Uploading & Startup

  1. Upload your compiled .jar file to the File Manager.
  2. Upload any configuration files (e.g., config.json or application.yml).
  3. Go to the Startup tab and change the Server Jar File variable to match the exact name of your uploaded jar file (e.g., MyBot-1.0-all.jar).
JVM Flags

If your application requires specific memory flags (like -Xmx), do not worry. The Pterodactyl daemon automatically allocates the correct amount of heap space based on your plan limits.

3. Environment Variables

You can read environment variables in Java using System.getenv("VARIABLE_NAME"). However, the standard Pterodactyl container doesn't automatically load .env files for Java. We recommend passing secrets through your configuration files (which are not uploaded to Git) or configuring custom environment variables in the panel's Startup tab if supported.