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 yourtarget/folder (the one containing all dependencies). - Gradle: Run
gradle shadowJar(if using the Shadow plugin) to build a standalone executable.
2. Uploading & Startup
- Upload your compiled
.jarfile to the File Manager. - Upload any configuration files (e.g.,
config.jsonorapplication.yml). - Go to the Startup tab and change the
Server Jar Filevariable to match the exact name of your uploaded jar file (e.g.,MyBot-1.0-all.jar).
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.